use ConvertToEC2Tags to apply tags to source instance, add Say message
This commit is contained in:
parent
332cb784fd
commit
aa70c82ec8
|
@ -291,11 +291,9 @@ func (s *StepRunSourceInstance) Run(state multistep.StateBag) multistep.StepActi
|
||||||
|
|
||||||
instance := latestInstance.(*ec2.Instance)
|
instance := latestInstance.(*ec2.Instance)
|
||||||
|
|
||||||
ec2Tags := make([]*ec2.Tag, 1, len(s.Tags)+1)
|
ui.Say(fmt.Sprintf("Adding tags to source instance:"))
|
||||||
ec2Tags[0] = &ec2.Tag{Key: aws.String("Name"), Value: aws.String("Packer Builder")}
|
s.Tags["Name"] = "Packer Builder"
|
||||||
for k, v := range s.Tags {
|
ec2Tags := ConvertToEC2Tags(s.Tags, ui)
|
||||||
ec2Tags = append(ec2Tags, &ec2.Tag{Key: aws.String(k), Value: aws.String(v)})
|
|
||||||
}
|
|
||||||
|
|
||||||
_, err = ec2conn.CreateTags(&ec2.CreateTagsInput{
|
_, err = ec2conn.CreateTags(&ec2.CreateTagsInput{
|
||||||
Tags: ec2Tags,
|
Tags: ec2Tags,
|
||||||
|
|
Loading…
Reference in New Issue