builder/amazon/common: save access/secret key from env [GH-434]
This commit is contained in:
parent
b3559b90fd
commit
cf10fff7fa
|
@ -16,6 +16,8 @@ BUG FIXES:
|
||||||
instance, etc.) disappears from under it.
|
instance, etc.) disappears from under it.
|
||||||
* builder/amazon/instance: Exclude only contents of /tmp, not /tmp
|
* builder/amazon/instance: Exclude only contents of /tmp, not /tmp
|
||||||
itself. [GH-437]
|
itself. [GH-437]
|
||||||
|
* builder/amazon/instance: Make AccessKey/SecretKey available to bundle
|
||||||
|
command even when they come from the environment. [GH-434]
|
||||||
* builder/virtualbox: F1-F12 and delete scancodes now work. [GH-425]
|
* builder/virtualbox: F1-F12 and delete scancodes now work. [GH-425]
|
||||||
* provisioner/puppet-masterless: Fix failure case when both facter vars
|
* provisioner/puppet-masterless: Fix failure case when both facter vars
|
||||||
are used and prevent_sudo. [GH-415]
|
are used and prevent_sudo. [GH-415]
|
||||||
|
|
|
@ -18,7 +18,14 @@ type AccessConfig struct {
|
||||||
// Auth returns a valid aws.Auth object for access to AWS services, or
|
// Auth returns a valid aws.Auth object for access to AWS services, or
|
||||||
// an error if the authentication couldn't be resolved.
|
// an error if the authentication couldn't be resolved.
|
||||||
func (c *AccessConfig) Auth() (aws.Auth, error) {
|
func (c *AccessConfig) Auth() (aws.Auth, error) {
|
||||||
return aws.GetAuth(c.AccessKey, c.SecretKey)
|
auth, err := aws.GetAuth(c.AccessKey, c.SecretKey)
|
||||||
|
if err == nil {
|
||||||
|
// Store the accesskey and secret that we got...
|
||||||
|
c.AccessKey = auth.AccessKey
|
||||||
|
c.SecretKey = auth.SecretKey
|
||||||
|
}
|
||||||
|
|
||||||
|
return auth, err
|
||||||
}
|
}
|
||||||
|
|
||||||
// Region returns the aws.Region object for access to AWS services, requesting
|
// Region returns the aws.Region object for access to AWS services, requesting
|
||||||
|
|
Loading…
Reference in New Issue