-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cdk synthesize clarification #8132
Comments
I would second the confusion here. I still can't tell for sure if I need to run |
@suhaig thanks for letting us know about that. it seems like the documentation needs a bit of a refresh. copy @jerry-aws
const app = new cdk.App();
new ExampleStack(app, 'ExampleStack');
new ExampleStack(app, 'MyOtherExamplestack'); cdk synth would render to
The printed output is intended to be human readable (which is why we render it in YAML). The @strottos you do not need to run |
We could really use more content on the CDK lifecycle in the dev guide. |
@shivlaks thanks for the clarification. You said that users don't interact directly with cloud assembly. I thought that synth can be used to create a cloud assembly that can be deployed later. For example in a CI system the build pipeline would create the cloud assembly, upload it to some artifact storage system and later the deploy pipeline would deploy it. So what I mean is that users should know that synth is creating a cloud assembly behind the scenes. |
@suhaig absolutely, you're right. I meant users don't interact directly with the contents in the cloud assembly (i.e. the manifest, the templates, etc). The assembly itself is an artifact and would be used as you've described. hope that clarifies things! |
Thank you @shivlaks, it's clear now. To summarize: |
@suhaig - good catch, I'll update that area of the README today |
Addresses some confusion that users have run into (#8132) as synth behavior is out of alignment with the documentation.
Addresses some confusion that users have run into (#8132) as synth behavior is out of alignment with the documentation. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Closing this issue since it seems to have been resolved by #8264. Feel free to reopen. |
Hello, I am experiencing an issue with my multi-stack app when using a GitHub workflow to deploy stacks and provision dashboards to Grafana. I use an action script that synthesize the stack before it use aws.Cloudformation from the sdk. It works fine when only one stack is defined. Problem is when I want to only synth one stack. Because this multi stack app has stacks that should be deployed to separate accounts, it seems to run into trouble when synthesizing, as it has to authenticate with proper credentials, and I only have access to one account credentials at one time. I figured out, when it runs
const app = new cdk.App();
new GrafanaStack(app, 'GrafanaStack', {
env: { account: '227777556644', region: 'eu-central-1' },
domain: 'example.com',
subdomain: 'grafana',
cloudWatchAssumeRoleArn: 'arn:aws:iam::229944008877:role/grafana-role',
});
new InfluxDBStack(app, 'InfluxDBStack', {
env: { account: '229944008877', region: 'eu-central-1' },
}); It's worth noting that this error doesn't seem to be a problem on some workflow jobs, but it breaks the InfluxDBStack for some reason. I would like to reopen this issue to troubleshoot and resolve this problem. |
❓ General Issue
The Question
According to the documentation the
cdk synthesize
command synthesizes and prints the CloudFormation template for the given stack. But in reality it prints the template of the given stack and outputs every stack's template tocdk.out
. I don't know if this is a bug or the intended behavior. In the latter case why was it implemented this way? Why does it print to the console and output to the directory at the same time?Environment
Other information
The text was updated successfully, but these errors were encountered: