aws-cdk: [core] v1.60.0 no longer accepts --profile flag
I manage multiple AWS accounts and for each, I have a profile configured. In versions <1.60.0 of cdk, I could specify a profile using the --profile <profile-name>. For example if I wanted to use the diff command with the work profile, I would type:
yarn cdk --profile work diff
I am no longer able to do this on version 1.60.0.
Reproduction Steps
- Create a stack using v1.59.0 and deploy it
- Update your version to v1.60.0 and attempt to run
diffordeploycommand on the same stack
What did you expect to happen?
Upgrading to v1.60.0 would not affect passing credentials.
What actually happened?
I now receive the error:
Need to perform AWS calls for account <number>, but no credentials have been configured.
Environment
- CLI Version: 1.60.0
- Framework Version: 1.60.0
- Node.js Version: v10.22.0
- OS : mac-os
- Language (Version): TypeScript
Other
As a result of this, my team is stuck on v1.59.0
This is 🐛 Bug Report
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 3
- Comments: 24 (10 by maintainers)
Hi…
It appears that there is a requirement for CDK to need to have a default profile even though i am not using it.
I added this
[profile default] region = ap-southeast-2 output = json
And it seems to work. SOmething has changed in 1.60 that has changed this.
Some further research in diffing the
-vvvoutput between patched (working) and unpatched (broken) versions yields the following:As a temporary workaround - if you define a region in your profile, it seems to work (and doesn’t seem to matter what region it is), eg
~/.aws/config:I am also having this issue.
I can confirm that the commit/precise change that causes this is: https://github.com/aws/aws-cdk/pull/9835/files#diff-69984e5eb59d539989dd8dd4e0f3f0cfR18
If you patch CDK to disable
AWS_STS_REGIONAL_ENDPOINTS = 'regional', then things work as per before.@rix0rrr should we flag this as p0?
Thanks for figuring this out y’all!