Default to AWS_ env vars for key and secret
This commit is contained in:
parent
adae75402f
commit
9c9c60aabf
|
@ -15,6 +15,7 @@ import (
|
|||
"github.com/mitchellh/packer/builder/common"
|
||||
"github.com/mitchellh/packer/packer"
|
||||
"log"
|
||||
"os"
|
||||
"text/template"
|
||||
"time"
|
||||
)
|
||||
|
@ -57,6 +58,14 @@ func (b *Builder) Prepare(raws ...interface{}) error {
|
|||
}
|
||||
}
|
||||
|
||||
if b.config.AccessKey == "" {
|
||||
b.config.AccessKey = os.Getenv("AWS_ACCESS_KEY")
|
||||
}
|
||||
|
||||
if b.config.SecretKey == "" {
|
||||
b.config.SecretKey = os.Getenv("AWS_SECRET_KEY")
|
||||
}
|
||||
|
||||
if b.config.SSHPort == 0 {
|
||||
b.config.SSHPort = 22
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue