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 Deploy: Environment agnostic deploy ingores CLI region option #28725

Closed
rupe120 opened this issue Jan 16, 2024 · 2 comments
Closed

CDK Deploy: Environment agnostic deploy ingores CLI region option #28725

rupe120 opened this issue Jan 16, 2024 · 2 comments
Labels
bug This issue is a bug. closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. effort/medium Medium work item – several days of effort p2 package/tools Related to AWS CDK Tools or CLI response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.

Comments

@rupe120
Copy link

rupe120 commented Jan 16, 2024

Describe the bug

I am trying to deploy an environment-agnostic stack to more than one region, using the command line --region option, but it will only deploy to the region specified in the AWS Config.

Expected Behavior

The --region CLI option should override any other defaults

Current Behavior

The --region option is ignored when the profile specifies a default region.

Reproduction Steps

cdk init --language typescript

Ensure the region is set to something other than us-west-2 for the profile you are going to use.

cdk deploy --profile test-profile --region us-west-2

Possible Solution

No response

Additional Information/Context

No response

CDK CLI Version

2.121.1 (build d86bb1a)

Framework Version

No response

Node.js Version

v20.10.0

OS

Windows 11 Enterprise 22621.2861

Language

TypeScript

Language Version

TypeScript 5.2.2

Other information

No response

@rupe120 rupe120 added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jan 16, 2024
@github-actions github-actions bot added the package/tools Related to AWS CDK Tools or CLI label Jan 16, 2024
@pahud
Copy link
Contributor

pahud commented Jan 16, 2024

If you look at cdk deploy help, it does support --profile but does not support --region.

so in your case, instead of this

cdk deploy --profile test-profile --region us-west-2

I guess you will need to use this instead

AWS_REGION=us-west-2 cdk deploy --profile test-profile

Make sure to turn on -v to verify the CDK_DEFAULT_REGION env in the debug log:

[16:45:38] env: {
  CDK_DEFAULT_REGION: 'us-west-2,
  CDK_DEFAULT_ACCOUNT: 'xxxxxxxxxxxx',
  CDK_OUTDIR: 'cdk.out',
  CDK_CLI_ASM_VERSION: '35.0.0',
  CDK_CLI_VERSION: '2.116.1'
}

@pahud pahud added p2 response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. effort/medium Medium work item – several days of effort and removed needs-triage This issue or PR still needs to be triaged. labels Jan 16, 2024
Copy link

This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.

@github-actions github-actions bot added closing-soon This issue will automatically close in 4 days unless further comments are made. closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. and removed closing-soon This issue will automatically close in 4 days unless further comments are made. labels Jan 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. effort/medium Medium work item – several days of effort p2 package/tools Related to AWS CDK Tools or CLI response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.
Projects
None yet
Development

No branches or pull requests

2 participants