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
|
// Override tags on snapshots
|
||||||
|
if len(snapshotTags) > 0 {
|
||||||
_, err = regionconn.CreateTags(&ec2.CreateTagsInput{
|
_, err = regionconn.CreateTags(&ec2.CreateTagsInput{
|
||||||
Resources: snapshotIds,
|
Resources: snapshotIds,
|
||||||
Tags: snapshotTags,
|
Tags: snapshotTags,
|
||||||
})
|
})
|
||||||
|
}
|
||||||
if err == nil {
|
if err == nil {
|
||||||
return true, nil
|
return true, nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue