-
Notifications
You must be signed in to change notification settings - Fork 0
/
cfn-nested-dev
227 lines (227 loc) · 7.3 KB
/
cfn-nested-dev
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
AWSTemplateFormatVersion: 2010-09-09
Resources:
VPCdev:
Type: 'AWS::CloudFormation::Stack'
Properties:
TemplateURL: 'https://s3.amazonaws.com/XXXXXXXXXX/"your bucket location for dev networking'
Parameters:
VPCCIDRdev: !Ref VPCCIDRdev
PublicSubnetCIDRdev: !Ref PublicSubnetCIDRdev
PrivateSubnetCIDRdev: !Ref PrivateSubnetCIDRdev
DBSubnetCIDR: !Ref DBSubnetCIDR
AvailabilityZone1: !Ref AvailabilityZone1
AvailabilityZone2: !Ref AvailabilityZone2
AvailabilityZone3: !Ref AvailabilityZone3
EnvType: !Ref EnvType
Tagname: !Ref Tagname
Metadata:
'AWS::CloudFormation::Designer':
id: 36073df6-c23a-4c7e-a4e3-fc37c83e1c16
EC2dev:
Type: 'AWS::CloudFormation::Stack'
Properties:
TemplateURL: 'https://s3.amazonaws.com/XXXXXXXXXX/"your bucket location for dev resources'
Parameters:
KeyPairName: !Ref KeyPairName
DBName: !Ref DBName
DBUsername: !Ref DBUsername
DBPassword: !Ref DBPassword
DBClass: !Ref DBClass
DBAllocatedStorage: !Ref DBAllocatedStorage
SGpubmanidroot: !Ref SGpubmanidroot
SGprimanidroot: !Ref SGprimanidroot
subnetidpubdev: !GetAtt
- VPCdev
- Outputs.PublicSubnetIDdev
subnetidpridev: !GetAtt
- VPCdev
- Outputs.PrivateSubnetIDdev
DBSubnetid: !GetAtt
- VPCdev
- Outputs.DBSubnetIDdev
VPCiddev: !GetAtt
- VPCdev
- Outputs.VPCIDdev
Metadata:
'AWS::CloudFormation::Designer':
id: e31063b9-0ef3-4cc1-a56f-2b56db618212
DependsOn:
- VPCpeeringdev
VPCpeeringdev:
Type: 'AWS::CloudFormation::Stack'
Properties:
TemplateURL: 'https://s3.amazonaws.com/aap-infra-debo/routes/routes-dev.yml'
Parameters:
VPCidmanpeer: !Ref VPCidmanpeer
VPCiddev: !GetAtt
- VPCdev
- Outputs.VPCIDdev
RouteTableidpubmanpeer: !Ref RouteTableidpubmanpeer
RouteTableidpriman1peer: !Ref RouteTableidpriman1peer
RouteTableidpriman2peer: !Ref RouteTableidpriman2peer
RouteTableidpubdev: !GetAtt
- VPCdev
- Outputs.RouteTableIDpubdev
RouteTableidpridev: !GetAtt
- VPCdev
- Outputs.RouteTableIDpridev
Metadata:
'AWS::CloudFormation::Designer':
id: 473355d1-d871-4185-9713-897504213b3d
DependsOn:
- VPCdev
Parameters:
VPCCIDRdev:
AllowedPattern: '(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/(\d{1,2})'
Description: ' This Block is for VPC CIDR (X.X.X.X/X)'
Type: String
Default: 10.0.0.0/16
PublicSubnetCIDRdev:
AllowedPattern: '(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/(\d{1,2})'
Description: ' This Block is for VPC CIDR (X.X.X.X/X)'
Type: String
Default: 10.0.1.0/24
PrivateSubnetCIDRdev:
AllowedPattern: '(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/(\d{1,2})'
Description: ' This Block is for VPC CIDR (X.X.X.X/X)'
Type: String
Default: 10.0.0.0/24
DBSubnetCIDR:
AllowedPattern: '(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/(\d{1,2})'
Description: ' This Block is for VPC CIDR (X.X.X.X/X)'
Type: String
Default: 10.0.3.0/24
AvailabilityZone1:
Type: 'AWS::EC2::AvailabilityZone::Name'
Description: Select AZ 1 for for subnet
AvailabilityZone2:
Type: 'AWS::EC2::AvailabilityZone::Name'
Description: Select AZ 2 for subnet
AvailabilityZone3:
Type: 'AWS::EC2::AvailabilityZone::Name'
Description: Select AZ 3 for subnet
EnvType:
Description: ' This Block is for common tag work in value for all the resource'
Type: String
Default: aap development env
Tagname:
Description: Customer Name for reference tags
Type: String
Default: development env
KeyPairName:
Description: Name of an existing EC2 KeyPair to enable SSH access to the instance
Type: 'AWS::EC2::KeyPair::KeyName'
ConstraintDescription: must be the name of an existing EC2 KeyPair.
DBName:
Default: MyDatabase
Description: The database name
Type: String
MinLength: '1'
MaxLength: '64'
AllowedPattern: '[a-zA-Z][a-zA-Z0-9]*'
ConstraintDescription: must begin with a letter and contain only alphanumeric characters.
DBUsername:
Default: admin
NoEcho: 'true'
Description: The database admin account username
Type: String
MinLength: '1'
MaxLength: '16'
AllowedPattern: '[a-zA-Z][a-zA-Z0-9]*'
ConstraintDescription: must begin with a letter and contain only alphanumeric characters.
DBPassword:
Default: admin
NoEcho: 'true'
Description: The database admin account password
Type: String
MinLength: '1'
MaxLength: '41'
AllowedPattern: '[a-zA-Z0-9]*'
ConstraintDescription: must contain only alphanumeric characters.
DBClass:
Default: db.m1.small
Description: Database instance class
Type: String
AllowedValues:
- db.m1.small
- db.m1.large
- db.m1.xlarge
- db.m2.xlarge
- db.m2.2xlarge
- db.m2.4xlarge
ConstraintDescription: must select a valid database instance type.
DBAllocatedStorage:
Default: '5'
Description: The size of the database (Gb)
Type: Number
MinValue: '5'
MaxValue: '1024'
ConstraintDescription: must be between 5 and 1024Gb.
VPCidmanpeer:
Description: This the man VPC id for peering with the dev VPC
Type: String
RouteTableidpubmanpeer:
Description: This is the RTid public id of Man vpc
Type: String
RouteTableidpriman1peer:
Description: This is the RTid priman1 id of Man vpc
Type: String
RouteTableidpriman2peer:
Description: This is the RTid priman2 id of Man vpc
Type: String
SGpubmanidroot:
Description: SG id public man
Type: String
SGprimanidroot:
Description: SG id private man
Type: String
Outputs:
VPCIDdevstk:
Value: !GetAtt
- VPCdev
- Outputs.VPCIDdev
Description: Perimeter VPC ID
Export:
Name: !Sub '${AWS::StackName}-VPCIDdevstk'
PrivateSubnetIDdevstk:
Description: Private Subnet ID in Perimeter VPC
Value: !GetAtt
- VPCdev
- Outputs.PrivateSubnetIDdev
Export:
Name: !Sub '${AWS::StackName}-PrivateSubnetIDdevstk'
PublicSubnetIDdevstk:
Description: Public Subnet ID in Perimeter VPC
Value: !GetAtt
- VPCdev
- Outputs.PublicSubnetIDdev
Export:
Name: !Sub '${AWS::StackName}-PublicSubnetIDdevstk'
RouteTableIDpubdevstk:
Description: Public Subnet ID in Perimeter VPC
Value: !GetAtt
- VPCdev
- Outputs.RouteTableIDpubdev
Export:
Name: !Sub '${AWS::StackName}-RouteTableIDpubdevstk'
RouteTableIDpridevstk:
Description: Public Subnet ID in Perimeter VPC
Value: !GetAtt
- VPCdev
- Outputs.RouteTableIDpridev
Export:
Name: !Sub '${AWS::StackName}-RouteTableIDpridevstk'
SGdevpubidstk:
Description: SG of public instance in development resources
Value: !GetAtt
- EC2dev
- Outputs.SGdevpubid
Export:
Name: !Sub '${AWS::StackName}-SGdevpubidstk'
SGdevpriidstk:
Description: SG of public instance in development resources
Value: !GetAtt
- EC2dev
- Outputs.SGdevpriid
Export:
Name: !Sub '${AWS::StackName}-SGdevpriidstk'