-
Notifications
You must be signed in to change notification settings - Fork 12
/
master.yaml
687 lines (619 loc) · 30.1 KB
/
master.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
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
Description: >
This template deploys a VPC, with a pair of public and private subnets spread
across two Availabilty Zones. It deploys an Internet Gateway, with a default
route on the public subnets. It deploys a pair of NAT Gateways (one in each AZ),
and default routes for them in the private subnets.
It then deploys a highly available ECS cluster using an AutoScaling Group, with
ECS hosts distributed across multiple Availability Zones.
Finally, it deploys a suite ECS services from containers published in
Amazon EC2 Container Registry (Amazon ECR).
Based on AWSLabs ECS Reference Architecture
https://github.com/awslabs/ecs-refarch-cloudformation
Last Modified: 05 October 2019
Author Mike Lonergan ([email protected]), Ian Turner ([email protected]), Dan Carr ([email protected])
Parameters:
KeyPairName:
Description: Key Pair for access to bastion and ecs host instances
Type: String
PublicAlbAcmCertificate:
AllowedPattern: ^$|(arn:aws:acm:)([a-z0-9/:-])*([a-z0-9])$
Description: '[ Optional ] The AWS Certification Manager certificate ARN for the ALB certificate - this certificate should be created in the region you wish to run the ALB and must reference the Drupal domain name you use below.'
Type: String
Resources:
##### Basic Infrastructure #####
VPC:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: https://s3-us-west-2.amazonaws.com/hacko-infrastructure-cfn/infrastructure/vpc.yaml
Parameters:
EnvironmentName: !Ref AWS::StackName
VpcCIDR: 10.180.0.0/16
PublicSubnet1CIDR: 10.180.8.0/21
PublicSubnet2CIDR: 10.180.16.0/21
PrivateSubnet1CIDR: 10.180.24.0/21
PrivateSubnet2CIDR: 10.180.32.0/21
SecurityGroups:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: https://s3-us-west-2.amazonaws.com/hacko-infrastructure-cfn/infrastructure/security-groups.yaml
Parameters:
EnvironmentName: !Ref AWS::StackName
VPC: !GetAtt VPC.Outputs.VPC
ALB:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: https://s3-us-west-2.amazonaws.com/hacko-infrastructure-cfn/infrastructure/load-balancers.yaml
Parameters:
EnvironmentName: !Ref AWS::StackName
VPC: !GetAtt VPC.Outputs.VPC
Subnets: !GetAtt VPC.Outputs.PublicSubnets
SecurityGroup: !GetAtt SecurityGroups.Outputs.LoadBalancerSecurityGroup
PublicAlbAcmCertificate: arn:aws:acm:us-west-2:845828040396:certificate/ca1d5fc4-f21a-4305-a656-8ac91cd527bc
ECS:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: https://s3-us-west-2.amazonaws.com/hacko-infrastructure-cfn/infrastructure/ecs-cluster.yaml
Parameters:
EnvironmentName: !Ref AWS::StackName
KeyPairName: !Ref KeyPairName
InstanceType: t2.large
ClusterSize: 2
VPC: !GetAtt VPC.Outputs.VPC
SecurityGroup: !GetAtt SecurityGroups.Outputs.ECSHostSecurityGroup
Subnets: !GetAtt VPC.Outputs.PrivateSubnets
ECSAMI: ami-0f7bc74af1927e7c8 # TEMPORARY civic-devops-282
#### DNS records ####
DNSFrontend2017:
Type: AWS::Route53::RecordSetGroup
Properties:
HostedZoneName: civicplatform.org.
Comment: Zone apex alias targeted to ALB LoadBalancer
RecordSets:
- Name: 2017.civicplatform.org.
Type: A
AliasTarget:
HostedZoneId: !GetAtt ALB.Outputs.CanonicalHostedZoneId
DNSName: !GetAtt ALB.Outputs.PublicAlbDnsName
DNSFrontend2017Alias:
Type: AWS::Route53::RecordSet
Properties:
HostedZoneName: civicpdx.org.
Comment: Redirecting a legacy domain
Name: 2017.civicpdx.org
Type: CNAME
TTL: '900'
ResourceRecords:
- 2017.civicplatform.org
DNSFrontend2018Alias:
Type: AWS::Route53::RecordSet
Properties:
HostedZoneName: civicplatform.org.
Comment: Redirecting the www
Name: www.civicplatform.org
Type: CNAME
TTL: '900'
ResourceRecords:
- civicplatform.org
DNSDisasterGame:
Type: AWS::Route53::RecordSetGroup
Properties:
HostedZoneName: civicplatform.org.
Comment: Zone apex alias targeted to ALB LoadBalancer
RecordSets:
- Name: disastergame.civicplatform.org.
Type: A
AliasTarget:
HostedZoneId: !GetAtt ALB.Outputs.CanonicalHostedZoneId
DNSName: !GetAtt ALB.Outputs.PublicAlbDnsName
DNSDisasterGame2:
Type: AWS::Route53::RecordSetGroup
Properties:
HostedZoneName: civicplatform.org.
Comment: Zone apex alias targeted to ALB LoadBalancer
RecordSets:
- Name: omsidisastergame.civicplatform.org.
Type: A
AliasTarget:
HostedZoneId: !GetAtt ALB.Outputs.CanonicalHostedZoneId
DNSName: !GetAtt ALB.Outputs.PublicAlbDnsName
##### Databases #####
# RDSTestInstance:
# Type: AWS::CloudFormation::Stack
# Properties:
# TemplateURL: https://s3-us-west-2.amazonaws.com/hacko-infrastructure-cfn/database/rds-postgres.yaml
# Parameters:
# AvailabilityZone: us-west-2a
# SecurityGroup: !GetAtt SecurityGroups.Outputs.DBPublicSecurityGroup
# SubnetGroupName: !GetAtt VPC.Outputs.PublicDBSubnetGroup
# InstanceName: rdstestinstance
# InstanceSize: db.t2.micro
# InstanceStorage: 20
# SsmParameterPath: /production/2019/RDS/rdstestinstance
# DatabaseName: RDSTestDbMike
##### EC2 instances #####
BastionHost:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: https://s3-us-west-2.amazonaws.com/hacko-infrastructure-cfn/infrastructure/ec2-instance.yaml
Parameters:
EnvironmentName: !Ref AWS::StackName
VPC: !GetAtt VPC.Outputs.VPC
AvailabilityZone: us-west-2a
SecurityGroupId: !GetAtt SecurityGroups.Outputs.BastionHostSecurityGroup
ServerName: bastion
AmiName: bastion
KeyPairName: !Ref KeyPairName
InstanceType: t2.nano
Subnet: !GetAtt VPC.Outputs.PublicSubnet1
##### Container Services #####
# API Endpoint catalog
EndpointsCatalogPage:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: https://s3-us-west-2.amazonaws.com/hacko-infrastructure-cfn/fargate-services/fargate-endpoints-catalog.yaml
Parameters:
ProjectName: endpoints-catalog-service
DeploymentSsmNamespace: /production
HealthCheckPathName: /
Listener: !GetAtt ALB.Outputs.Listener
ListenerTls: !GetAtt ALB.Outputs.ListenerTls
ListenerRulePriority: 79
ListenerRuleTlsPriority: 80
ListenerRuleSecondaryPriority: 81
ListenerRuleSecondaryTlsPriority: 82
Host: service.civicpdx.org
Path: /
PathSecondary: /__assets*
VPC: !GetAtt VPC.Outputs.VPC
Cluster: !GetAtt ECS.Outputs.Cluster
DesiredCount: 1
ECSTaskExecutionRole: !GetAtt ECS.Outputs.ECSTaskExecutionRole
TaskCpu: 256
TaskMemory: 512
ContainerPort: 8000
SecurityGroup: !GetAtt SecurityGroups.Outputs.ECSTaskSecurityGroup
Subnets: !GetAtt VPC.Outputs.PrivateSubnets
EcrImage: 845828040396.dkr.ecr.us-west-2.amazonaws.com/production/endpoint-service-catalog:latest
# Frontend Application services
Civic2017FrontEnd:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: https://s3-us-west-2.amazonaws.com/hacko-infrastructure-cfn/fargate-services/fargate-frontend.yaml
Parameters:
ProjectName: civic-2017-service
HealthCheckPathName: /2017/
Listener: !GetAtt ALB.Outputs.Listener
ListenerTls: !GetAtt ALB.Outputs.ListenerTls
ListenerRulePriority: 15
ListenerRuleTlsPriority: 16
ListenerRule2Priority: 17
Host: 2017.civicplatform.org
Host2: www.civicpdx.org
Path: /*
VPC: !GetAtt VPC.Outputs.VPC
Cluster: !GetAtt ECS.Outputs.Cluster
DesiredCount: 2
ECSTaskExecutionRole: !GetAtt ECS.Outputs.ECSTaskExecutionRole
TaskCpu: 256
TaskMemory: 512
ContainerPort: 3000
SecurityGroup: !GetAtt SecurityGroups.Outputs.ECSTaskSecurityGroup
Subnets: !GetAtt VPC.Outputs.PrivateSubnets
EcrImage: 845828040396.dkr.ecr.us-west-2.amazonaws.com/production/civic-2017:latest
CivicPlatformFrontEnd:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: https://s3-us-west-2.amazonaws.com/hacko-infrastructure-cfn/fargate-services/fargate-frontend.yaml
Parameters:
ProjectName: civic-2018-service
HealthCheckPathName: /2018/
Listener: !GetAtt ALB.Outputs.Listener
ListenerTls: !GetAtt ALB.Outputs.ListenerTls
ListenerRulePriority: 45
ListenerRuleTlsPriority: 46
ListenerRule2Priority: 47
Host: civicplatform.org
Host2: www.civicplatform.org
Path: /*
VPC: !GetAtt VPC.Outputs.VPC
Cluster: !GetAtt ECS.Outputs.Cluster
DesiredCount: 2
ECSTaskExecutionRole: !GetAtt ECS.Outputs.ECSTaskExecutionRole
TaskCpu: 256
TaskMemory: 512
ContainerPort: 3000
SecurityGroup: !GetAtt SecurityGroups.Outputs.ECSTaskSecurityGroup
Subnets: !GetAtt VPC.Outputs.PrivateSubnets
EcrImage: 845828040396.dkr.ecr.us-west-2.amazonaws.com/production/civic-2018:latest
Civic2019Disaster:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: https://s3-us-west-2.amazonaws.com/hacko-infrastructure-cfn/fargate-services/fargate-frontend.yaml
Parameters:
ProjectName: civic-2019-disaster
HealthCheckPathName: /2019-disaster-game/
Listener: !GetAtt ALB.Outputs.Listener
ListenerTls: !GetAtt ALB.Outputs.ListenerTls
ListenerRulePriority: 100
ListenerRuleTlsPriority: 101
ListenerRule2Priority: 102
Host: disastergame.civicplatform.org
Host2: omsidisastergame.civicplatform.org #dummy address, just needed for the fargate-frontend template
Path: /*
VPC: !GetAtt VPC.Outputs.VPC
Cluster: !GetAtt ECS.Outputs.Cluster
DesiredCount: 1
ECSTaskExecutionRole: !GetAtt ECS.Outputs.ECSTaskExecutionRole
TaskCpu: 256
TaskMemory: 512
ContainerPort: 3000
SecurityGroup: !GetAtt SecurityGroups.Outputs.ECSTaskSecurityGroup
Subnets: !GetAtt VPC.Outputs.PrivateSubnets
EcrImage: 845828040396.dkr.ecr.us-west-2.amazonaws.com/production/civic-2019-disaster-game:latest
# 2019 API services - Fargate
## This one supports the "examplar" (sic) which is the template for all 2019 API projects
2019Exemplar:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: https://s3-us-west-2.amazonaws.com/hacko-infrastructure-cfn/fargate-services/2019-fargate-api.yaml
Parameters:
ProjectName: 2019-examplar
DeploymentSsmNamespace: /staging
HealthCheckPathName: /examplar/health/
Listener: !GetAtt ALB.Outputs.Listener
ListenerTls: !GetAtt ALB.Outputs.ListenerTls
ListenerRulePriority: 22
ListenerRuleTlsPriority: 23
Host: service.civicpdx.org
Path: /examplar*
VPC: !GetAtt VPC.Outputs.VPC
Cluster: !GetAtt ECS.Outputs.Cluster
DesiredCount: 1
ECSTaskExecutionRole: !GetAtt ECS.Outputs.ECSTaskExecutionRole
TaskCpu: 256
TaskMemory: 512
ContainerPort: 8000
SecurityGroup: !GetAtt SecurityGroups.Outputs.ECSTaskSecurityGroup
Subnets: !GetAtt VPC.Outputs.PrivateSubnets
EcrImage: 845828040396.dkr.ecr.us-west-2.amazonaws.com/testing/2019-examplar:latest
2019Housing:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: https://s3-us-west-2.amazonaws.com/hacko-infrastructure-cfn/fargate-services/2019-fargate-api.yaml
Parameters:
ProjectName: 2019-housing
DeploymentSsmNamespace: /staging
HealthCheckPathName: /housing2019/v1/schema/
Listener: !GetAtt ALB.Outputs.Listener
ListenerTls: !GetAtt ALB.Outputs.ListenerTls
ListenerRulePriority: 24
ListenerRuleTlsPriority: 25
Host: service.civicpdx.org
Path: /housing2019*
VPC: !GetAtt VPC.Outputs.VPC
Cluster: !GetAtt ECS.Outputs.Cluster
DesiredCount: 1
ECSTaskExecutionRole: !GetAtt ECS.Outputs.ECSTaskExecutionRole
TaskCpu: 256
TaskMemory: 512
ContainerPort: 8000
SecurityGroup: !GetAtt SecurityGroups.Outputs.ECSTaskSecurityGroup
Subnets: !GetAtt VPC.Outputs.PrivateSubnets
EcrImage: 845828040396.dkr.ecr.us-west-2.amazonaws.com/staging/2019-housing:latest
2019Sandbox:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: https://s3-us-west-2.amazonaws.com/hacko-infrastructure-cfn/fargate-services/2019-fargate-api.yaml
Parameters:
ProjectName: 2019-sandbox
DeploymentSsmNamespace: /staging
HealthCheckPathName: /sandbox/schema/
Listener: !GetAtt ALB.Outputs.Listener
ListenerTls: !GetAtt ALB.Outputs.ListenerTls
ListenerRulePriority: 26
ListenerRuleTlsPriority: 27
Host: service.civicpdx.org
Path: /sandbox*
VPC: !GetAtt VPC.Outputs.VPC
Cluster: !GetAtt ECS.Outputs.Cluster
DesiredCount: 2
ECSTaskExecutionRole: !GetAtt ECS.Outputs.ECSTaskExecutionRole
TaskCpu: 256
TaskMemory: 512
ContainerPort: 8000
SecurityGroup: !GetAtt SecurityGroups.Outputs.ECSTaskSecurityGroup
Subnets: !GetAtt VPC.Outputs.PrivateSubnets
EcrImage: 845828040396.dkr.ecr.us-west-2.amazonaws.com/staging/2019-sandbox:latest
2019Transportation:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: https://s3-us-west-2.amazonaws.com/hacko-infrastructure-cfn/fargate-services/2019-fargate-api.yaml
Parameters:
ProjectName: 2019-transportation
DeploymentSsmNamespace: /staging
HealthCheckPathName: /transportation2019/v1/schema/
Listener: !GetAtt ALB.Outputs.Listener
ListenerTls: !GetAtt ALB.Outputs.ListenerTls
ListenerRulePriority: 28
ListenerRuleTlsPriority: 29
Host: service.civicpdx.org
Path: /transportation2019/*
VPC: !GetAtt VPC.Outputs.VPC
Cluster: !GetAtt ECS.Outputs.Cluster
DesiredCount: 1
ECSTaskExecutionRole: !GetAtt ECS.Outputs.ECSTaskExecutionRole
TaskCpu: 256
TaskMemory: 512
ContainerPort: 8000
SecurityGroup: !GetAtt SecurityGroups.Outputs.ECSTaskSecurityGroup
Subnets: !GetAtt VPC.Outputs.PrivateSubnets
EcrImage: 845828040396.dkr.ecr.us-west-2.amazonaws.com/staging/2019-transportation:latest
# 2018 API services - Fargate
2018DR:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: https://s3-us-west-2.amazonaws.com/hacko-infrastructure-cfn/fargate-services/2019-fargate-api.yaml
Parameters:
ProjectName: disaster-resilience-service
DeploymentSsmNamespace: /production
HealthCheckPathName: /disaster-resilience/
Listener: !GetAtt ALB.Outputs.Listener
ListenerTls: !GetAtt ALB.Outputs.ListenerTls
ListenerRulePriority: 30
ListenerRuleTlsPriority: 31
Host: service.civicpdx.org
Path: /disaster-resilience/*
VPC: !GetAtt VPC.Outputs.VPC
Cluster: !GetAtt ECS.Outputs.Cluster
DesiredCount: 1
ECSTaskExecutionRole: !GetAtt ECS.Outputs.ECSTaskExecutionRole
TaskCpu: 256
TaskMemory: 512
ContainerPort: 8000
SecurityGroup: !GetAtt SecurityGroups.Outputs.ECSTaskSecurityGroup
Subnets: !GetAtt VPC.Outputs.PrivateSubnets
EcrImage: 845828040396.dkr.ecr.us-west-2.amazonaws.com/production/disaster-resilience-service:latest
2018HA:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: https://s3-us-west-2.amazonaws.com/hacko-infrastructure-cfn/fargate-services/2019-fargate-api.yaml
Parameters:
ProjectName: housing-affordability-service
DeploymentSsmNamespace: /production
HealthCheckPathName: /housing-affordability/
Listener: !GetAtt ALB.Outputs.Listener
ListenerTls: !GetAtt ALB.Outputs.ListenerTls
ListenerRulePriority: 32
ListenerRuleTlsPriority: 33
Host: service.civicpdx.org
Path: /housing-affordability/*
VPC: !GetAtt VPC.Outputs.VPC
Cluster: !GetAtt ECS.Outputs.Cluster
DesiredCount: 1
ECSTaskExecutionRole: !GetAtt ECS.Outputs.ECSTaskExecutionRole
TaskCpu: 256
TaskMemory: 512
ContainerPort: 8000
SecurityGroup: !GetAtt SecurityGroups.Outputs.ECSTaskSecurityGroup
Subnets: !GetAtt VPC.Outputs.PrivateSubnets
EcrImage: 845828040396.dkr.ecr.us-west-2.amazonaws.com/production/housing-affordability:latest
2018LE:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: https://s3-us-west-2.amazonaws.com/hacko-infrastructure-cfn/fargate-services/2019-fargate-api.yaml
Parameters:
ProjectName: local-elections-service
DeploymentSsmNamespace: /production
HealthCheckPathName: /local-elections/
Listener: !GetAtt ALB.Outputs.Listener
ListenerTls: !GetAtt ALB.Outputs.ListenerTls
ListenerRulePriority: 34
ListenerRuleTlsPriority: 35
Host: service.civicpdx.org
Path: /local-elections/*
VPC: !GetAtt VPC.Outputs.VPC
Cluster: !GetAtt ECS.Outputs.Cluster
DesiredCount: 1
ECSTaskExecutionRole: !GetAtt ECS.Outputs.ECSTaskExecutionRole
TaskCpu: 256
TaskMemory: 512
ContainerPort: 8000
SecurityGroup: !GetAtt SecurityGroups.Outputs.ECSTaskSecurityGroup
Subnets: !GetAtt VPC.Outputs.PrivateSubnets
EcrImage: 845828040396.dkr.ecr.us-west-2.amazonaws.com/production/local-elections:latest
2018ND:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: https://s3-us-west-2.amazonaws.com/hacko-infrastructure-cfn/fargate-services/2019-fargate-api.yaml
Parameters:
ProjectName: neighborhood-development-service
DeploymentSsmNamespace: /production
HealthCheckPathName: /neighborhood-development/
Listener: !GetAtt ALB.Outputs.Listener
ListenerTls: !GetAtt ALB.Outputs.ListenerTls
ListenerRulePriority: 36
ListenerRuleTlsPriority: 37
Host: service.civicpdx.org
Path: /neighborhood-development*
VPC: !GetAtt VPC.Outputs.VPC
Cluster: !GetAtt ECS.Outputs.Cluster
DesiredCount: 1
ECSTaskExecutionRole: !GetAtt ECS.Outputs.ECSTaskExecutionRole
TaskCpu: 256
TaskMemory: 512
ContainerPort: 8000
SecurityGroup: !GetAtt SecurityGroups.Outputs.ECSTaskSecurityGroup
Subnets: !GetAtt VPC.Outputs.PrivateSubnets
EcrImage: 845828040396.dkr.ecr.us-west-2.amazonaws.com/production/neighborhood-development:latest
2018TS:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: https://s3-us-west-2.amazonaws.com/hacko-infrastructure-cfn/fargate-services/2019-fargate-api.yaml
Parameters:
ProjectName: transportation-systems-service
DeploymentSsmNamespace: /production
HealthCheckPathName: /transportation-systems/
Listener: !GetAtt ALB.Outputs.Listener
ListenerTls: !GetAtt ALB.Outputs.ListenerTls
ListenerRulePriority: 38
ListenerRuleTlsPriority: 39
Host: service.civicpdx.org
Path: /transportation-systems/*
VPC: !GetAtt VPC.Outputs.VPC
Cluster: !GetAtt ECS.Outputs.Cluster
DesiredCount: 1
ECSTaskExecutionRole: !GetAtt ECS.Outputs.ECSTaskExecutionRole
TaskCpu: 256
TaskMemory: 512
ContainerPort: 8000
SecurityGroup: !GetAtt SecurityGroups.Outputs.ECSTaskSecurityGroup
Subnets: !GetAtt VPC.Outputs.PrivateSubnets
EcrImage: 845828040396.dkr.ecr.us-west-2.amazonaws.com/production/transportation-systems-service:latest
# 2017 API services - Fargate
2017Budget:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: https://s3-us-west-2.amazonaws.com/hacko-infrastructure-cfn/fargate-services/2017-fargate-api.yaml
Parameters:
ProjectName: budget-service
DeploymentSsmNamespace: /production/2017/API
HealthCheckPathName: /budget/
Listener: !GetAtt ALB.Outputs.Listener
ListenerTls: !GetAtt ALB.Outputs.ListenerTls
ListenerRulePriority: 50
ListenerRuleTlsPriority: 51
Host: service.civicpdx.org
Path: /budget*
VPC: !GetAtt VPC.Outputs.VPC
Cluster: !GetAtt ECS.Outputs.Cluster
DesiredCount: 1
ECSTaskExecutionRole: !GetAtt ECS.Outputs.ECSTaskExecutionRole
TaskCpu: 256
TaskMemory: 512
ContainerPort: 8000
SecurityGroup: !GetAtt SecurityGroups.Outputs.ECSTaskSecurityGroup
Subnets: !GetAtt VPC.Outputs.PrivateSubnets
EcrImage: 845828040396.dkr.ecr.us-west-2.amazonaws.com/integration/budget-service:latest
ConfigBucket: hacko-budget-config
DeployTarget: integration
ProjSettingsDir: budget_proj
2017Emergency:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: https://s3-us-west-2.amazonaws.com/hacko-infrastructure-cfn/fargate-services/2017-fargate-api.yaml
Parameters:
ProjectName: emergency-service
DeploymentSsmNamespace: /production/2017/API
HealthCheckPathName: /emergency/
Listener: !GetAtt ALB.Outputs.Listener
ListenerTls: !GetAtt ALB.Outputs.ListenerTls
ListenerRulePriority: 52
ListenerRuleTlsPriority: 53
Host: service.civicpdx.org
Path: /emergency*
VPC: !GetAtt VPC.Outputs.VPC
Cluster: !GetAtt ECS.Outputs.Cluster
DesiredCount: 1
ECSTaskExecutionRole: !GetAtt ECS.Outputs.ECSTaskExecutionRole
TaskCpu: 256
TaskMemory: 512
ContainerPort: 8000
SecurityGroup: !GetAtt SecurityGroups.Outputs.ECSTaskSecurityGroup
Subnets: !GetAtt VPC.Outputs.PrivateSubnets
EcrImage: 845828040396.dkr.ecr.us-west-2.amazonaws.com/integration/emergency-service:latest
ConfigBucket: hacko-emerresponse-config
DeployTarget: integration
ProjSettingsDir: emerresponseAPI
# 2017 API services - EC2-based
HomelessService:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: https://s3-us-west-2.amazonaws.com/hacko-infrastructure-cfn/services/homeless-service/service.yaml
Parameters:
VPC: !GetAtt VPC.Outputs.VPC
Cluster: !GetAtt ECS.Outputs.Cluster
DesiredCount: 2
Listener: !GetAtt ALB.Outputs.Listener
ListenerTls: !GetAtt ALB.Outputs.ListenerTls
ConfigBucket: hacko-homeless-config
DeployTarget: integration
ProjSettingsDir: homelessAPI
Host: service.civicpdx.org
Path: /homeless*
HousingService:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: https://s3-us-west-2.amazonaws.com/hacko-infrastructure-cfn/services/housing-service/service.yaml
Parameters:
VPC: !GetAtt VPC.Outputs.VPC
Cluster: !GetAtt ECS.Outputs.Cluster
DesiredCount: 2
Listener: !GetAtt ALB.Outputs.Listener
ListenerTls: !GetAtt ALB.Outputs.ListenerTls
ConfigBucket: hacko-housing-config
DeployTarget: integration
ProjSettingsDir: housingAPI
Host: service.civicpdx.org
Path: /housing/*
transportService:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: https://s3-us-west-2.amazonaws.com/hacko-infrastructure-cfn/services/transport-service/service.yaml
Parameters:
VPC: !GetAtt VPC.Outputs.VPC
Cluster: !GetAtt ECS.Outputs.Cluster
DesiredCount: 2
Listener: !GetAtt ALB.Outputs.Listener
ListenerTls: !GetAtt ALB.Outputs.ListenerTls
ConfigBucket: hacko-transportation-config
DeployTarget: integration
ProjSettingsDir: transDjango
Host: service.civicpdx.org
Path: /transport/*
Outputs:
# API Endpoint catalog URL
EndpointServiceUrl:
Description: The URL endpoint for the homeless service
Value: !Join [ "/", [ !GetAtt ALB.Outputs.LoadBalancerUrl, "" ]]
# Frontend Application URLs
Civic2017ServiceUrl:
Description: The URL endpoint for the civic2017 service
Value: !Join [ "/", [ !GetAtt ALB.Outputs.LoadBalancerUrl, "2017" ]]
Civic2018ServiceUrl:
Description: The URL endpoint for the civic2018 service
Value: !Join [ "/", [ !GetAtt ALB.Outputs.LoadBalancerUrl, "2018" ]]
Civic2019DisasterGameServiceUrl:
Description: The URL endpoint for the civic2019DisasterGame service
Value: !Join [ "/", [ !GetAtt ALB.Outputs.LoadBalancerUrl, "2019-disaster-game" ]]
# 2018 URLs
2018DRServiceUrl:
Description: The URL endpoint for the 2018 disaster-resilience service
Value: !Join [ "/", [ !GetAtt ALB.Outputs.LoadBalancerUrl, "disaster-resilience" ]]
2018HAServiceUrl:
Description: The URL endpoint for the 2018 housing-affordability service
Value: !Join [ "/", [ !GetAtt ALB.Outputs.LoadBalancerUrl, "housing-affordability" ]]
2018LEServiceUrl:
Description: The URL endpoint for the 2018 local-elections service
Value: !Join [ "/", [ !GetAtt ALB.Outputs.LoadBalancerUrl, "local-elections" ]]
2018NDServiceUrl:
Description: The URL endpoint for the 2018 neighborhood-development service
Value: !Join [ "/", [ !GetAtt ALB.Outputs.LoadBalancerUrl, "neighborhood-development" ]]
2018TSServiceUrl:
Description: The URL endpoint for the 2018 transportation-systems service
Value: !Join [ "/", [ !GetAtt ALB.Outputs.LoadBalancerUrl, "transportation-systems" ]]
# 2017 URLs
BudgetServiceUrl:
Description: The URL endpoint for the homeless service
Value: !Join [ "/", [ !GetAtt ALB.Outputs.LoadBalancerUrl, "budget" ]]
EmerresponeServiceUrl:
Description: The URL endpoint for the homeless service
Value: !Join [ "/", [ !GetAtt ALB.Outputs.LoadBalancerUrl, "emerresponse" ]]
HomelessServiceUrl:
Description: The URL endpoint for the homeless service
Value: !Join [ "/", [ !GetAtt ALB.Outputs.LoadBalancerUrl, "homeless" ]]
HousingServiceUrl:
Description: The URL endpoint for the homeless service
Value: !Join [ "/", [ !GetAtt ALB.Outputs.LoadBalancerUrl, "housing" ]]
transportServiceUrl:
Description: The URL endpoint for the homeless service
Value: !Join [ "/", [ !GetAtt ALB.Outputs.LoadBalancerUrl, "transport" ]]