-
Notifications
You must be signed in to change notification settings - Fork 2.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
session.New doesn't invoke NewWebIdentityCredentials unless AWS_SDK_LOAD_CONFIG is set #2828
Comments
Steps to Reproducehttps://play.golang.org/p/9kepGClDdok # running in an EKS pod
$ env | grep AWS
AWS_ROLE_ARN=arn:aws:iam::111122223333:role/s3-reader
AWS_WEB_IDENTITY_TOKEN_FILE=/var/run/secrets/eks.amazonaws.com/serviceaccount/token
$ ls -al $AWS_WEB_IDENTITY_TOKEN_FILE
lrwxrwxrwx 1 root root 12 Sep 6 16:25 /var/run/secrets/eks.amazonaws.com/serviceaccount/token -> ..data/token
$ go run main.go
Creating session via 'NewSession'
{
"Account": "111122223333",
"Arn": "arn:aws:sts::111122223333:assumed-role/s3-reader/1568241943797235661",
"UserId": "XXXX:1568241943797235661"
}
Creating session via 'NewSessionWithOptions'
{
"Account": "111122223333",
"Arn": "arn:aws:sts::111122223333:assumed-role/s3-reader/1568241944243481837",
"UserId": "XXXX:1568241944243481837"
}
Creating session via 'New'
{
"Account": "111122223333",
"Arn": "arn:aws:sts::111122223333:assumed-role/eks-1-14-mhausler-09-04-2019-NODE-NodeInstanceRole-ZKNX5MQZ6D1/i-0614227f41fe18285",
"UserId": "YYYY-0614227f41fe18386"
} |
Hi @joelthompson, thanks for reaching out to us about this. Unfortunately I haven't been able to reproduce the described behavior, using both Output
Debug Output
That being said, |
@diehlaws your output is confirming what @micahhausler and @joelthompson are saying. With |
The problem seems to be that the @diehlaws @micahhausler WIll this be fixed considering that the |
I'm hitting the same issue with github.com/aws/aws-sdk-go@v1.25.30 on our EKS cluster. The |
I'm hitting the same issue as well with github.com/aws/aws-sdk-go@v1.25.38. Using |
Hi, is there any update on this ? |
We do not plan to address this behavior, since |
|
Please fill out the sections below to help us address your issue.
Version of AWS SDK for Go?
1.23.19
Version of Go (
go version
)?1.12.7
What issue did you see?
The title of the issue says it all. See hashicorp/vault#7450 (comment) for more of my investigation. This prevents the SDK from picking up EKS pod service account credentials and exchanging them for AWS credentials when using
session.New
and AWS_SDK_LOAD_CONFIG isn't set.session.NewSession
doesn't face this limitation. It will always try to invoke NewWebIdentityCredentials regardless of whether AWS_SDK_LOAD_CONFIG is set. It seems weird that there's a divergence in this behavior between the two when the documentation states thatsession.NewSession
is the same assession.New
except it the former can return errors.Steps to reproduce
Haven't tested it out yet, sorry. Mostly just looking through code.
The text was updated successfully, but these errors were encountered: