Conversation
| } | ||
| // Clear out any previously set AWS_ environment variables so | ||
| // they aren't used by this call | ||
| cleanEnv() |
There was a problem hiding this comment.
I think cleanEnv() should actually just get removed. If we don't want aws-sdk-go to use creds from the environment, then we should just swap out the credential chain with an explicit SharedCredentialsProvider. I think it'd look something like:
config := aws.Config{Credentials: &credentials.SharedCredentialsProvider{Filename: "", Profile: ""}}
session := session.New(config)cleanEnv() is some cruft from when this tool would shell out to the aws cli.
|
I looked through the old issues and found people had similar issues in the past. |
|
Hm.. trying this and its not working: sess := session.Must(session.NewSession(&aws.Config{
Credentials: credentials.NewSharedCredentials("", profile),
}))Output: error: SharedCredsLoad: failed to get profile
caused by: section 'eo' does not exist |
|
I've been running into this issue as well where the env variables are used, it would be better if this tool used the credentials from the credentials config file and generated a config file and set the assumed credentials, it would allow for a daemonised assume-role process that can run just before the expiration of the token to be regenerated. |
Fixes #18
This change is