convection 0.0.1 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (97) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/.rubocop.yml +26 -8
  4. data/.rubocop_todo.yml +77 -0
  5. data/.ruby-version +1 -0
  6. data/.travis.yml +10 -0
  7. data/Gemfile +9 -0
  8. data/README.md +27 -2
  9. data/Rakefile +11 -1
  10. data/bin/convection +49 -0
  11. data/convection.gemspec +5 -7
  12. data/example/.ruby-version +1 -0
  13. data/example/Cloudfile +13 -0
  14. data/example/deprecated/elb.rb +27 -0
  15. data/example/deprecated/iam_access_key.rb +18 -0
  16. data/example/deprecated/iam_group.rb +31 -0
  17. data/example/{iam_role.rb → deprecated/iam_role.rb} +21 -32
  18. data/example/deprecated/iam_user.rb +31 -0
  19. data/example/deprecated/rds.rb +70 -0
  20. data/example/{s3.rb → deprecated/s3.rb} +0 -0
  21. data/example/deprecated/sqs.rb +32 -0
  22. data/example/deprecated/vpc.rb +85 -0
  23. data/example/foobar.rb +22 -0
  24. data/example/output/vpc.json +335 -0
  25. data/example/security-groups.rb +40 -0
  26. data/example/trust_cloudtrail.rb +24 -0
  27. data/example/vpc.rb +63 -81
  28. data/ext/resource_generator.sh +21 -0
  29. data/lib/convection.rb +5 -4
  30. data/lib/convection/control/cloud.rb +59 -0
  31. data/lib/convection/control/stack.rb +261 -60
  32. data/lib/convection/dsl/helpers.rb +63 -5
  33. data/lib/convection/model/attributes.rb +60 -0
  34. data/lib/convection/model/cloudfile.rb +58 -0
  35. data/lib/convection/model/diff.rb +39 -0
  36. data/lib/convection/model/event.rb +62 -0
  37. data/lib/convection/model/exceptions.rb +18 -0
  38. data/lib/convection/model/mixin/cidr_block.rb +4 -4
  39. data/lib/convection/model/mixin/colorize.rb +20 -0
  40. data/lib/convection/model/mixin/conditional.rb +1 -3
  41. data/lib/convection/model/mixin/policy.rb +89 -0
  42. data/lib/convection/model/mixin/protocol.rb +29 -0
  43. data/lib/convection/model/mixin/taggable.rb +2 -2
  44. data/lib/convection/model/template.rb +248 -21
  45. data/lib/convection/model/template/condition.rb +56 -0
  46. data/lib/convection/model/template/mapping.rb +4 -3
  47. data/lib/convection/model/template/output.rb +9 -7
  48. data/lib/convection/model/template/parameter.rb +19 -4
  49. data/lib/convection/model/template/resource.rb +317 -23
  50. data/lib/convection/model/template/resource/aws_auto_scaling_auto_scaling_group.rb +39 -0
  51. data/lib/convection/model/template/resource/aws_auto_scaling_launch_configuration.rb +30 -0
  52. data/lib/convection/model/template/resource/aws_auto_scaling_scaling_policy.rb +20 -0
  53. data/lib/convection/model/template/resource/aws_cloud_watch_alarm.rb +31 -0
  54. data/lib/convection/model/template/resource/aws_ec2_instance.rb +10 -46
  55. data/lib/convection/model/template/resource/aws_ec2_internet_gateway.rb +3 -14
  56. data/lib/convection/model/template/resource/aws_ec2_network_acl.rb +45 -0
  57. data/lib/convection/model/template/resource/aws_ec2_network_acl_entry.rb +27 -0
  58. data/lib/convection/model/template/resource/aws_ec2_route.rb +7 -40
  59. data/lib/convection/model/template/resource/aws_ec2_route_table.rb +2 -17
  60. data/lib/convection/model/template/resource/aws_ec2_security_group.rb +24 -30
  61. data/lib/convection/model/template/resource/aws_ec2_security_group_ingres.rb +25 -0
  62. data/lib/convection/model/template/resource/aws_ec2_subnet.rb +21 -28
  63. data/lib/convection/model/template/resource/aws_ec2_subnet_network_acl_association.rb +18 -0
  64. data/lib/convection/model/template/resource/aws_ec2_subnet_route_table_association.rb +3 -24
  65. data/lib/convection/model/template/resource/aws_ec2_vpc.rb +20 -22
  66. data/lib/convection/model/template/resource/aws_ec2_vpc_gateway_attachment.rb +4 -28
  67. data/lib/convection/model/template/resource/aws_elasticache_cluster.rb +24 -0
  68. data/lib/convection/model/template/resource/aws_elasticache_parameter_group.rb +19 -0
  69. data/lib/convection/model/template/resource/aws_elasticache_security_group.rb +17 -0
  70. data/lib/convection/model/template/resource/aws_elasticache_security_group_ingress.rb +19 -0
  71. data/lib/convection/model/template/resource/aws_elb.rb +39 -0
  72. data/lib/convection/model/template/resource/aws_iam_access_key.rb +19 -0
  73. data/lib/convection/model/template/resource/aws_iam_group.rb +18 -0
  74. data/lib/convection/model/template/resource/aws_iam_instance_profile.rb +21 -0
  75. data/lib/convection/model/template/resource/aws_iam_policy.rb +28 -24
  76. data/lib/convection/model/template/resource/aws_iam_role.rb +88 -19
  77. data/lib/convection/model/template/resource/aws_iam_user.rb +53 -0
  78. data/lib/convection/model/template/resource/aws_logs_loggroup.rb +33 -0
  79. data/lib/convection/model/template/resource/aws_rds_db_instance.rb +59 -0
  80. data/lib/convection/model/template/resource/aws_rds_db_parameter_group.rb +27 -0
  81. data/lib/convection/model/template/resource/aws_rds_db_security_group.rb +40 -0
  82. data/lib/convection/model/template/resource/aws_rds_db_subnet_group.rb +26 -0
  83. data/lib/convection/model/template/resource/aws_route53_health_check.rb +17 -0
  84. data/lib/convection/model/template/resource/aws_route53_recordset.rb +30 -0
  85. data/lib/convection/model/template/resource/aws_s3_bucket.rb +8 -44
  86. data/lib/convection/model/template/resource/aws_s3_bucket_policy.rb +14 -19
  87. data/lib/convection/model/template/resource/aws_sns_topic.rb +19 -0
  88. data/lib/convection/model/template/resource/aws_sqs_queue.rb +31 -0
  89. data/lib/convection/model/template/resource/aws_sqs_queue_policy.rb +18 -0
  90. data/test/convection/model/test_conditions.rb +121 -0
  91. data/test/convection/model/test_elasticache.rb +97 -0
  92. data/test/convection/model/test_loggroups.rb +25 -0
  93. data/test/convection/model/test_rds.rb +76 -0
  94. data/test/convection/model/test_template.rb +64 -0
  95. data/test/convection/model/test_validation.rb +216 -0
  96. data/test/test_helper.rb +17 -0
  97. metadata +131 -50
@@ -0,0 +1,31 @@
1
+ #!/usr/bin/env ruby
2
+ require 'convection'
3
+
4
+ test_iam_user_template = Convection.template do
5
+ description 'This is an example of a stack representing IAM Users and Policies.'
6
+
7
+ parameter 'Path' do
8
+ type 'String'
9
+ default '/'
10
+ end
11
+
12
+ iam_policy 'UserPolicy' do
13
+ policy_name 'NewPolicy'
14
+ user fn_ref(:NewUser)
15
+
16
+ policy(
17
+ :Statement => [{
18
+ :Effect => 'Allow',
19
+ :Action => ['s3:GetObject'],
20
+ :Resource => ['arn:aws:s3:::some.bucket.name.here/*']
21
+ }]
22
+ )
23
+ end
24
+
25
+ iam_user 'NewUser' do
26
+ path fn_ref(:Path)
27
+ end
28
+ end
29
+
30
+ puts test_iam_user_template.to_json
31
+ # puts Convection.stack('IAMTestStack', test_iam_user_template, :region => 'us-west-1').apply
@@ -0,0 +1,70 @@
1
+ #!/usr/bin/env ruby
2
+ require 'convection'
3
+
4
+ rds_template = Convection.template do
5
+ description 'Testing RDS DB Instance definition'
6
+
7
+ param_group = parameter_group 'TestingParamGroup' do
8
+ description 'My Parameter Group for test the app' # Required
9
+ family 'MySQL5.6' # Required
10
+ parameters({
11
+ character_set_database: 'utf8',
12
+ slow_query_log: 1,
13
+ max_allowed_packet: 10485760,
14
+ lower_case_table_names: 1,
15
+ innodb_flush_method: 'O_DIRECT',
16
+ log_warnings: 2,
17
+ collation_connection: 'utf8_unicode_ci',
18
+ collation_server: 'utf8_unicode_ci',
19
+ long_query_time: 5,
20
+ character_set_server: 'utf8',
21
+ log_output: 'FILE'
22
+ })
23
+ tag 'ui-test-db-param-group', 'yep'
24
+ end
25
+
26
+ #sec_group = db_security_group 'TestingSecurityGroup' do
27
+ # ec2_vpc_id 'vpc-98248' #Required
28
+ # db_security_group_ingress # Required
29
+ # group_description # Required
30
+ # tag 'ui-test-db-sec-group', 'yep'
31
+ #end
32
+
33
+ subnet_group = db_subnet_group 'TestingSubnetGroup' do
34
+ db_subnet_group_description 'SubnetGroup for Testing ENV'
35
+ subnet_id 's-1345345'
36
+ subnet_id 's-23566'
37
+ end
38
+
39
+ db_master = db_instance 'TestDBMasterInstance' do
40
+ allocated_storage '250' # Required
41
+ backup_retention_period '7'
42
+ db_instance_class 'db.m3.2xlarge' # Required
43
+ db_instance_identifier 'ui-test-db'
44
+ db_parameter_group_name param_group.name
45
+ db_subnet_group_name subnet_group.name
46
+ engine 'MySQL'
47
+ iops '1000'
48
+ master_username 'ui-test-db-user'
49
+ master_user_password 'ui-test-db-password'
50
+ multi_az true
51
+ # vpc_security_groups fn_ref(sec_group.name)
52
+ tag 'ui-test-db', 'yep'
53
+ end
54
+
55
+ db_instance 'TestDBReplicaInstance' do
56
+ source_db_instance_identifier db_master.properties['DBInstanceIdentifier']
57
+ allocated_storage '250' # Required
58
+ db_instance_class 'db.m3.2xlarge' # Required
59
+ db_instance_identifier "#{db_master.properties['DBInstanceIdentifier']}-replica"
60
+ db_parameter_group_name param_group.name
61
+ db_subnet_group_name subnet_group.name
62
+ engine 'MySQL'
63
+ iops '1000'
64
+ # vpc_security_groups fn_ref(sec_group.name)
65
+ tag 'ui-test-db-replica', 'yep'
66
+ end
67
+ end
68
+
69
+ puts rds_template.to_json
70
+ # puts Convection.stack('S3TestStack', s3_template, :region => 'us-west-1').apply
File without changes
@@ -0,0 +1,32 @@
1
+ #!/usr/bin/env ruby
2
+ require 'convection'
3
+
4
+ sqs_template = Convection.template do
5
+ description 'Testing SQS bucket definition'
6
+
7
+ sqs_queue 'TestQueue' do
8
+ message_retention_period '345600'
9
+ queue_name 'testQueueName'
10
+ visibility_timeout '120'
11
+ end
12
+
13
+ sqs_queue_policy 'TestQueuePolicy' do
14
+ queue fn_ref(:TestQueue)
15
+ policy_document :Statement =>[{
16
+ :Effect => "Allow",
17
+ :Action => [ "SQS:SendMessage" ],
18
+ :Resource => "ResourceARN",
19
+ :Principal => {
20
+ "AWS" => "*"
21
+ },
22
+ :Condition => {
23
+ "ArnLike" => {
24
+ "aws:SourceArn" => "arn:aws:s3:*:*:bucket-name"
25
+ }
26
+ }
27
+ }]
28
+ end
29
+ end
30
+
31
+ puts sqs_template.to_json
32
+ # puts Convection.stack('SQSTestQueue', sqs_template, :region => 'us-west-1').apply
@@ -0,0 +1,85 @@
1
+ #!/usr/bin/env ruby
2
+ require 'convection'
3
+
4
+ test_template = Convection.template do
5
+ description 'This is a test stack generated with Convection'
6
+
7
+ parameter 'InstanceSize' do
8
+ type 'String'
9
+ description 'Instance Size'
10
+ default 'm3.medium'
11
+
12
+ allow 'm3.medium'
13
+ allow 'm3.large'
14
+ allow 'm3.xlarge'
15
+ end
16
+
17
+ mapping 'RegionalAMIs' do
18
+ item 'us-east-1', 'hvm', 'ami-76e27e1e'
19
+ item 'us-west-1', 'hvm', 'ami-d5180890'
20
+ item 'us-east-1', 'pv', 'ami-64e27e0c'
21
+ item 'us-west-1', 'pv', 'ami-c5180880'
22
+ end
23
+
24
+ mapping 'RegionalKeys' do
25
+ item 'us-east-1', 'test', 'cf-test-keys'
26
+ item 'us-west-1', 'test', 'cf-test-keys'
27
+ end
28
+
29
+ ## Define the VPC
30
+ ec2_vpc 'TargetVPC' do
31
+ network '100.65.0.0/18'
32
+ subnet_length 25
33
+
34
+ ## Add an InternetGateway
35
+ add_internet_gateway
36
+
37
+ ## Add a default routing table
38
+ public_table = add_route_table('Public', :gateway_route => true)
39
+
40
+ ## Define Subnets and Insatnces in each availability zone
41
+ stack.availability_zones do |zone, i|
42
+ add_subnet "Test#{ i }" do
43
+ availability_zone zone
44
+ route_table public_table
45
+
46
+ tag 'Service', 'Foo'
47
+ end
48
+ end
49
+
50
+ tag 'Name', join('-', 'cf-test-vpc', fn_ref('AWS::StackName'))
51
+ end
52
+
53
+ ec2_security_group 'BetterSecurityGroup' do
54
+ ingress_rule do
55
+ cidr_ip '0.0.0.0/0'
56
+ from 22
57
+ to 22
58
+ protocol 'TCP'
59
+ end
60
+ egress_rule do
61
+ cidr_ip '0.0.0.0/0'
62
+ from 0
63
+ to 65_535
64
+ protocol(-1)
65
+ end
66
+
67
+ description 'Allow SSH traffic from all of the places'
68
+ vpc fn_ref(:TargetVPC)
69
+
70
+ tag 'Name', join('-', fn_ref('AWS::StackName'), 'BetterSecurityGroup')
71
+ end
72
+ end
73
+
74
+ # puts test_template.render
75
+ # puts test_template.to_json
76
+
77
+ # stack_e1 = Convection.stack('TestStackE1B1', test_template, :region => 'us-east-1')
78
+ stack_w1 = Convection.stack('TestStackW1B2', test_template, :region => 'us-west-1')
79
+
80
+ # puts stack_e1.status
81
+ # puts stack_e1.apply
82
+ puts stack_w1.to_json
83
+
84
+ puts "Status #{ stack_w1.status }"
85
+ # puts stack_w1.apply
@@ -0,0 +1,22 @@
1
+ require_relative '../lib/convection'
2
+
3
+ module Convection
4
+ module Demo
5
+ FOOBAR = Convection.template do
6
+ description 'Demo Foobar'
7
+
8
+ ec2_instance 'Foobar' do
9
+ subnet stack.get('vpc', 'TargetVPCSubnetPublic3')
10
+ security_group stack.get('security-groups', 'Foobar')
11
+
12
+ image_id stack['foobar-image']
13
+ instance_type 'm3.medium'
14
+ key_name 'production'
15
+
16
+ tag 'Name', 'foobar-0'
17
+ tag 'Service', 'foobar'
18
+ tag 'Stack', stack.cloud
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,335 @@
1
+ {
2
+ "AWSTemplateFormatVersion": "2010-09-09",
3
+ "Description": "Demo VPC",
4
+ "Parameters": {
5
+ },
6
+ "Mappings": {
7
+ },
8
+ "Conditions": {
9
+ },
10
+ "Resources": {
11
+ "TargetVPCIGVPCAttachmentTargetVPC": {
12
+ "Type": "AWS::EC2::VPCGatewayAttachment",
13
+ "Properties": {
14
+ "VpcId": {
15
+ "Ref": "TargetVPC"
16
+ },
17
+ "InternetGatewayId": {
18
+ "Ref": "TargetVPCIG"
19
+ }
20
+ }
21
+ },
22
+ "TargetVPCIG": {
23
+ "Type": "AWS::EC2::InternetGateway",
24
+ "Properties": {
25
+ "Tags": [
26
+ {
27
+ "Key": "Name",
28
+ "Value": "TargetVPCInternetGateway"
29
+ }
30
+ ]
31
+ }
32
+ },
33
+ "TargetVPCACLPublicEntryAllowAllIngress": {
34
+ "Type": "AWS::EC2::NetworkAclEntry",
35
+ "Properties": {
36
+ "NetworkAclId": {
37
+ "Ref": "TargetVPCACLPublic"
38
+ },
39
+ "RuleAction": "allow",
40
+ "RuleNumber": 100,
41
+ "PortRange": {
42
+ "From": 0,
43
+ "To": 65535
44
+ },
45
+ "CidrBlock": "0.0.0.0/0",
46
+ "Protocol": -1
47
+ }
48
+ },
49
+ "TargetVPCACLPublicEntryAllowAllEgress": {
50
+ "Type": "AWS::EC2::NetworkAclEntry",
51
+ "Properties": {
52
+ "NetworkAclId": {
53
+ "Ref": "TargetVPCACLPublic"
54
+ },
55
+ "RuleAction": "allow",
56
+ "RuleNumber": 100,
57
+ "Egress": true,
58
+ "PortRange": {
59
+ "From": 0,
60
+ "To": 65535
61
+ },
62
+ "CidrBlock": "0.0.0.0/0",
63
+ "Protocol": -1
64
+ }
65
+ },
66
+ "TargetVPCACLPublic": {
67
+ "Type": "AWS::EC2::NetworkAcl",
68
+ "Properties": {
69
+ "VpcId": {
70
+ "Ref": "TargetVPC"
71
+ },
72
+ "Tags": [
73
+ {
74
+ "Key": "Name",
75
+ "Value": "acl-public-convection-test"
76
+ },
77
+ {
78
+ "Key": "Stack",
79
+ "Value": "convection-test"
80
+ }
81
+ ]
82
+ }
83
+ },
84
+ "TargetVPCTablePublic": {
85
+ "Type": "AWS::EC2::RouteTable",
86
+ "Properties": {
87
+ "VpcId": {
88
+ "Ref": "TargetVPC"
89
+ },
90
+ "Tags": [
91
+ {
92
+ "Key": "Name",
93
+ "Value": "routes-public-convection-test"
94
+ },
95
+ {
96
+ "Key": "Stack",
97
+ "Value": "convection-test"
98
+ }
99
+ ]
100
+ }
101
+ },
102
+ "TargetVPCTablePublicRouteDefault": {
103
+ "Type": "AWS::EC2::Route",
104
+ "Properties": {
105
+ "RouteTableId": {
106
+ "Ref": "TargetVPCTablePublic"
107
+ },
108
+ "DestinationCidrBlock": "0.0.0.0/0",
109
+ "GatewayId": {
110
+ "Ref": "TargetVPCIG"
111
+ }
112
+ }
113
+ },
114
+ "TargetVPCSubnetPublic0ACLAssociationTargetVPCACLPublic": {
115
+ "Type": "AWS::EC2::SubnetNetworkAclAssociation",
116
+ "Properties": {
117
+ "NetworkAclId": {
118
+ "Ref": "TargetVPCACLPublic"
119
+ },
120
+ "SubnetId": {
121
+ "Ref": "TargetVPCSubnetPublic0"
122
+ }
123
+ }
124
+ },
125
+ "TargetVPCSubnetPublic0RouteTableAssociationTargetVPCTablePublic": {
126
+ "Type": "AWS::EC2::SubnetRouteTableAssociation",
127
+ "Properties": {
128
+ "RouteTableId": {
129
+ "Ref": "TargetVPCTablePublic"
130
+ },
131
+ "SubnetId": {
132
+ "Ref": "TargetVPCSubnetPublic0"
133
+ }
134
+ }
135
+ },
136
+ "TargetVPCSubnetPublic0": {
137
+ "Type": "AWS::EC2::Subnet",
138
+ "Properties": {
139
+ "AvailabilityZone": "us-east-1a",
140
+ "VpcId": {
141
+ "Ref": "TargetVPC"
142
+ },
143
+ "CidrBlock": "10.255.0.0/24",
144
+ "Tags": [
145
+ {
146
+ "Key": "Name",
147
+ "Value": "subnet-public-convection-test-us-east-1a"
148
+ },
149
+ {
150
+ "Key": "immutable_metadata",
151
+ "Value": "{\"purpose\":\"public-convection-test\",\"target\":\"\"}"
152
+ },
153
+ {
154
+ "Key": "Stack",
155
+ "Value": "convection-test"
156
+ },
157
+ {
158
+ "Key": "Service",
159
+ "Value": "Public"
160
+ }
161
+ ]
162
+ }
163
+ },
164
+ "TargetVPCSubnetPublic1ACLAssociationTargetVPCACLPublic": {
165
+ "Type": "AWS::EC2::SubnetNetworkAclAssociation",
166
+ "Properties": {
167
+ "NetworkAclId": {
168
+ "Ref": "TargetVPCACLPublic"
169
+ },
170
+ "SubnetId": {
171
+ "Ref": "TargetVPCSubnetPublic1"
172
+ }
173
+ }
174
+ },
175
+ "TargetVPCSubnetPublic1RouteTableAssociationTargetVPCTablePublic": {
176
+ "Type": "AWS::EC2::SubnetRouteTableAssociation",
177
+ "Properties": {
178
+ "RouteTableId": {
179
+ "Ref": "TargetVPCTablePublic"
180
+ },
181
+ "SubnetId": {
182
+ "Ref": "TargetVPCSubnetPublic1"
183
+ }
184
+ }
185
+ },
186
+ "TargetVPCSubnetPublic1": {
187
+ "Type": "AWS::EC2::Subnet",
188
+ "Properties": {
189
+ "AvailabilityZone": "us-east-1c",
190
+ "VpcId": {
191
+ "Ref": "TargetVPC"
192
+ },
193
+ "CidrBlock": "10.255.1.0/24",
194
+ "Tags": [
195
+ {
196
+ "Key": "Name",
197
+ "Value": "subnet-public-convection-test-us-east-1c"
198
+ },
199
+ {
200
+ "Key": "immutable_metadata",
201
+ "Value": "{\"purpose\":\"public-convection-test\",\"target\":\"\"}"
202
+ },
203
+ {
204
+ "Key": "Stack",
205
+ "Value": "convection-test"
206
+ },
207
+ {
208
+ "Key": "Service",
209
+ "Value": "Public"
210
+ }
211
+ ]
212
+ }
213
+ },
214
+ "TargetVPCSubnetPublic2ACLAssociationTargetVPCACLPublic": {
215
+ "Type": "AWS::EC2::SubnetNetworkAclAssociation",
216
+ "Properties": {
217
+ "NetworkAclId": {
218
+ "Ref": "TargetVPCACLPublic"
219
+ },
220
+ "SubnetId": {
221
+ "Ref": "TargetVPCSubnetPublic2"
222
+ }
223
+ }
224
+ },
225
+ "TargetVPCSubnetPublic2RouteTableAssociationTargetVPCTablePublic": {
226
+ "Type": "AWS::EC2::SubnetRouteTableAssociation",
227
+ "Properties": {
228
+ "RouteTableId": {
229
+ "Ref": "TargetVPCTablePublic"
230
+ },
231
+ "SubnetId": {
232
+ "Ref": "TargetVPCSubnetPublic2"
233
+ }
234
+ }
235
+ },
236
+ "TargetVPCSubnetPublic2": {
237
+ "Type": "AWS::EC2::Subnet",
238
+ "Properties": {
239
+ "AvailabilityZone": "us-east-1d",
240
+ "VpcId": {
241
+ "Ref": "TargetVPC"
242
+ },
243
+ "CidrBlock": "10.255.2.0/24",
244
+ "Tags": [
245
+ {
246
+ "Key": "Name",
247
+ "Value": "subnet-public-convection-test-us-east-1d"
248
+ },
249
+ {
250
+ "Key": "immutable_metadata",
251
+ "Value": "{\"purpose\":\"public-convection-test\",\"target\":\"\"}"
252
+ },
253
+ {
254
+ "Key": "Stack",
255
+ "Value": "convection-test"
256
+ },
257
+ {
258
+ "Key": "Service",
259
+ "Value": "Public"
260
+ }
261
+ ]
262
+ }
263
+ },
264
+ "TargetVPCSubnetPublic3ACLAssociationTargetVPCACLPublic": {
265
+ "Type": "AWS::EC2::SubnetNetworkAclAssociation",
266
+ "Properties": {
267
+ "NetworkAclId": {
268
+ "Ref": "TargetVPCACLPublic"
269
+ },
270
+ "SubnetId": {
271
+ "Ref": "TargetVPCSubnetPublic3"
272
+ }
273
+ }
274
+ },
275
+ "TargetVPCSubnetPublic3RouteTableAssociationTargetVPCTablePublic": {
276
+ "Type": "AWS::EC2::SubnetRouteTableAssociation",
277
+ "Properties": {
278
+ "RouteTableId": {
279
+ "Ref": "TargetVPCTablePublic"
280
+ },
281
+ "SubnetId": {
282
+ "Ref": "TargetVPCSubnetPublic3"
283
+ }
284
+ }
285
+ },
286
+ "TargetVPCSubnetPublic3": {
287
+ "Type": "AWS::EC2::Subnet",
288
+ "Properties": {
289
+ "AvailabilityZone": "us-east-1e",
290
+ "VpcId": {
291
+ "Ref": "TargetVPC"
292
+ },
293
+ "CidrBlock": "10.255.3.0/24",
294
+ "Tags": [
295
+ {
296
+ "Key": "Name",
297
+ "Value": "subnet-public-convection-test-us-east-1e"
298
+ },
299
+ {
300
+ "Key": "immutable_metadata",
301
+ "Value": "{\"purpose\":\"public-convection-test\",\"target\":\"\"}"
302
+ },
303
+ {
304
+ "Key": "Stack",
305
+ "Value": "convection-test"
306
+ },
307
+ {
308
+ "Key": "Service",
309
+ "Value": "Public"
310
+ }
311
+ ]
312
+ }
313
+ },
314
+ "TargetVPC": {
315
+ "Type": "AWS::EC2::VPC",
316
+ "Properties": {
317
+ "CidrBlock": "10.255.0.0/16",
318
+ "EnableDnsSupport": true,
319
+ "EnableDnsHostnames": true,
320
+ "Tags": [
321
+ {
322
+ "Key": "Name",
323
+ "Value": "convection-test"
324
+ },
325
+ {
326
+ "Key": "Stack",
327
+ "Value": "convection-test"
328
+ }
329
+ ]
330
+ }
331
+ }
332
+ },
333
+ "Outputs": {
334
+ }
335
+ }