This repository has been archived by the owner on May 4, 2022. It is now read-only.
forked from aws-samples/aws-refarch-wordpress
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaws-refarch-wordpress-05-route53.yaml
62 lines (54 loc) · 2.18 KB
/
aws-refarch-wordpress-05-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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
---
AWSTemplateFormatVersion: 2010-09-09
Description: Reference Architecture to host WordPress on AWS - Creates Route 53 record set (if selected)
Metadata:
Authors:
Description: Darryl Osborne ([email protected])
License:
Description: 'Copyright 2018 Amazon.com, Inc. and its affiliates. All Rights Reserved.
Licensed under the Amazon Software License (the "License"). You may not use this file
except in compliance with the License. A copy of the License is located at
http://aws.amazon.com/asl/
or in the "license" file accompanying this file. This file is distributed on an "AS IS"
BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitations under the License.'
AWS::CloudFormation::Interface:
ParameterGroups:
- Label:
default: Route 53 Parameters
Parameters:
- WPDomainName
- DnsEndpoint
- DnsHostId
ParameterLabels:
DnsEndpoint:
default: DNS Endpoint
DnsHostId:
default: DNS Host Id
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
DnsHostId:
AllowedPattern: ^[A-Z0-9]{14}$
Description: The DNS host zone id - 'Z2FDTNDATAQYW2' if using CloudFront else Public ELB host zone id.
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 ['', ['www.', !Ref WPDomainName, '.']]
Type: A
AliasTarget:
DNSName: !Ref DnsEndpoint
EvaluateTargetHealth: True
HostedZoneId: !Ref DnsHostId