diff --git a/builder/amazon/common/step_ami_region_copy.go b/builder/amazon/common/step_ami_region_copy.go index 1f4e65738..96496fe47 100644 --- a/builder/amazon/common/step_ami_region_copy.go +++ b/builder/amazon/common/step_ami_region_copy.go @@ -2,7 +2,6 @@ package common import ( "fmt" - "sync" "github.com/aws/aws-sdk-go/aws" @@ -128,7 +127,7 @@ func amiRegionCopy(state multistep.StateBag, config *AccessConfig, name string, } for _, blockDeviceMapping := range describeImageResp.Images[0].BlockDeviceMappings { - if blockDeviceMapping.Ebs != nil { + if blockDeviceMapping.Ebs != nil && blockDeviceMapping.Ebs.SnapshotId != nil { snapshotIds = append(snapshotIds, *blockDeviceMapping.Ebs.SnapshotId) } }