assume-role
assume-role copied to clipboard
clean environment every time
I looked through the old issues and found people had similar issues in the past. It seems though that some people need these environment variables to connect to get the new session/assumed-role? If so, then we can't clear it any time. Instead, we should force it to use the profile, as the correct credentials will be stored under there (or its parent profile).
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.