@@ -56,24 +56,25 @@ func execWithCredentials(argv []string, creds *credentials) error {
56
56
return err
57
57
}
58
58
59
+ os .Setenv ("AWS_ACCESS_KEY_ID" , creds .AccessKeyID )
60
+ os .Setenv ("AWS_SECRET_ACCESS_KEY" , creds .SecretAccessKey )
61
+ os .Setenv ("AWS_SESSION_TOKEN" , creds .SessionToken )
62
+ os .Setenv ("AWS_SECURITY_TOKEN" , creds .SessionToken )
63
+
59
64
env := os .Environ ()
60
- env = append (env , fmt .Sprintf ("AWS_ACCESS_KEY_ID=%s" , creds .AccessKeyId ))
61
- env = append (env , fmt .Sprintf ("AWS_SECRET_ACCESS_KEY=%s" , creds .SecretAccessKey ))
62
- env = append (env , fmt .Sprintf ("AWS_SESSION_TOKEN=%s" , creds .SessionToken ))
63
- env = append (env , fmt .Sprintf ("AWS_SECURITY_TOKEN=%s" , creds .SessionToken ))
64
65
return syscall .Exec (argv0 , argv , env )
65
66
}
66
67
67
68
type credentials struct {
68
- AccessKeyId string
69
+ AccessKeyID string
69
70
SecretAccessKey string
70
71
SessionToken string
71
72
}
72
73
73
74
// printCredentials prints the credentials in a way that can easily be sourced
74
75
// with bash.
75
76
func printCredentials (creds * credentials ) {
76
- fmt .Printf ("export AWS_ACCESS_KEY_ID=\" %s\" \n " , creds .AccessKeyId )
77
+ fmt .Printf ("export AWS_ACCESS_KEY_ID=\" %s\" \n " , creds .AccessKeyID )
77
78
fmt .Printf ("export AWS_SECRET_ACCESS_KEY=\" %s\" \n " , creds .SecretAccessKey )
78
79
fmt .Printf ("export AWS_SESSION_TOKEN=\" %s\" \n " , creds .SessionToken )
79
80
fmt .Printf ("export AWS_SECURITY_TOKEN=\" %s\" \n " , creds .SessionToken )
0 commit comments