builder/amazon: crash on tagging snapshot when snapshot_tags is unset
Closes #4238
This commit is contained in:
parent
c2512d232a
commit
8d2ceea5f1
|
@ -96,10 +96,12 @@ func (s *StepCreateTags) Run(state multistep.StateBag) multistep.StepAction {
|
|||
}
|
||||
|
||||
// Override tags on snapshots
|
||||
_, err = regionconn.CreateTags(&ec2.CreateTagsInput{
|
||||
Resources: snapshotIds,
|
||||
Tags: snapshotTags,
|
||||
})
|
||||
if len(snapshotTags) > 0 {
|
||||
_, err = regionconn.CreateTags(&ec2.CreateTagsInput{
|
||||
Resources: snapshotIds,
|
||||
Tags: snapshotTags,
|
||||
})
|
||||
}
|
||||
if err == nil {
|
||||
return true, nil
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue