Skip to content

Commit aa1d0e8

Browse files
authored
Fix EC2 Subnet allowing ipv6 only (#3969)
1 parent 362a393 commit aa1d0e8

File tree

25 files changed

+288
-265
lines changed

25 files changed

+288
-265
lines changed

scripts/update_schemas_manually.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -1645,14 +1645,21 @@
16451645
patches=[
16461646
Patch(
16471647
values={
1648-
"requiredXor": ["CidrBlock", "Ipv4IpamPoolId"],
1648+
"requiredXor": [
1649+
"CidrBlock",
1650+
"Ipv4IpamPoolId",
1651+
"Ipv6IpamPoolId",
1652+
"Ipv6CidrBlock",
1653+
],
16491654
"dependentExcluded": {
16501655
"AvailabilityZone": ["AvailabilityZoneId"],
16511656
"AvailabilityZoneId": ["AvailabilityZone"],
16521657
},
16531658
"dependentRequired": {
16541659
"Ipv4IpamPoolId": ["Ipv4NetmaskLength"],
16551660
"Ipv4NetmaskLength": ["Ipv4IpamPoolId"],
1661+
"Ipv6IpamPoolId": ["Ipv6NetmaskLength"],
1662+
"Ipv6NetmaskLength": ["Ipv6IpamPoolId"],
16561663
},
16571664
},
16581665
path="/",
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
[
22
{
33
"op": "add",
4-
"path": "/properties/HealthCheckType/enum",
4+
"path": "/requiredXor",
55
"value": [
6-
"EBS",
7-
"EC2",
8-
"ELB",
9-
"VPC_LATTICE"
6+
"InstanceId",
7+
"LaunchConfigurationName",
8+
"LaunchTemplate",
9+
"MixedInstancesPolicy"
1010
]
1111
},
1212
{
@@ -19,12 +19,12 @@
1919
},
2020
{
2121
"op": "add",
22-
"path": "/requiredXor",
22+
"path": "/properties/HealthCheckType/enum",
2323
"value": [
24-
"InstanceId",
25-
"LaunchConfigurationName",
26-
"LaunchTemplate",
27-
"MixedInstancesPolicy"
24+
"EBS",
25+
"EC2",
26+
"ELB",
27+
"VPC_LATTICE"
2828
]
2929
}
3030
]

src/cfnlint/data/schemas/patches/extensions/all/aws_cloudfront_distribution/manual.json

+33-33
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,4 @@
11
[
2-
{
3-
"op": "add",
4-
"path": "/definitions/ViewerCertificate/requiredXor",
5-
"value": [
6-
"AcmCertificateArn",
7-
"CloudFrontDefaultCertificate",
8-
"IamCertificateId"
9-
]
10-
},
11-
{
12-
"op": "add",
13-
"path": "/definitions/Origin/dependentExcluded",
14-
"value": {
15-
"CustomOriginConfig": [
16-
"S3OriginConfig"
17-
],
18-
"S3OriginConfig": [
19-
"CustomOriginConfig"
20-
]
21-
}
22-
},
232
{
243
"op": "add",
254
"path": "/definitions/CustomErrorResponse/dependentRequired",
@@ -29,18 +8,6 @@
298
]
309
}
3110
},
32-
{
33-
"op": "add",
34-
"path": "/definitions/ViewerCertificate/dependentRequired",
35-
"value": {
36-
"AcmCertificateArn": [
37-
"SslSupportMethod"
38-
],
39-
"IamCertificateId": [
40-
"SslSupportMethod"
41-
]
42-
}
43-
},
4411
{
4512
"op": "add",
4613
"path": "/definitions/CustomErrorResponse/properties/ErrorCode/enum",
@@ -330,5 +297,38 @@
330297
"ZM",
331298
"ZW"
332299
]
300+
},
301+
{
302+
"op": "add",
303+
"path": "/definitions/Origin/dependentExcluded",
304+
"value": {
305+
"CustomOriginConfig": [
306+
"S3OriginConfig"
307+
],
308+
"S3OriginConfig": [
309+
"CustomOriginConfig"
310+
]
311+
}
312+
},
313+
{
314+
"op": "add",
315+
"path": "/definitions/ViewerCertificate/requiredXor",
316+
"value": [
317+
"AcmCertificateArn",
318+
"CloudFrontDefaultCertificate",
319+
"IamCertificateId"
320+
]
321+
},
322+
{
323+
"op": "add",
324+
"path": "/definitions/ViewerCertificate/dependentRequired",
325+
"value": {
326+
"AcmCertificateArn": [
327+
"SslSupportMethod"
328+
],
329+
"IamCertificateId": [
330+
"SslSupportMethod"
331+
]
332+
}
333333
}
334334
]

