forked from aws-samples/aws-refarch-wordpress
-
Notifications
You must be signed in to change notification settings - Fork 0
/
aws-refarch-wordpress-05-route53.yaml
57 lines (49 loc) · 1.75 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
---
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.
SPDX-License-Identifier: MIT-0'
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