forked from aws-cloudformation/cfn-lint
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathroute53.yaml
179 lines (179 loc) · 6.12 KB
/
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
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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
AWSTemplateFormatVersion: "2010-09-09"
Description: "Route53 resources"
Parameters:
DomainName:
Type: String
Default: "www.example.com"
AliasTarget:
Type: String
Default: "a1bcde2f3ghij4.cloudfront.net"
CloudFrontStaticZoneId:
Type: String
Default: "Z2FDTNDATAQYW2" # https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53-aliastarget-1.html#cfn-route53-aliastarget-hostedzoneid
Conditions:
isPrimaryRegion: !Equals [!Ref 'AWS::Region', 'us-east-1']
Resources:
MyHostedZone:
Type: "AWS::Route53::HostedZone"
Properties:
Name: !Ref "DomainName"
VPCs:
- VPCId: !ImportValue "infrastructure-vpc"
VPCRegion: AWS::Region
MyTXTRecordSet:
Type: "AWS::Route53::RecordSet"
Properties:
Comment: "Invalid TXT Record"
HostedZoneId: !Ref "MyHostedZone"
Name: "x.example.com"
Type: "TXT"
TTL: "300"
ResourceRecords:
- '"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"' # 256 "a" characters - too long
- '"a""bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"' # 256 "b" characters in a second record - too long
- "\"MS=ms123123\""
- "test2" # No quotation
MyARecordSet:
Type: "AWS::Route53::RecordSet"
Properties:
Comment: "Invalid A Record"
HostedZoneId: !Ref "MyHostedZone"
Name: "www.example.com"
Type: "A"
TTL: "300"
ResourceRecords:
- "127.0.0.1"
MyAAAARecordSet:
Type: "AWS::Route53::RecordSet"
Properties:
Comment: "Invalid AAAA Record"
HostedZoneId: !Ref "MyHostedZone"
Name: "www.example.com"
Type: "AAAA"
TTL: "300"
ResourceRecords:
- "127.0.0.1" # IPv4 address
- "XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:1.2.3.4" # Invalid data
- "2001:0db8: 85a3:0:0:8a2e:0370:7334" # Spaces
- "1111:2222:3333:4444:5555:6666:7777" # Missing components
- "1111:2222:3333:4444:5555:6666:7777:8888::" # Too much components
MyCAARecordSet:
Type: "AWS::Route53::RecordSet"
Properties:
Comment: "Invalid CAA Record"
HostedZoneId: !Ref "MyHostedZone"
Name: "www.example.com"
Type: "CAA"
TTL: "300"
ResourceRecords:
- "127.0.0.1" # No 3 items
- "0 issue amazon.com; henk" # Missing quotes around the value
MyCNAMERecordSet:
Type: "AWS::Route53::RecordSet"
Properties:
Comment: "Invalid CNAME Record"
HostedZoneId: !Ref "MyHostedZone"
Name: "cname.example.com"
Type: "CNAME"
TTL: "300"
ResourceRecords: # Multiple records
- "cname1.example.com"
- "cname2.example.com"
MyCNAMERecordSetConditions:
Type: "AWS::Route53::RecordSet"
Properties:
Comment: "Invalid CNAME Record"
HostedZoneId: !Ref "MyHostedZone"
Name: "cname.example.com"
Type: "CNAME"
TTL: "300"
ResourceRecords: # Multiple records
Fn::If:
- isPrimaryRegion
- - "cname1.example.com"
- "cname2.example.com"
- - "cname1.example.com"
MyMXRecordSet:
Type: "AWS::Route53::RecordSet"
Properties:
HostedZoneId: !Ref "MyHostedZone"
Name: "example.com."
Type: "MX"
TTL: "300"
ResourceRecords:
- "127.0.0.1"
- "10 my domain"
MyAliasRecordSet:
Type: "AWS::Route53::RecordSet"
Properties:
Comment: "Invalid Alias A Record"
HostedZoneId: !Ref "MyHostedZone"
Name: "alias.example.com"
Type: "A"
TTL: "300" # TTL not allowed on Alias
AliasTarget:
DNSName: !Ref "AliasTarget"
EvaluateTargetHealth: false
HostedZoneId: !Ref "CloudFrontStaticZoneId"
MyRecordSetGroup:
Type: "AWS::Route53::RecordSetGroup"
Properties:
HostedZoneId: !Ref "MyHostedZone"
RecordSets:
- Name: "y.example.com"
Type: "TXT"
TTL: "300"
ResourceRecords:
- "test4" # No quotation
- Name: "www1.example.com"
Type: "A"
TTL: "300"
ResourceRecords:
- "a.example.com" # No IPv4 address
- Name: "www1.example.com"
Type: "AAAA"
TTL: "300"
ResourceRecords:
- "1111:2222:3333:4444:55556666:7777:8888" # Mssing :
- "1111:2222:3333:4444:5555:6666:7777:8888:" # Missing : intended for ::
- "1111:2222:3333:::5555:6666:7777:8888" # :::
- "1111::3333:4444:5555::7777:8888" # Double ::
- "::1.2.3." # Missing parts
- ":1111:2222:3333:4444:5555::7777:8888" # Extra : in front
- Name: "www2.example.com"
Type: "A"
TTL: "300"
ResourceRecords:
- "127.0.0.1 " # Spaces
- Name: "www3.example.com"
Type: "A"
TTL: "300"
ResourceRecords:
- "256.10.1.256" # Invalid values
- Name: "www.example.com"
Type: "CAA"
TTL: "300"
ResourceRecords:
- "1 issue \"amazon.com; example.com\"" # Invalid flag
- "A issue \"amazon.com; example.com\"" # Invalid flag
- "0 special-value \"amazon.com\"" # Invalid tag (not numeric)
- Name: "cname.example.com"
Type: "CNAME"
TTL: "300"
ResourceRecords:
- "No valid domain name" # No valid domain name
- Name: "example.com."
Type: "MX"
TTL: "300"
ResourceRecords:
- "mx1.example.com"
- "65536 mx2.example.com"
PoorlyConfiguredRoute53:
Type: "AWS::Route53::RecordSetGroup"
Properties:
HostedZoneId: !Ref "MyHostedZone"
RecordSets:
- Name: "z.example.com"
Type: "TXT"
TTL: "300"
# Missing AliasTarget and ResourceRecords. Don't fail