src/cfnlint/data/schemas/patches/extensions/all/aws_cloudwatch_alarm/manual.json

+9-9
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,8 @@
3636
},
3737
{
3838
"op": "add",
39-
"path": "/properties/AlarmActions/items/maximum",
40-
"value": 1024
41-
},
42-
{
43-
"op": "add",
44-
"path": "/properties/AlarmActions/items/minimum",
45-
"value": 1
39+
"path": "/definitions/MetricDataQuery/properties/Id/pattern",
40+
"value": "^([a-z])([A-Za-z0-9\\_]*)$"
4641
},
4742
{
4843
"op": "add",
@@ -56,8 +51,13 @@
5651
},
5752
{
5853
"op": "add",
59-
"path": "/definitions/MetricDataQuery/properties/Id/pattern",
60-
"value": "^([a-z])([A-Za-z0-9\\_]*)$"
54+
"path": "/properties/AlarmActions/items/maximum",
55+
"value": 1024
56+
},
57+
{
58+
"op": "add",
59+
"path": "/properties/AlarmActions/items/minimum",
60+
"value": 1
6161
},
6262
{
6363
"op": "add",
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,4 @@
11
[
2-
{
3-
"op": "add",
4-
"path": "/properties/EngineVersion/enum",
5-
"value": [
6-
"3.6.0",
7-
"4.0",
8-
"4.0.0",
9-
"5.0.0"
10-
]
11-
},
122
{
133
"op": "add",
144
"path": "/properties/BackupRetentionPeriod/maximum",
@@ -18,5 +8,15 @@
188
"op": "add",
199
"path": "/properties/BackupRetentionPeriod/minimum",
2010
"value": 1
11+
},
12+
{
13+
"op": "add",
14+
"path": "/properties/EngineVersion/enum",
15+
"value": [
16+
"3.6.0",
17+
"4.0",
18+
"4.0.0",
19+
"5.0.0"
20+
]
2121
}
2222
]

src/cfnlint/data/schemas/patches/extensions/all/aws_dynamodb_table/manual.json

+7-7
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,6 @@
3030
}
3131
]
3232
},
33-
{
34-
"op": "add",
35-
"path": "/definitions/SSESpecification/properties/SSEType/enum",
36-
"value": [
37-
"KMS"
38-
]
39-
},
4033
{
4134
"op": "add",
4235
"path": "/definitions/SSESpecification/dependentRequired",
@@ -45,5 +38,12 @@
4538
"SSEType"
4639
]
4740
}
41+
},
42+
{
43+
"op": "add",
44+
"path": "/definitions/SSESpecification/properties/SSEType/enum",
45+
"value": [
46+
"KMS"
47+
]
4848
}
4949
]

src/cfnlint/data/schemas/patches/extensions/all/aws_ec2_instance/manual.json

