Merge pull request #1176 from TimeIncOSS/tags-updating
Bugfix: Add tags on AWS IG creation, not just on update
This commit is contained in:
commit
9b974b0248
|
@ -43,6 +43,11 @@ func resourceAwsInternetGatewayCreate(d *schema.ResourceData, meta interface{})
|
||||||
d.SetId(*ig.InternetGatewayID)
|
d.SetId(*ig.InternetGatewayID)
|
||||||
log.Printf("[INFO] InternetGateway ID: %s", d.Id())
|
log.Printf("[INFO] InternetGateway ID: %s", d.Id())
|
||||||
|
|
||||||
|
err = setTagsSDK(ec2conn, d)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
// Attach the new gateway to the correct vpc
|
// Attach the new gateway to the correct vpc
|
||||||
return resourceAwsInternetGatewayAttach(d, meta)
|
return resourceAwsInternetGatewayAttach(d, meta)
|
||||||
}
|
}
|
||||||
|
|
|
@ -98,6 +98,7 @@ func TestAccInternetGateway_tags(t *testing.T) {
|
||||||
Config: testAccCheckInternetGatewayConfigTags,
|
Config: testAccCheckInternetGatewayConfigTags,
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckInternetGatewayExists("aws_internet_gateway.foo", &v),
|
testAccCheckInternetGatewayExists("aws_internet_gateway.foo", &v),
|
||||||
|
testAccCheckTagsSDK(&v.Tags, "foo", "bar"),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue