11
11
"Description" : " Define o estado de ambiente do servidor" ,
12
12
"Default" : " dev" ,
13
13
"Type" : " String" ,
14
- "AllowedValues" : [" prod" , " dev" ],
14
+ "AllowedValues" : [
15
+ " prod" ,
16
+ " dev"
17
+ ],
15
18
"ConstraintDescription" : " precisa ser prod ou dev"
16
19
},
17
- "SSHLocation" : {
18
- "Description" : " Define o range de IPs que podem acessar o SSH do servidor" ,
20
+ "SSHLocation" : {
21
+ "Description" : " Define o range de IPs que podem acessar o SSH do servidor" ,
19
22
"Type" : " String" ,
20
23
"MinLength" : " 9" ,
21
24
"MaxLength" : " 18" ,
22
25
"Default" : " 0.0.0.0/0" ,
23
26
"AllowedPattern" : " (\\ d{1,3})\\ .(\\ d{1,3})\\ .(\\ d{1,3})\\ .(\\ d{1,3})/(\\ d{1,2})" ,
24
27
"ConstraintDescription" : " precisa ser um range de IP CIDR validos x.x.x.x/x."
25
- }
28
+ }
26
29
},
27
30
"Resources" : {
28
31
"RootRole" : {
85
88
]
86
89
}
87
90
},
91
+ "ElasticIP" : {
92
+ "Type" : " AWS::EC2::EIP" ,
93
+ "Properties" : {
94
+ "InstanceId" : {
95
+ "Ref" : " EC2InstanceWeb"
96
+ }
97
+ }
98
+ },
88
99
"SecurityGroupWebTraffic" : {
89
100
"Type" : " AWS::EC2::SecurityGroup" ,
90
101
"Properties" : {
94
105
"IpProtocol" : " tcp" ,
95
106
"FromPort" : 22 ,
96
107
"ToPort" : 22 ,
97
- "CidrIp" : {"Ref" : " SSHLocation" },
108
+ "CidrIp" : {
109
+ "Ref" : " SSHLocation"
110
+ },
98
111
"Description" : " SSH traffic"
99
112
},
100
113
{
128
141
],
129
142
"ImageId" : " ami-0bbe28eb2173f6167" ,
130
143
"InstanceType" : " t2.micro" ,
131
- "KeyName" : { "Ref" : " KeyName" },
144
+ "KeyName" : {
145
+ "Ref" : " KeyName"
146
+ },
132
147
"Tags" : [
133
148
{
134
149
"Key" : " Name" ,
135
150
"Value" : " nginx-server"
136
151
},
137
152
{
138
153
"Key" : " EnvironmentType" ,
139
- "Value" : { "Ref" : " EnvironmentType" }
154
+ "Value" : {
155
+ "Ref" : " EnvironmentType"
156
+ }
140
157
}
141
158
],
142
159
"NetworkInterfaces" : [
188
205
}
189
206
}
190
207
}
208
+ },
209
+ "Outputs" : {
210
+ "ElasticIPV4" : {
211
+ "Description" : " Retorna o valor do IP registrado para a instancia" ,
212
+ "Value" : {
213
+ "Ref" : " ElasticIP"
214
+ }
215
+ }
191
216
}
192
217
}
0 commit comments