+12-12
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,16 @@
11
[
2+
{
3+
"op": "add",
4+
"path": "/dependentExcluded",
5+
"value": {
6+
"NetworkInterfaces": [
7+
"SubnetId"
8+
],
9+
"SubnetId": [
10+
"NetworkInterfaces"
11+
]
12+
}
13+
},
214
{
315
"op": "add",
416
"path": "/definitions/BlockDeviceMapping/requiredXor",
@@ -13,18 +25,6 @@
1325
"path": "/definitions/BlockDeviceMapping/properties/VirtualName/pattern",
1426
"value": "^ephemeral([0-9]|[1][0-9]|[2][0-3])$"
1527
},
16-
{
17-
"op": "add",
18-
"path": "/dependentExcluded",
19-
"value": {
20-
"NetworkInterfaces": [
21-
"SubnetId"
22-
],
23-
"SubnetId": [
24-
"NetworkInterfaces"
25-
]
26-
}
27-
},
2828
{
2929
"op": "add",
3030
"path": "/definitions/NetworkInterface/dependentExcluded",

src/cfnlint/data/schemas/patches/extensions/all/aws_ec2_securitygroup/manual.json

+19-19
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,6 @@
88
]
99
}
1010
},
11-
{
12-
"op": "add",
13-
"path": "/properties/GroupDescription/maxLength",
14-
"value": 255
15-
},
16-
{
17-
"op": "add",
18-
"path": "/properties/GroupDescription/minLength",
19-
"value": 0
20-
},
21-
{
22-
"op": "add",
23-
"path": "/properties/GroupDescription/pattern",
24-
"value": "^([a-z,A-Z,0-9,. _\\-:/()#,@[\\]+=&;\\{\\}!$*])*$"
25-
},
2611
{
2712
"op": "add",
2813
"path": "/definitions/Egress/requiredXor",
@@ -33,6 +18,16 @@
3318
"DestinationPrefixListId"
3419
]
3520
},
21+
{
22+
"op": "add",
23+
"path": "/definitions/Egress/properties/FromPort/minimum",
24+
"value": -1
25+
},
26+
{
27+
"op": "add",
28+
"path": "/definitions/Egress/properties/ToPort/minimum",
29+
"value": -1
30+
},
3631
{
3732
"op": "add",
3833
"path": "/definitions/Ingress/requiredXor",
@@ -56,12 +51,17 @@
5651
},
5752
{
5853
"op": "add",
59-
"path": "/definitions/Egress/properties/FromPort/minimum",
60-
"value": -1
54+
"path": "/properties/GroupDescription/maxLength",
55+
"value": 255
6156
},
6257
{
6358
"op": "add",
64-
"path": "/definitions/Egress/properties/ToPort/minimum",
65-
"value": -1
59+
"path": "/properties/GroupDescription/minLength",
60+
"value": 0
61+
},
62+
{
63+
"op": "add",
64+
"path": "/properties/GroupDescription/pattern",
65+
"value": "^([a-z,A-Z,0-9,. _\\-:/()#,@[\\]+=&;\\{\\}!$*])*$"
6666
}
6767
]

src/cfnlint/data/schemas/patches/extensions/all/aws_ec2_subnet/manual.json

+9-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
"path": "/requiredXor",
55
"value": [
66
"CidrBlock",
7-
"Ipv4IpamPoolId"
7+
"Ipv4IpamPoolId",
8+
"Ipv6IpamPoolId",
9+
"Ipv6CidrBlock"
810
]
911
},
1012
{
@@ -28,6 +30,12 @@
2830
],
2931
"Ipv4NetmaskLength": [
3032
"Ipv4IpamPoolId"
33+
],
34+
"Ipv6IpamPoolId": [
35+
"Ipv6NetmaskLength"
36+
],
37+
"Ipv6NetmaskLength": [
38+
"Ipv6IpamPoolId"
3139
]
3240
}
3341
}
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
[
22
{
33
"op": "add",
4-
"path": "/properties/ReplicasPerNodeGroup/maximum",
5-
"value": 5
4+
"path": "/properties/NumCacheClusters/maximum",
5+
"value": 6
66
},
77
{
88
"op": "add",
9-
"path": "/properties/ReplicasPerNodeGroup/minimum",
10-
"value": 0
9+
"path": "/properties/NumCacheClusters/minimum",
10+
"value": 1
1111
},
1212
{
1313
"op": "add",
14-
"path": "/properties/NumCacheClusters/maximum",
15-
"value": 6
14+
"path": "/properties/ReplicasPerNodeGroup/maximum",
15+
"value": 5
1616
},
1717
{
1818
"op": "add",
19-
"path": "/properties/NumCacheClusters/minimum",
20-
"value": 1
19+
"path": "/properties/ReplicasPerNodeGroup/minimum",
20+
"value": 0
2121
}
2222
]

0 commit comments

Comments
 (0)