aws / aws-dax-go

AWS DAX SDK for the Go programming language. https://aws.amazon.com/dynamodb/dax
Apache License 2.0
47 stars 48 forks source link

Not compatible with AWS EKS IAM roles out of the box #23

Closed aidansteele closed 3 years ago

aidansteele commented 4 years ago

This is mostly a duplicate of https://github.com/aws/aws-sdk-go/issues/3218, but it affects this package in its default configuration and maybe it's easier to fix here than it is there.

I won't duplicate that issue, but essentially right now dax.DefaultConfig() won't use the credentials specified by AWS_WEB_IDENTITY_TOKEN_FILE and AWS_ROLE_ARN environment variables. If we used the same credential search path as session.NewSession in the AWS SDK, then it would be ok.

What are your thoughts on where this should be fixed? Right now the workaround is to do:

sess, _ := session.NewSession()
cfg := dax.DefaultConfig()
cfg.Credentials = sess.Config.Credentials
matthinrichsen-wf commented 3 years ago

Just fought with DAX setup for two days before stumbling on this issue.

The both code fixed the authentication issues for me - but this seems like something that should be default behavior from the SDK. I would not expect to see a difference in functionality between dax.DefaultConfig() and aws.DefaultConfig().

ktseytlin commented 3 years ago

The ideal place for the solution is aws-sdk-go. I agree with @matthinrichsen-wf's point that there should not be a difference in functionality between the DefaultConfig().

If this is supported in aws-sdk-go but does not work in aws-dax-go, then let's reopen this issue.