Commit c9b413e3 authored by Clint Shryock's avatar Clint Shryock

builder/amazon-instance: Omit access, secrety key if using IAM Instance Profile

parent 802a7668
...@@ -73,15 +73,25 @@ func (b *Builder) Prepare(raws ...interface{}) ([]string, error) { ...@@ -73,15 +73,25 @@ func (b *Builder) Prepare(raws ...interface{}) ([]string, error) {
} }
if b.config.BundleUploadCommand == "" { if b.config.BundleUploadCommand == "" {
b.config.BundleUploadCommand = "sudo -i -n ec2-upload-bundle " + if b.config.IamInstanceProfile != "" {
"-b {{.BucketName}} " + b.config.BundleUploadCommand = "sudo -i -n ec2-upload-bundle " +
"-m {{.ManifestPath}} " + "-b {{.BucketName}} " +
"-a {{.AccessKey}} " + "-m {{.ManifestPath}} " +
"-s {{.SecretKey}} " + "-d {{.BundleDirectory}} " +
"-d {{.BundleDirectory}} " + "--batch " +
"--batch " + "--region {{.Region}} " +
"--region {{.Region}} " + "--retry"
"--retry" } else {
b.config.BundleUploadCommand = "sudo -i -n ec2-upload-bundle " +
"-b {{.BucketName}} " +
"-m {{.ManifestPath}} " +
"-a {{.AccessKey}} " +
"-s {{.SecretKey}} " +
"-d {{.BundleDirectory}} " +
"--batch " +
"--region {{.Region}} " +
"--retry"
}
} }
if b.config.BundleVolCommand == "" { if b.config.BundleVolCommand == "" {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment