providers/aws: chain credentials
This commit is contained in:
parent
094c859f2c
commit
7a5499d4f7
|
@ -62,7 +62,16 @@ func (c *Config) Client() (interface{}, error) {
|
||||||
client.region = c.Region
|
client.region = c.Region
|
||||||
|
|
||||||
log.Println("[INFO] Building AWS auth structure")
|
log.Println("[INFO] Building AWS auth structure")
|
||||||
creds := credentials.NewStaticCredentials(c.AccessKey, c.SecretKey, c.Token)
|
creds := credentials.NewChainCredentials([]credentials.Provider{
|
||||||
|
&credentials.StaticProvider{Value: credentials.Value{
|
||||||
|
AccessKeyID: c.AccessKey,
|
||||||
|
SecretAccessKey: c.SecretKey,
|
||||||
|
SessionToken: c.Token,
|
||||||
|
}},
|
||||||
|
&credentials.EnvProvider{},
|
||||||
|
&credentials.SharedCredentialsProvider{Filename: "", Profile: ""},
|
||||||
|
&credentials.EC2RoleProvider{},
|
||||||
|
})
|
||||||
awsConfig := &aws.Config{
|
awsConfig := &aws.Config{
|
||||||
Credentials: creds,
|
Credentials: creds,
|
||||||
Region: c.Region,
|
Region: c.Region,
|
||||||
|
|
Loading…
Reference in New Issue