forked from thinegan/cloudformation-project1
-
Notifications
You must be signed in to change notification settings - Fork 4
/
webapp-route53.yaml
51 lines (37 loc) · 1.13 KB
/
webapp-route53.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
# Note, You need at least 1 domain and this is not free tier.
# Pricing : https://aws.amazon.com/route53/pricing/
#
---
AWSTemplateFormatVersion: "2010-09-09"
Description: >
This template deploys route53 Setup,
Alias Web Elastic Load Balancer to <domain>
Parameters:
PMWEBDOMAIN:
Description: "A reference to the Webserver FQDN domain name"
Type: "String"
PMHostedZone:
Description: "A reference to the Hosted Zone"
Type: "String"
PMWEBLBDNSName:
Description: "A reference to the Webserver ELB DNS Name"
Type: "String"
PMWEBLBHostedZoneId:
Description: "A reference to the Webserver ELB Hosted Zone ID"
Type: "String"
Resources:
Route53:
Type: "AWS::Route53::RecordSetGroup"
Properties:
HostedZoneName: !Sub "${PMHostedZone}."
Comment: "Zone apex alias targeted to myELB LoadBalancer."
RecordSets:
- Name: !Sub "${PMWEBDOMAIN}."
Type: 'A'
AliasTarget:
HostedZoneId: !Ref "PMWEBLBHostedZoneId"
DNSName: !Ref "PMWEBLBDNSName"
Outputs:
WEBRoute53:
Description: "A reference to the Route53"
Value: !Ref "Route53"