google-auth-library-python icon indicating copy to clipboard operation
google-auth-library-python copied to clipboard

Support AWS environments without instance metadata endpoint

Open govertb opened this issue 4 years ago • 0 comments

Is your feature request related to a problem? Please describe. When trying to use identity federation on an AWS environment that does not have the EC2 instance metadata endpoint available (in my case ECS Fargate, but this should apply to Lambda as well) the library fails to obtain credentials.

Describe the solution you'd like For the library to fall back to another credential source if the EC2 instance metadata endpoint is not available. If this is not possible it would also help if it was documented that the instance metadata endpoint is required, or if the library flags more clearly it cannot find the instance metadata endpoint.

Describe alternatives you've considered To work around this issue, I exposed (temporary) AWS credentials as environment variables (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN) to prevent the library from using the metadata endpoint.

Additional context Unfortunately I no longer have access to an AWS environment to reproduce this issue, but I wanted to share this information since I thought this might be helpful.

govertb avatar Oct 08 '21 10:10 govertb