Merge pull request #7712 from hashicorp/fix_7699
test for length of ami tags before tagging
This commit is contained in:
commit
2d12af0b48
|
@ -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,
|
RetryDelay: (&retry.Backoff{InitialBackoff: 200 * time.Millisecond, MaxBackoff: 30, Multiplier: 2}).Linear,
|
||||||
}.Run(ctx, func(ctx context.Context) error {
|
}.Run(ctx, func(ctx context.Context) error {
|
||||||
// Tag images and snapshots
|
// Tag images and snapshots
|
||||||
_, err := regionConn.CreateTags(&ec2.CreateTagsInput{
|
|
||||||
Resources: resourceIds,
|
var err error
|
||||||
Tags: amiTags,
|
if len(amiTags) > 0 {
|
||||||
})
|
_, err = regionConn.CreateTags(&ec2.CreateTagsInput{
|
||||||
if err != nil {
|
Resources: resourceIds,
|
||||||
return err
|
Tags: amiTags,
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Override tags on snapshots
|
// Override tags on snapshots
|
||||||
|
|
Loading…
Reference in New Issue