question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cdk synth doesn't work with multiple stacks

See original GitHub issue

Note: for support questions, please first reference our documentation, then use Stackoverflow. This repository’s issues are intended for feature requests and bug reports.

  • I’m submitting a …

    • 🪲 bug report
    • 🚀 feature request
    • 📚 construct library gap
    • ☎️ security issue or vulnerability => Please see policy
    • ❓ support request => Please see note at the top of this template.
  • What is the current behavior? If the current behavior is a 🪲bug🪲: Please provide the steps to reproduce

from aws_cdk import (
    aws_s3,
    core
)

class BucketStackOne(core.Stack):
    def __init__(self, app: core.App, id: str, **kwargs) -> None:
        super().__init__(app, id, **kwargs)
        aws_s3.Bucket(scope=self, id='Bucket1')


class BucketStackTwo(core.Stack):
    def __init__(self, app: core.App, id: str, **kwargs) -> None:
        super().__init__(app, id, **kwargs)
        aws_s3.Bucket(scope=self, id='Bucket2')


app = core.App()
BucketStackOne(
    app=app,
    id='stack1',
    env={
        'region': os.environ['CDK_DEFAULT_REGION'],
        'account': os.environ['CDK_DEFAULT_ACCOUNT']
    })

BucketStackTwo(
    app=app,
    id='stack2,
    env={
        'region': os.environ['CDK_DEFAULT_REGION'],
        'account': os.environ['CDK_DEFAULT_ACCOUNT']
    })

app.synth()

cdk synth produces no output

  • What is the expected behavior (or behavior of feature suggested)?

list down synthesized templates from all stacks

  • What is the motivation / use case for changing the behavior or adding this feature?

to see synthesized templates before deploying

  • Please tell us about your environment:

    • CDK CLI Version:0.36.0 (build 6d38487)
    • Module Version: 0.36.0
    • OS: [Ubuntu]
    • Language: [Python ]
  • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. associated pull-request, stackoverflow, gitter, etc)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
lkonieczcommented, Dec 2, 2020

@blake-enyart -e option

0reactions
HeskethGDcommented, Nov 15, 2022

I am running cdk synth in a project with cdk pipelines and it only seems to be synthesising the devops pipeline stack and not the stacks that it deploys. I’m looking in the cdk.out folder. I have been able to deploy and I have on previous occasion seen the other stack files in this folder but something is stopping it from generating them now when I run cdk synth. Their names are printed when I run cdk ls and no errors are returned. If I run cdk synth specific_stack_name it will print to terminal but not produce a file in cdk.out.

My bad: they end up in an assembly folder within cdk.out. I think I saw them in the root before because I had deployed outside of cdk pipelines perhaps.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Create an app with multiple stacks - AWS Documentation
Stacks are the unit of deployment: each stack in an app can be synthesized and deployed individually using the cdk deploy command. This...
Read more >
cdk synth with stack name provided still synths all the stacks in ...
The synth command synthesizes a CloudFormation template from your CDK code, and per CDK docs, it will always run the whole app and...
Read more >
@seed-run/aws-cdk - npm
If there are multiple stacks in your application, cdk synth will synthesize the cloud assembly to cdk.out . $ # Synthesize cloud assembly...
Read more >
Hey CDK, how do cross-account deployments work?
The AWS CDK makes it easy to deploy your application, regardless if it consists of multiple stacks that are deployed in multiple accounts ......
Read more >
CDK Shorts #2 – Parallel Deployments | Rehan van der Merwe
The Problem. You have to wait a long time when you have a large CDK project that needs to deploy many stacks. The...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found