-
Notifications
You must be signed in to change notification settings - Fork 457
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
cdktf.out: Inconsistent stacks in cdktf.out when creating stacks dynamically #2929
Comments
cdktf works under the assumption that your code is the authoritative source. When a stack is removed from your code (by dynamically disabling), it assumes that you are intentionally removing it. |
@jsteinich Thanks for routing me to the issue. Going through the same made sense of why its happening this way with stacks in cdktf.out. As you mentioned, I could see that when I remove a stack from the code dynamically by altering it the env variable associated, the same gets removed from the cdktf.out. I'd a couple of further questions on the same:
|
|
Thanks for the clarity. |
Hi @suvhotta 👋 Has this been resolved or do you have any further questions? |
@ansgarm No I don't have any further queries. |
Hi there! 👋 We haven't heard from you in 30 days and would like to know if the problem has been resolved or if you still need help. If we don't hear from you before then, I'll auto-close this issue in 30 days. |
Cool! Let me close this then |
I'm going to lock this issue 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 similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Expected Behavior
I'm trying to create stacks dynamically by passing the stack ids as env variables in the runtime.
After I'm deploying 2 sets of infra, can see that the cdktf.out folder contains only the stacks with the names corresponding to the latest ones and the first set isn't present in the cdktf.out. This leads to inconsistency while doing
cdktf list
. Ideally all the sets of infra created should be part of cdktf.out directory.Actual Behavior
Ideally the cdktf.out should contain all the 4 stacks: frontend_stack_dev, backend_stack_dev, frontend_stack_dev2, backend_stack_dev2.
Steps to Reproduce
main.py:
During deploying:
Deploying the second set of infra:
Versions
language: python 3.11
cdktf-cli: 0.15.5
cdktf: 0.15.5
node: v20.2.0
Providers
No response
Gist
No response
Possible Solutions
No response
Workarounds
No response
Anything Else?
No response
References
My use-case involves passing stack names during runtime and thus creating the stack-ids dynamically. I tried using Terraform Variables but since they can be only used within Stack/Construct scope, was unable to use them directly in main.py.
I went through:
Help Wanted
Community Note
The text was updated successfully, but these errors were encountered: