Merge pull request #2316 from jjappi/fix-aws-tagging
Fix failing AMI snapshot tagging when copying to other regions.
This commit is contained in:
commit
7b9d48799e
|
@ -34,8 +34,13 @@ func (s *StepCreateTags) Run(state multistep.StateBag) multistep.StepAction {
|
|||
// Declare list of resources to tag
|
||||
resourceIds := []*string{&ami}
|
||||
|
||||
regionconn := ec2.New(&aws.Config{
|
||||
Credentials: ec2conn.Config.Credentials,
|
||||
Region: region,
|
||||
})
|
||||
|
||||
// Retrieve image list for given AMI
|
||||
imageResp, err := ec2conn.DescribeImages(&ec2.DescribeImagesInput{
|
||||
imageResp, err := regionconn.DescribeImages(&ec2.DescribeImagesInput{
|
||||
ImageIDs: resourceIds,
|
||||
})
|
||||
|
||||
|
@ -63,11 +68,6 @@ func (s *StepCreateTags) Run(state multistep.StateBag) multistep.StepAction {
|
|||
}
|
||||
}
|
||||
|
||||
regionconn := ec2.New(&aws.Config{
|
||||
Credentials: ec2conn.Config.Credentials,
|
||||
Region: region,
|
||||
})
|
||||
|
||||
_, err = regionconn.CreateTags(&ec2.CreateTagsInput{
|
||||
Resources: resourceIds,
|
||||
Tags: ec2Tags,
|
||||
|
|
Loading…
Reference in New Issue