Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deploy new DNS via CloudFormation #87

Merged
merged 3 commits into from
Sep 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion infrastructure/load-balancers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,14 @@ Outputs:
PublicAlbDnsName:
Value:
!GetAtt LoadBalancer.DNSName

PublicAlbHostname:
Value:
!If [ NoSslCertificate, !Join [ '', [ 'http://', !GetAtt LoadBalancer.DNSName ] ], !Join [ '', [ 'https://', !GetAtt LoadBalancer.DNSName ] ] ]

SslCertificate:
Value:
!If [ SslCertificate, True, False ]
!If [ SslCertificate, True, False ]

CanonicalHostedZoneId:
Value: !GetAtt LoadBalancer.CanonicalHostedZoneID
41 changes: 39 additions & 2 deletions master.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,42 @@ Resources:
SecurityGroup: !GetAtt SecurityGroups.Outputs.ECSHostSecurityGroup
Subnets: !GetAtt VPC.Outputs.PrivateSubnets

#### 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

##### EC2 instances #####

BastionHost:
Expand Down Expand Up @@ -123,8 +159,8 @@ Resources:
DesiredCount: 2
Listener: !GetAtt ALB.Outputs.Listener
ListenerTls: !GetAtt ALB.Outputs.ListenerTls
Host: 2017.civicpdx.org
Host2: civicpdx.org
Host: 2017.civicplatform.org
Host2: www.civicpdx.org
Path: /*

Civic2018Service:
Expand All @@ -138,6 +174,7 @@ Resources:
Listener: !GetAtt ALB.Outputs.Listener
ListenerTls: !GetAtt ALB.Outputs.ListenerTls
Host: civicplatform.org
# Host2: www.civicplatform.org
Path: /*

# 2019 API services - Fargate
Expand Down