-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample.yaml
206 lines (206 loc) · 7.56 KB
/
example.yaml
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
AWSTemplateFormatVersion: '2010-09-09'
Outputs:
ElbProdId:
Value: {Ref: ELBProd}
ElbStagingId:
Value: {Ref: ELBStaging}
VpcId:
Value: {Ref: Vpc}
Resources:
AWS::CloudFront::Distribution CFProdVideosDistribution:
DistributionConfig:
Aliases: [prod-videos.CENSORED.com]
Comment: Production Videos
DefaultCacheBehavior:
AllowedMethods: [GET, HEAD, OPTIONS]
ForwardedValues: {QueryString: false}
MinTTL: 3600
TargetOriginId: ProdVideosOrigin
ViewerProtocolPolicy: https-only
Enabled: true
Origins:
- DomainName: CENSORED-videos-prod.s3.amazonaws.com
Id: ProdVideosOrigin
S3OriginConfig: {}
AWS::CloudFront::Distribution CFStagingVideosDistribution:
DistributionConfig:
Aliases: [staging-videos.CENSORED.com]
Comment: Staging Videos
DefaultCacheBehavior:
AllowedMethods: [GET, HEAD, OPTIONS]
ForwardedValues: {QueryString: false}
MinTTL: 3600
TargetOriginId: StagingVideosOrigin
ViewerProtocolPolicy: https-only
Enabled: true
Origins:
- DomainName: CENSORED-videos-staging.s3.amazonaws.com
Id: StagingVideosOrigin
S3OriginConfig: {}
AWS::EC2::InternetGateway GW: {}
AWS::EC2::Route InternetRoute:
DestinationCidrBlock: 0.0.0.0/0
GatewayId: {Ref: GW}
RouteTableId: {Ref: RouteTable}
AWS::EC2::RouteTable RouteTable:
VpcId: {Ref: Vpc}
AWS::EC2::Subnet NetworkFrontAZ0:
AvailabilityZone: us-east-1b
CidrBlock: 172.16.0.0/18
Tags: {Name: Front0, net-az: 0, net-name: Front}
VpcId: {Ref: Vpc}
AWS::EC2::Subnet NetworkFrontAZ1:
AvailabilityZone: us-east-1d
CidrBlock: 172.16.64.0/18
Tags: {Name: Front1, net-az: 1, net-name: Front}
VpcId: {Ref: Vpc}
AWS::EC2::SubnetRouteTableAssociation NetworkFrontAZ0RouteAssoc:
RouteTableId: {Ref: RouteTable}
SubnetId: {Ref: NetworkFrontAZ0}
AWS::EC2::SubnetRouteTableAssociation NetworkFrontAZ1RouteAssoc:
RouteTableId: {Ref: RouteTable}
SubnetId: {Ref: NetworkFrontAZ1}
AWS::EC2::VPC Vpc: {CidrBlock: 172.16.0.0/16, EnableDnsHostnames: true, EnableDnsSupport: true}
AWS::EC2::VPCGatewayAttachment VpcGW:
InternetGatewayId: {Ref: GW}
VpcId: {Ref: Vpc}
AWS::ElasticLoadBalancing::LoadBalancer ELBBuild:
AvailabilityZones: [us-east-1b, us-east-1d]
ConnectionDrainingPolicy: {Enabled: true, Timeout: 60}
ConnectionSettings: {IdleTimeout: 60}
CrossZone: true
HealthCheck: {HealthyThreshold: 5, Interval: 5, Target: 'TCP:8080', Timeout: 4,
UnhealthyThreshold: 5}
Listeners:
- InstancePort: 8080
InstanceProtocol: HTTP
LoadBalancerPort: 443
PolicyNames: [ELBSecurityPolicy-2015-05]
Protocol: HTTPS
SSLCertificateId: arn:aws:iam::CENSORED:server-certificate/non-prod-star-CENSORED-me-2015
LoadBalancerName: build
Scheme: internet-facing
AWS::ElasticLoadBalancing::LoadBalancer ELBNPM:
ConnectionDrainingPolicy: {Enabled: true, Timeout: 60}
ConnectionSettings: {IdleTimeout: 60}
CrossZone: true
HealthCheck: {HealthyThreshold: 5, Interval: 5, Target: 'TCP:4783', Timeout: 4,
UnhealthyThreshold: 5}
Listeners:
- InstancePort: 4783
InstanceProtocol: HTTP
LoadBalancerPort: 443
PolicyNames: [ELBSecurityPolicy-2015-05]
Protocol: HTTPS
SSLCertificateId: arn:aws:iam::CENSORED:server-certificate/non-prod-star-CENSORED-me-2015
LoadBalancerName: npm
Scheme: internet-facing
Subnets:
- {Ref: NetworkFrontAZ0}
- {Ref: NetworkFrontAZ1}
AWS::ElasticLoadBalancing::LoadBalancer ELBProd:
ConnectionDrainingPolicy: {Enabled: true, Timeout: 60}
ConnectionSettings: {IdleTimeout: 60}
CrossZone: true
HealthCheck: {HealthyThreshold: 5, Interval: 5, Target: 'TCP:82', Timeout: 4,
UnhealthyThreshold: 5}
Listeners:
- {InstancePort: 80, InstanceProtocol: HTTP, LoadBalancerPort: 80, Protocol: HTTP}
- InstancePort: 82
InstanceProtocol: HTTP
LoadBalancerPort: 443
PolicyNames: [ELBSecurityPolicy-2015-05]
Protocol: HTTPS
SSLCertificateId: arn:aws:iam::CENSORED:server-certificate/non-prod-star-CENSORED-me-2015
LoadBalancerName: vpc-all-in-one-prod
Scheme: internet-facing
Subnets:
- {Ref: NetworkFrontAZ0}
- {Ref: NetworkFrontAZ1}
AWS::ElasticLoadBalancing::LoadBalancer ELBProd2:
ConnectionDrainingPolicy: {Enabled: true, Timeout: 60}
ConnectionSettings: {IdleTimeout: 60}
CrossZone: true
HealthCheck: {HealthyThreshold: 5, Interval: 5, Target: 'TCP:82', Timeout: 4,
UnhealthyThreshold: 5}
Listeners:
- {InstancePort: 80, InstanceProtocol: HTTP, LoadBalancerPort: 80, Protocol: HTTP}
- InstancePort: 82
InstanceProtocol: HTTP
LoadBalancerPort: 443
PolicyNames: [ELBSecurityPolicy-2015-05]
Protocol: HTTPS
SSLCertificateId: arn:aws:iam::CENSORED:server-certificate/prod-star-CENSORED-com-2015
LoadBalancerName: prod
Scheme: internet-facing
Subnets:
- {Ref: NetworkFrontAZ0}
- {Ref: NetworkFrontAZ1}
AWS::ElasticLoadBalancing::LoadBalancer ELBRepo:
AvailabilityZones: [us-east-1b, us-east-1d]
ConnectionDrainingPolicy: {Enabled: true, Timeout: 60}
ConnectionSettings: {IdleTimeout: 60}
CrossZone: true
HealthCheck: {HealthyThreshold: 5, Interval: 5, Target: 'TCP:8080', Timeout: 4,
UnhealthyThreshold: 5}
Listeners:
- InstancePort: 8080
InstanceProtocol: HTTP
LoadBalancerPort: 443
PolicyNames: [ELBSecurityPolicy-2015-05]
Protocol: HTTPS
SSLCertificateId: arn:aws:iam::CENSORED:server-certificate/non-prod-star-CENSORED-me-2015
LoadBalancerName: repo
Scheme: internet-facing
AWS::ElasticLoadBalancing::LoadBalancer ELBStaging:
ConnectionDrainingPolicy: {Enabled: true, Timeout: 60}
ConnectionSettings: {IdleTimeout: 60}
CrossZone: true
HealthCheck: {HealthyThreshold: 5, Interval: 5, Target: 'TCP:82', Timeout: 4,
UnhealthyThreshold: 5}
Listeners:
- {InstancePort: 80, InstanceProtocol: HTTP, LoadBalancerPort: 80, Protocol: HTTP}
- InstancePort: 82
InstanceProtocol: HTTP
LoadBalancerPort: 443
PolicyNames: [ELBSecurityPolicy-2015-05]
Protocol: HTTPS
SSLCertificateId: arn:aws:iam::CENSORED:server-certificate/non-prod-star-CENSORED-me-2015
LoadBalancerName: vpc-all-in-one-staging
Scheme: internet-facing
Subnets:
- {Ref: NetworkFrontAZ0}
- {Ref: NetworkFrontAZ1}
AWS::ElasticLoadBalancing::LoadBalancer ELBStaging2:
ConnectionDrainingPolicy: {Enabled: true, Timeout: 60}
ConnectionSettings: {IdleTimeout: 60}
CrossZone: true
HealthCheck: {HealthyThreshold: 5, Interval: 5, Target: 'TCP:82', Timeout: 4,
UnhealthyThreshold: 5}
Listeners:
- {InstancePort: 80, InstanceProtocol: HTTP, LoadBalancerPort: 80, Protocol: HTTP}
- InstancePort: 82
InstanceProtocol: HTTP
LoadBalancerPort: 443
PolicyNames: [ELBSecurityPolicy-2015-05]
Protocol: HTTPS
SSLCertificateId: arn:aws:iam::CENSORED:server-certificate/prod-star-CENSORED-com-2015
LoadBalancerName: staging
Scheme: internet-facing
Subnets:
- {Ref: NetworkFrontAZ0}
- {Ref: NetworkFrontAZ1}
AWS::IAM::InstanceProfile PMSDProfile:
Path: /instance-lister/
Roles:
- {Ref: PMSDRole}
AWS::IAM::Role PMSDRole:
AssumeRolePolicyDocument:
Statement:
- Action: ['sts:AssumeRole']
Effect: Allow
Principal:
Service: [ec2.amazonaws.com]
Version: '2012-10-17'
ManagedPolicyArns: ['arn:aws:iam::aws:policy/AmazonEC2ReadOnlyAccess']
Path: /instance-lister/