Merge pull request #4168 from mitchellh/noerrorsess
fix new session error when creating cred chain.
This commit is contained in:
commit
900db6be84
|
@ -45,10 +45,6 @@ func (c *AccessConfig) Config() (*aws.Config, error) {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
session, err := session.NewSession(config)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
creds = credentials.NewChainCredentials([]credentials.Provider{
|
creds = credentials.NewChainCredentials([]credentials.Provider{
|
||||||
&credentials.StaticProvider{Value: credentials.Value{
|
&credentials.StaticProvider{Value: credentials.Value{
|
||||||
AccessKeyID: c.AccessKey,
|
AccessKeyID: c.AccessKey,
|
||||||
|
@ -58,7 +54,7 @@ func (c *AccessConfig) Config() (*aws.Config, error) {
|
||||||
&credentials.EnvProvider{},
|
&credentials.EnvProvider{},
|
||||||
&credentials.SharedCredentialsProvider{Filename: "", Profile: ""},
|
&credentials.SharedCredentialsProvider{Filename: "", Profile: ""},
|
||||||
&ec2rolecreds.EC2RoleProvider{
|
&ec2rolecreds.EC2RoleProvider{
|
||||||
Client: ec2metadata.New(session),
|
Client: ec2metadata.New(session.New(config)),
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue