-
Notifications
You must be signed in to change notification settings - Fork 450
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
Handle Multiple Stacks #636
Conversation
This is possible in the current state, but not really convenient. Will create a follow up issue to make this more idiomatic. |
Maybe we should also update the |
Just tested it locally, works great 🚀 |
remove outdated statement as #636 introduced multiple stacks
I'm going to lock this pull request because it has been closed for 30 days. This helps our maintainers find and focus on the active issues. If you've found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
This will change the commands
synth
,diff
,deploy
anddestroy
to handle more than one stack per application.Current Behaviour prior to this Change
When using
cdktf
the application code is synthesized into the configured output folder (cdktf.out
by default) ascdk.tf.json
file. The output folder serves as working directory for the Terraform CLI for the commands which interacting with it (diff
,deploy
,destroy
). Since we do have a static output folder, users might copy assets such as zip files as part of the stack synth manually in the output folder.Changed behaviour
We'll have a
stacks
folder within the app output directory (cdktf.out
), where each stack will synthesize itself in a sub directory (e.g.cdktf.out/stacks/stack-a
). This will then serve as the working directory for all Terraform CLI commands. There won't be an automatic cleanup of the stacks directory.Planned Changes
deploy
,diff
,destroy
to take a positional stack argument. If more than one stack exists, that's a mandatory argumentFind a good way to access the stack's working directory on a construct level (e.g. to copy / generate assets)(extracted in Asset Construct #648)terraform.tfstate
file in project root and prompt the user to rename itFixes #289 #35