Merge pull request #1417 from goraxe/cloudformation_vpc_add_tags
Cloudformation vpc add tags
This commit is contained in:
commit
948a7ac06f
@ -2004,6 +2004,11 @@ class VPC(TaggedEC2Resource):
|
||||
cidr_block=properties['CidrBlock'],
|
||||
instance_tenancy=properties.get('InstanceTenancy', 'default')
|
||||
)
|
||||
for tag in properties.get("Tags", []):
|
||||
tag_key = tag["Key"]
|
||||
tag_value = tag["Value"]
|
||||
vpc.add_tag(tag_key, tag_value)
|
||||
|
||||
return vpc
|
||||
|
||||
@property
|
||||
|
@ -752,6 +752,9 @@ def test_vpc_single_instance_in_subnet():
|
||||
security_group.vpc_id.should.equal(vpc.id)
|
||||
|
||||
stack = conn.describe_stacks()[0]
|
||||
|
||||
vpc.tags.should.have.key('Application').which.should.equal(stack.stack_id)
|
||||
|
||||
resources = stack.describe_resources()
|
||||
vpc_resource = [
|
||||
resource for resource in resources if resource.resource_type == 'AWS::EC2::VPC'][0]
|
||||
|
Loading…
Reference in New Issue
Block a user