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