From 3b726e66c15043e5f615770805fc480ca9d0e336 Mon Sep 17 00:00:00 2001 From: Megan Marsh Date: Mon, 25 Feb 2019 11:03:03 -0800 Subject: [PATCH] swap region copy and encryption steps --- builder/amazon/ebs/builder.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/builder/amazon/ebs/builder.go b/builder/amazon/ebs/builder.go index 4734995b5..c1de2e154 100644 --- a/builder/amazon/ebs/builder.go +++ b/builder/amazon/ebs/builder.go @@ -223,12 +223,6 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe Regions: b.config.AMIRegions, }, &stepCreateAMI{}, - &awscommon.StepCreateEncryptedAMICopy{ - KeyID: b.config.AMIKmsKeyId, - EncryptBootVolume: b.config.AMIEncryptBootVolume, - Name: b.config.AMIName, - AMIMappings: b.config.AMIBlockDevices.AMIMappings, - }, &awscommon.StepAMIRegionCopy{ AccessConfig: &b.config.AccessConfig, Regions: b.config.AMIRegions, @@ -236,6 +230,12 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe EncryptBootVolume: b.config.AMIEncryptBootVolume, Name: b.config.AMIName, }, + &awscommon.StepCreateEncryptedAMICopy{ + KeyID: b.config.AMIKmsKeyId, + EncryptBootVolume: b.config.AMIEncryptBootVolume, + Name: b.config.AMIName, + AMIMappings: b.config.AMIBlockDevices.AMIMappings, + }, &awscommon.StepModifyAMIAttributes{ Description: b.config.AMIDescription, Users: b.config.AMIUsers,