-
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
env parameter of cdk.Stack constructor seems to be ignored #2841
Comments
It looks like @made2591 linked a duplicate issue that has since been resolved. Thanks! |
Thanks for following up. I tested again with the latest CDK release:
Unfortunately, the issue still persists; i.e. despite an explicit region specification of "us-east-2", issuing "cdk deploy" creates a stack in my default region (which is not us-east-2). |
Can you please share some code for a minimal repro? |
Oh, just saw that you provided one... Are you propagating |
No; I was not. I just corrected that and tried again, and the stack indeed is created in us-east-2. Sorry for not catching that earlier. Thanks for your advice. Take care. |
No worries, just made the same mistake myself in a little python app I am working on :-) |
Just for future googlers - I just bumped into this on CDK 2.8. I was referencing the region/account passed in via |
Describe the bug
env
parameter ofcdk.Stack
constructor seems to be ignored. Apologies if I overlooked something obvious.To Reproduce
Initialize a new python CDK project
cdk init --language python
./cdk_test/cdk_test_stack.py: initialize any construct/resource in the sample stack class; e.g.
sns.Topic(self, 'CdkTestTopic')
app.py: initialize the stack with an explicit region that differs from your default; e.g.
Expected behavior
Relevant cdk commands that interact with CloudFormation (e.g., diff, deploy, destroy, etc.) should operate on the region specified above in app.py. In my case, they did not.
Version:
The text was updated successfully, but these errors were encountered: