-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path04-wordpress-route53.yaml
47 lines (39 loc) · 1.31 KB
/
04-wordpress-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
---
AWSTemplateFormatVersion: 2010-09-09
Description: Stack to create Route53
Metadata:
Authors:
Description: https://github.com/lzrocha
AWS::CloudFormation::Interface:
ParameterGroups:
- Label:
default: Route 53 Parameters
Parameters:
- WPDomainName
- DnsEndpoint
ParameterLabels:
DnsEndpoint:
default: DNS Endpoint
WPDomainName:
default: Site Domain
Parameters:
DnsEndpoint:
AllowedPattern: ^(?!http)(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$
Description: The DNS endpoint - CloudFront DNS if using CloudFront else Public ELB DNS name.
Type: String
WPDomainName:
AllowedPattern: ^(?!http)(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$
Description: The main domain name of the WordPress site (e.g. example.com).
Type: String
Resources:
RecordSet:
Type: AWS::Route53::RecordSetGroup
Properties:
HostedZoneName: !Join ['', [!Ref WPDomainName, '.']]
RecordSets:
- Name: !Join ['', [ !Ref WPDomainName, '.']]
Type: A
AliasTarget:
DNSName: !Ref DnsEndpoint
EvaluateTargetHealth: True
HostedZoneId: 'Z2FDTNDATAQYW2'