forked from dxctechnology/dxcf-templates
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCommon-PublicGSuiteRecordSets.yaml
135 lines (135 loc) · 4.59 KB
/
Common-PublicGSuiteRecordSets.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
AWSTemplateFormatVersion: 2010-09-09
Description: Common-PublicGSuiteRecordSets Template.
This creates Google G Suite Public RecordSets in a Public HostedZone. These follow a consistent pattern.
Metadata:
AWS::CloudFormation::Interface:
ParameterGroups:
- Label:
default: Stack Dependencies
Parameters:
- PublicHostedZoneStackName
- Label:
default: RecordSet Configuration
Parameters:
- VerificationTXTValue
- UseCustomURLs
ParameterLabels:
PublicHostedZoneStackName:
default: PublicHostedZone Stack Name
VerificationTXTValue:
default: Google G Suite Verification TXT Value
UseCustomURLs:
default: Use Custom URLs
Parameters:
PublicHostedZoneStackName:
Description: Name of the CloudFormation Stack containing the Public HostedZone
Type: String
MaxLength: 64
Default: Production-PublicHostedZone
AllowedPattern: ^[A-Z][-a-zA-Z0-9]*$
ConstraintDescription: must begin with an upper case letter and contain alphanumeric characters and dashes.
VerificationTXTValue:
Description: Value of G Suite Verification TXT Record (without quotes)
Type: String
Default: ''
AllowedPattern: (^$|^google-site-verification=[_A-Za-z0-9]*$)
ConstraintDescription: 'must begin with "google-site-verification=", then consiste of a string of Alphanumeric characters and underscores.'
UseCustomURLs:
Description: Configure Google G Suite Custom URL CNAME RecordSets
Type: String
Default: true
AllowedValues:
- true
- false
ConstraintDescription: must be either true or false.
Conditions:
ConfigureVerificationTXTRecordSet: !Not [ !Equals [ !Ref VerificationTXTValue, '' ]]
ConfigureCustomCNAMERecordSets: !Equals [ !Ref UseCustomURLs, true ]
Resources:
PublicVerificationTXTRecordSet:
Type: AWS::Route53::RecordSet
Properties:
HostedZoneId: !ImportValue
Fn::Sub: ${PublicHostedZoneStackName}-PublicHostedZone
Name: !Sub
- ${PublicDomain}.
- PublicDomain: !ImportValue
Fn::Sub: ${PublicHostedZoneStackName}-PublicDomain
Type: TXT
TTL: 1800
ResourceRecords:
- !Sub '"${VerificationTXTValue}"'
Condition: ConfigureVerificationTXTRecordSet
PublicMXRecordSet:
Type: AWS::Route53::RecordSet
Properties:
HostedZoneId: !ImportValue
Fn::Sub: ${PublicHostedZoneStackName}-PublicHostedZone
Name: !Sub
- ${PublicDomain}.
- PublicDomain: !ImportValue
Fn::Sub: ${PublicHostedZoneStackName}-PublicDomain
Type: MX
TTL: 3600
ResourceRecords:
- 1 ASPMX.L.GOOGLE.COM.
- 5 ALT1.ASPMX.L.GOOGLE.COM.
- 5 ALT2.ASPMX.L.GOOGLE.COM.
- 10 ASPMX2.GOOGLEMAIL.COM.
- 10 ASPMX3.GOOGLEMAIL.COM.
PublicMailCNAMERecordSet:
Type: AWS::Route53::RecordSet
Properties:
HostedZoneId: !ImportValue
Fn::Sub: ${PublicHostedZoneStackName}-PublicHostedZone
Name: !Sub
- mail.${PublicDomain}.
- PublicDomain: !ImportValue
Fn::Sub: ${PublicHostedZoneStackName}-PublicDomain
Type: CNAME
TTL: 3600
ResourceRecords:
- ghs.googlehosted.com.
Condition: ConfigureCustomCNAMERecordSets
PublicCalendarCNAMERecordSet:
Type: AWS::Route53::RecordSet
Properties:
HostedZoneId: !ImportValue
Fn::Sub: ${PublicHostedZoneStackName}-PublicHostedZone
Name: !Sub
- calendar.${PublicDomain}.
- PublicDomain: !ImportValue
Fn::Sub: ${PublicHostedZoneStackName}-PublicDomain
Type: CNAME
TTL: 3600
ResourceRecords:
- ghs.googlehosted.com.
Condition: ConfigureCustomCNAMERecordSets
PublicDriveCNAMERecordSet:
Type: AWS::Route53::RecordSet
Properties:
HostedZoneId: !ImportValue
Fn::Sub: ${PublicHostedZoneStackName}-PublicHostedZone
Name: !Sub
- drive.${PublicDomain}.
- PublicDomain: !ImportValue
Fn::Sub: ${PublicHostedZoneStackName}-PublicDomain
Type: CNAME
TTL: 3600
ResourceRecords:
- ghs.googlehosted.com.
Condition: ConfigureCustomCNAMERecordSets
PublicSitesCNAMERecordSet:
Type: AWS::Route53::RecordSet
Properties:
HostedZoneId: !ImportValue
Fn::Sub: ${PublicHostedZoneStackName}-PublicHostedZone
Name: !Sub
- sites.${PublicDomain}.
- PublicDomain: !ImportValue
Fn::Sub: ${PublicHostedZoneStackName}-PublicDomain
Type: CNAME
TTL: 3600
ResourceRecords:
- ghs.googlehosted.com.
Condition: ConfigureCustomCNAMERecordSets