-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
[core] v1.60.0 no longer accepts --profile flag #9937
Comments
This bug report doesn't trivially reproduce.
Works for me. What is special about your profile? What authentication methods does it use? Which file did you configure it in? Only differences I can see that would affect this are: v1.59.0...v1.60.0#diff-32e1d6d729ef6be343dc5494aa5d2e65 And there's not much there. |
Nothing too special. At work we use cross-account roles, In my
and then for a specific aws account profile such as
|
Here's a super simple reproduction I just encountered and made for you https://github.com/kyler-hyuna/cdk-test. master branch is 1.59.0. Reproduce steps:
|
Thanks for putting together the repro. Still doesn't reproduce on my machine:
I guess try pasting the output of running it with EDIT: Aha it might be the cross-accountness... |
Finally, 🙌 Any idea what might've caused it? The cross-account role works as expected with the aws-cli |
It is not the cross-accountness. Tried to reproduce that as well by assuming into a cross-account role and it still works fine for me. |
There is something else different in your setup than in mine that you haven't told me about. |
Oh. Got it. It's the absence of an |
This is my config:
|
Oh so you DO have a Even if I put the profile into my own config file--didn't have one before--and try to mess with the regions (maybe it's the |
I'm to need you to do your own narrowing/diagnosis of the issue. Some tips:
Otherwise, I'm out of remote debugging ideas... |
I used the
On 1.60.0 this is the error:
|
I am having this issue as well. However, when I run my deploy command with -vvv I get:
Which is interesting because my profile in the ~/.aws/config file is:
This issue only happens on 1.60.0 |
Are regional STS endpoints activated in the region where you are deploying (IAM console > Account settings)? https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html |
@jogold Yep |
I am experiencing the same issue. [ec2-user@ip-10-x-x-x met_cert]$ cdk deploy --profile myprofile. I have a ~/.aws/config file but i do not have a default profile. ( as i operate across so many accounts it would be dangerous as it would be way to easy to forget where i was working... My profiles use a source profile that has mfa attached. [profile loginprofile] [profile myprofile] In the -vvv output below we see this.. Unable to determine the default AWS account: Error: EC2 Metadata roleName request returned error: Not sure what to try next.
|
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] And it seems to work. SOmething has changed in 1.60 that has changed this. |
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 |
Some further research in diffing the
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
|
Thanks for figuring this out y'all! |
@rix0rrr should we flag this as p0? |
@mrpackethead 's solution worked for me. @fennb 's solution did not work for me. I had to create the default profile in my aws config. I deleted my default as I don't like having a default aws account to force me to specify which I want to use. Now that I've readded it, it works. I also have a region specified. Did not try with default but without region. |
@d1str0 Interesting - I should have mentioned that I do have a default profile, so it's possible you may need both, depending on setup. As some other context, my profiles are for the purposes of cross-account access (not just for the purpose of changing roles), which may/may not impact things. |
This works around a bug in the AWS SDK for JS that only surfaced when we switched to `AWS_STS_REGIONAL_ENDPOINTS=regional`, requiring a `[default]` profile with a region for all users. The bug was that the INI-file AssumeRole provider would ignore the region in the profile, and always fall back to the region in: * The profile specified using `$AWS_PROFILE` (which we don't use). * Otherwise the region in the `[default]` profile (which a user may or may not have). Traditionally it didn't really matter whether the STS client got a region or not because it would always connect to `us-east-1` no matter what, but when we switched to `AWS_STS_REGIONAL_ENDPOINTS=regional`, it became illegal to not have a region. Fix the upstream bug by basically replicating the important parts of `SharedIniFileCredentials` of the AWS SDK in our codebase and patching the bug. Reported upstreeam as aws/aws-sdk-js#3418 Fixes #9937 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Thanks @rix0rrr. Appreciate it 💯 . Looking forward to when it releases |
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 thediff
command with thework
profile, I would type:I am no longer able to do this on version 1.60.0.
Reproduction Steps
diff
ordeploy
command on the same stackWhat did you expect to happen?
Upgrading to v1.60.0 would not affect passing credentials.
What actually happened?
I now receive the error:
Environment
Other
As a result of this, my team is stuck on v1.59.0
This is 🐛 Bug Report
The text was updated successfully, but these errors were encountered: