Skip to content
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 cli: isolate stack #26589

Closed
2 tasks
tommydongaws opened this issue Aug 1, 2023 · 5 comments
Closed
2 tasks

cdk cli: isolate stack #26589

tommydongaws opened this issue Aug 1, 2023 · 5 comments
Labels
duplicate This issue is a duplicate. feature-request A feature should be added or improved. package/tools Related to AWS CDK Tools or CLI

Comments

@tommydongaws
Copy link

tommydongaws commented Aug 1, 2023

Describe the feature

Could there be a flag to just run 1 stack inside the app?

cdk synth <stacka>
Current Behavior:
running all the stacks and then return the template for stack A.

Requested behavior:
only run stack A and then return that template for stack A.

Cx workaround:
remove stack b from App

Use Case

If it is isolated then in cases where "stack b" modifies "stack a" the output for stack a would be different.
Additionally it would be faster.

Proposed Solution

No response

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CDK version used

2.89.0

Environment details (OS name and version, etc.)

Windows

@tommydongaws tommydongaws added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Aug 1, 2023
@github-actions github-actions bot added the package/tools Related to AWS CDK Tools or CLI label Aug 1, 2023
@khushail
Copy link
Contributor

khushail commented Aug 1, 2023

@tommydongaws , thanks for reaching out. It would be helpful if you could state your usecase why this particular change is requested.

@khushail khushail added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. and removed needs-triage This issue or PR still needs to be triaged. labels Aug 1, 2023
@kprashob
Copy link

kprashob commented Aug 2, 2023

the issue is when you follow this guidance from AWS, the stacks are no longer isolated:
https://docs.aws.amazon.com/cdk/v2/guide/resources.html#resource_stack

if you create a resource in one stack and expose it, then modify it in another stack, the stacks are no longer isolated. The change from stack 2 is deployed when you deploy stack 1. This breaks the mental model of stacks being isolated.

For example, if you create a lambda in one stack, then in another stack you create a dynamo table and grant access to the lambda, the lambda permissions from stack 2 are deployed with stack 1. This can create unexpected behavior if you were expecting the stacks to deploy in isolation.

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Aug 3, 2023
@adrianwright
Copy link

Why is stack isolation not default behavior in CDK? It seems to me that resource definitions from one stack should not exist in the CF template generated by a different stack.

@peterwoodworth peterwoodworth added the duplicate This issue is a duplicate. label Aug 3, 2023
@peterwoodworth
Copy link
Contributor

Duplicate of #6743

@peterwoodworth peterwoodworth marked this as a duplicate of #6743 Aug 3, 2023
@github-actions
Copy link

github-actions bot commented Aug 3, 2023

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue is a duplicate. feature-request A feature should be added or improved. package/tools Related to AWS CDK Tools or CLI
Projects
None yet
Development

No branches or pull requests

5 participants