Merge pull request #7712 from hashicorp/fix_7699

test for length of ami tags before tagging
pull/7752/head
Adrien Delorme 7 years ago committed by GitHub
commit 2d12af0b48
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -105,12 +105,16 @@ func (s *StepCreateTags) Run(ctx context.Context, state multistep.StateBag) mult
RetryDelay: (&retry.Backoff{InitialBackoff: 200 * time.Millisecond, MaxBackoff: 30, Multiplier: 2}).Linear,
}.Run(ctx, func(ctx context.Context) error {
// Tag images and snapshots
_, err := regionConn.CreateTags(&ec2.CreateTagsInput{
Resources: resourceIds,
Tags: amiTags,
})
if err != nil {
return err
var err error
if len(amiTags) > 0 {
_, err = regionConn.CreateTags(&ec2.CreateTagsInput{
Resources: resourceIds,
Tags: amiTags,
})
if err != nil {
return err
}
}
// Override tags on snapshots

Loading…
Cancel
Save