Matthew Purdon
03/30/2021, 1:21 PMFrank
App
to different environments/accounts. So we didn’t take Stage
into consideration.Matthew Purdon
03/30/2021, 7:00 PMFrank
sst.Stack
’s scope to take a Construct
instead of limiting it to an <http://sst.App|sst.App>
.Frank
Matthew Purdon
03/30/2021, 7:04 PMapp->pipeline(app)->stage(pipeline)->stack(stage)
Frank
Stage
construct?Matthew Purdon
03/30/2021, 7:11 PMFrank
<http://sst.App|sst.App> -> cdk.PipelineStack(app) -> cdk.Stage(pipeline) -> sst.Stack(stage)
Matthew Purdon
03/30/2021, 7:44 PMFrank
Matthew Purdon
03/30/2021, 7:46 PMFrank
Matthew Purdon
03/30/2021, 7:48 PMFrank
node_modules/@serverless-stack/resources/dist/Stack.d.ts
and change:
constructor(scope: App, id: string, props?: StackProps);
to
constructor(scope: cdk.Construct, id: string, props?: StackProps);
That should work for now.Frank
cdk.Construct
as its scope, give it a tryMatthew Purdon
04/01/2021, 7:13 PMMatthew Purdon
04/01/2021, 7:13 PMMatthew Purdon
04/01/2021, 11:51 PMroot.logicalPrefixedName
when we call the super() for the sst.StackMatthew Purdon
04/01/2021, 11:52 PMMatthew Purdon
04/01/2021, 11:53 PMFrank
root.logicalPrefixedName
? Can you share a code snippet maybe?Matthew Purdon
04/02/2021, 2:20 AMMatthew Purdon
04/02/2021, 3:31 AMMatthew Purdon
04/02/2021, 3:34 AM"@aws-cdk/pipelines": "1.94.1",
to your package.json
Frank
Matthew Purdon
04/02/2021, 4:56 PMFrank
Frank
Frank
Error: Stack 'dev-dev-my-app-stack' does not have deployment role information; use the 'DefaultStackSynthesizer' synthesizer, or set the '@aws-cdk/core:newStyleStackSynthesis' context key.
I think there’s an issue with the way SST runs cdk bootstrap
. For now, this seems to be able to by pass the issue. Add a cdk.json
file in the same folder as your sst.json
with the content:
{
"context": {
"@aws-cdk/core:newStyleStackSynthesis": "true"
}
}
Frank
Matthew Purdon
04/05/2021, 2:53 PMMatthew Purdon
04/05/2021, 2:54 PMFrank
cdk bootstrap
once per region per account that you are going to deploy into. And it seems CDK pipeline wants all accounts (dev, prod, etc plus the account for the pipeline) bootstrapped before synthesizing. At least that’s what I’ve gathered so far. So the accounts have been bootstrapped once before, you technically shouldn’t get this error anymore.Frank
Matthew Purdon
04/05/2021, 6:04 PM{
"version": "0.2",
"phases": {
"install": {
"commands": "npm install -g aws-cdk"
},
"build": {
"commands": [
"cdk -a . deploy dev-MyBackendPipeline --require-approval=never --verbose"
]
}
}
}
Which fails because it can’t find the dev-MyBackendPipeline
stack in the output from the previous stages. I am checking into it nowSyed Farhan
04/07/2021, 11:00 PMFrank
Frank
export default function main(app: <http://sst.App|sst.App>): void {
if (process.env.IS_LOCAL) {
new MyStack(app, "my-stack");
}
else {
new cdk.Pipeline(...)
}
}
Frank
sst start
u add the Stacks to the app directlySyed Farhan
04/07/2021, 11:06 PMSyed Farhan
04/07/2021, 11:06 PMFrank
Syed Farhan
04/07/2021, 11:07 PMFrank
Frank
export default function main(app: <http://sst.App|sst.App>): void {
if (app.stage === "local") {
new MyStack(app, "my-stack");
}
else {
new cdk.Pipeline(...)
}
}
Frank
local
stage for development that’s not part of the pipeline.Matthew Purdon
04/07/2021, 11:09 PMif (process.env.npm_lifecycle_event === 'start') {
new ApplicationStack(app, 'api', { tags });
} else {
new PipelineStack(app, 'BackendPipeline', {
description: 'The Pipeline that deploys the API',
tags,
});
}
Matthew Purdon
04/07/2021, 11:12 PM"start": "sst start --stage=${USER} --verbose"
Syed Farhan
04/07/2021, 11:15 PM