mirror of
https://github.com/hashicorp/packer.git
synced 2026-06-11 01:30:06 -04:00
fix new session error when creating cred chain.
the old and deprecated method won't error and so is safe to use even if we're not in amazon.
This commit is contained in:
parent
511e3d17ec
commit
9a91ae4e8f
1 changed files with 1 additions and 5 deletions
|
|
@ -45,10 +45,6 @@ func (c *AccessConfig) Config() (*aws.Config, error) {
|
|||
return nil, err
|
||||
}
|
||||
} else {
|
||||
session, err := session.NewSession(config)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
creds = credentials.NewChainCredentials([]credentials.Provider{
|
||||
&credentials.StaticProvider{Value: credentials.Value{
|
||||
AccessKeyID: c.AccessKey,
|
||||
|
|
@ -58,7 +54,7 @@ func (c *AccessConfig) Config() (*aws.Config, error) {
|
|||
&credentials.EnvProvider{},
|
||||
&credentials.SharedCredentialsProvider{Filename: "", Profile: ""},
|
||||
&ec2rolecreds.EC2RoleProvider{
|
||||
Client: ec2metadata.New(session),
|
||||
Client: ec2metadata.New(session.New(config)),
|
||||
},
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue