-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Support OIDC Web Identity Token File as a means of picking up credentials #26292
Comments
What error message are you receiving? |
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. |
@peterwoodworth As its running on bitbucket, they appear to use EC2. The error message is around not being able to get permissions for the account (expected as the EC2 would be theirs not ours). Changing the env variables to match
Works. but this should be picked up before that point (specifically here
|
The specific error message would be helpful in knowing how / if I'm reproducing the same behavior |
With verbose
Both of those example above |
The v3 looks like it supports it |
That's the same page I linked 🙂 |
I spent several days fighting with the same issue 🤦♂️ . First of the all AWS_ROLE_ARN should be defined. But that's not all! That's a working snippet: image: node:16.3.0
pipelines:
branches:
main:
- step:
name: Deployment
oidc: true
script:
- export AWS_REGION=...
- export AWS_ROLE_ARN=....
- export AWS_WEB_IDENTITY_TOKEN_FILE=$(pwd)/web-identity-token
- echo $BITBUCKET_STEP_OIDC_TOKEN > $AWS_WEB_IDENTITY_TOKEN_FILE
- aws sts get-caller-identity
- npx run cdk deploy You don't even need |
Thank you @mpashkovskiy |
This support will be added as soon as #31702 is merged. |
Describe the bug
When using OIDC as the following
aws CLI commands work for example
aws sts get-caller-identity
but CDK does not correctly pick this up from the profile and needs to be manually set as env vars to be picked up
I would have expected the CLI behaviour to match CDK
Expected Behavior
when using oidc, aws-cli works, cdk should work in the same way
Current Behavior
cdk misses the credentials and carries on down the chain
Reproduction Steps
This can be reproduced on bitbucket (or any provider with OIDC installed)
bitbucket pipeline example
oidc: true
script:
- export AWS_WEB_IDENTITY_TOKEN_FILE=$(pwd)/web-identity-token
- echo $BITBUCKET_STEP_OIDC_TOKEN > $AWS_WEB_IDENTITY_TOKEN_FILE
- chmod 400 ${AWS_WEB_IDENTITY_TOKEN_FILE}
- aws configure set web_identity_token_file ${AWS_WEB_IDENTITY_TOKEN_FILE}
- aws sts get-caller-identity
- npx run cdk deploy
Possible Solution
No response
Additional Information/Context
No response
SDK version used
2.85.0
Environment details (OS name and version, etc.)
Bitbucket
The text was updated successfully, but these errors were encountered: