Skip to content

Commit

Permalink
Remove rule E2504 and add back in E3671 (#3220)
Browse files Browse the repository at this point in the history
* Remove rule E2504 and add back in E3671
* Update rule to E3013 to v1 logic
  • Loading branch information
kddejong authored May 6, 2024
1 parent d15139c commit 71bc75f
Show file tree
Hide file tree
Showing 269 changed files with 59,900 additions and 91,910 deletions.
1 change: 1 addition & 0 deletions scripts/fix_data_files.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env python
"""
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
SPDX-License-Identifier: MIT-0
Expand Down
25 changes: 24 additions & 1 deletion scripts/update_schemas_manually.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@


common_patches = {
"BlockDeviceMapping": {"requiredXor": ["VirtualName", "Ebs", "NoDevice"]},
"BlockDeviceMapping": {
"requiredXor": ["VirtualName", "Ebs", "NoDevice"],
"cfnLint": "",
},
}

patches.extend(
Expand Down Expand Up @@ -75,6 +78,10 @@
values={"requiredXor": ["LaunchTemplateID", "LaunchTemplateName"]},
path="/definitions/LaunchTemplateSpecification",
),
Patch(
values={"pattern": "^ephemeral([0-9]|[1][0-9]|[2][0-3])$"},
path="/definitions/BlockDeviceMapping/properties/VirtualName",
),
Patch(
values={
"dependentExcluded": {
Expand Down Expand Up @@ -708,6 +715,10 @@
values=common_patches.get("BlockDeviceMapping"),
path="/definitions/BlockDeviceMapping",
),
Patch(
values={"pattern": "^ephemeral([0-9]|[1][0-9]|[2][0-3])$"},
path="/definitions/BlockDeviceMapping/properties/VirtualName",
),
Patch(
values={
"requiredXor": [
Expand All @@ -730,6 +741,10 @@
values=common_patches.get("BlockDeviceMapping"),
path="/definitions/BlockDeviceMapping",
),
Patch(
values={"pattern": "^ephemeral([0-9]|[1][0-9]|[2][0-3])$"},
path="/definitions/BlockDeviceMapping/properties/VirtualName",
),
Patch(
values={
"requiredXor": [
Expand Down Expand Up @@ -853,6 +868,10 @@
path="/definitions/BlockDeviceMapping",
values=common_patches.get("BlockDeviceMapping"),
),
Patch(
values={"pattern": "^ephemeral([0-9]|[1][0-9]|[2][0-3])$"},
path="/definitions/BlockDeviceMapping/properties/VirtualName",
),
Patch(
path="/",
values={
Expand Down Expand Up @@ -1280,6 +1299,10 @@
ResourcePatch(
resource_type="AWS::OpsWorks::Instance",
patches=[
Patch(
values={"pattern": "^ephemeral([0-9]|[1][0-9]|[2][0-3])$"},
path="/definitions/BlockDeviceMapping/properties/VirtualName",
),
Patch(
values=common_patches.get("BlockDeviceMapping"),
path="/definitions/BlockDeviceMapping",
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"etag": "\"a28d105c151831cc5180280626141bb0\"", "url": "https://schema.cloudformation.eu-south-1.amazonaws.com/CloudformationSchema.zip"}
{"etag": "\"3dd742de2ec80b745805f5f705447eef\"", "url": "https://schema.cloudformation.eu-south-1.amazonaws.com/CloudformationSchema.zip"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"etag": "\"2f0660e2009f6b00d8766a9928c7c884\"", "url": "https://schema.cloudformation.cn-north-1.amazonaws.com.cn/CloudformationSchema.zip"}
{"etag": "\"e07809d97ffae1441a2a5b2b1e5e866c\"", "url": "https://schema.cloudformation.cn-north-1.amazonaws.com.cn/CloudformationSchema.zip"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"etag": "\"e987e7b1b725a806ec977175723b7758\"", "url": "https://schema.cloudformation.us-gov-east-1.amazonaws.com/CloudformationSchema.zip"}
{"etag": "\"1a3e345c600d71b579d0d82acffd77ca\"", "url": "https://schema.cloudformation.us-gov-east-1.amazonaws.com/CloudformationSchema.zip"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"etag": "\"16faf7f7ee2bf9b671f16907ed752da5\"", "url": "https://schema.cloudformation.me-south-1.amazonaws.com/CloudformationSchema.zip"}
{"etag": "\"a839d54983fe419c855f2caf50942ec2\"", "url": "https://schema.cloudformation.me-south-1.amazonaws.com/CloudformationSchema.zip"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"etag": "\"d1530015ddd8de75f98f6429d2348b19\"", "url": "https://schema.cloudformation.us-gov-west-1.amazonaws.com/CloudformationSchema.zip"}
{"etag": "\"ea42b4f82a56b2e26ac70730d19c2c4e\"", "url": "https://schema.cloudformation.us-gov-west-1.amazonaws.com/CloudformationSchema.zip"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"etag": "\"50991ed57eec9b35aca76b739bdba942\"", "url": "https://schema.cloudformation.me-central-1.amazonaws.com/CloudformationSchema.zip"}
{"etag": "\"962be477eb92934af7da12e651d99acb\"", "url": "https://schema.cloudformation.me-central-1.amazonaws.com/CloudformationSchema.zip"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"etag": "\"335b476b253cf8845cd2d82319517af1\"", "url": "https://schema.cloudformation.eu-west-2.amazonaws.com/CloudformationSchema.zip"}
{"etag": "\"d136292da86d1107fb38944da119a85f\"", "url": "https://schema.cloudformation.eu-west-2.amazonaws.com/CloudformationSchema.zip"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"etag": "\"0df9abdb662a218e7acc5b80cb694d80\"", "url": "https://schema.cloudformation.cn-northwest-1.amazonaws.com.cn/CloudformationSchema.zip"}
{"etag": "\"267889b2ace92a6fbaf41e3133707465\"", "url": "https://schema.cloudformation.cn-northwest-1.amazonaws.com.cn/CloudformationSchema.zip"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"etag": "\"4dbc3b1d393d5657c54b33b7624e465e\"", "url": "https://schema.cloudformation.af-south-1.amazonaws.com/CloudformationSchema.zip"}
{"etag": "\"71176a64c8e68ea6236d454556d1b6f9\"", "url": "https://schema.cloudformation.af-south-1.amazonaws.com/CloudformationSchema.zip"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"etag": "\"2dc564796fc950f2a70169718484f644\"", "url": "https://schema.cloudformation.us-west-1.amazonaws.com/CloudformationSchema.zip"}
{"etag": "\"a3e08ddeb101a55d76c60ff89ba8711d\"", "url": "https://schema.cloudformation.us-west-1.amazonaws.com/CloudformationSchema.zip"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"etag": "\"0400dcb7cf03bd5300c643f276317490\"", "url": "https://schema.cloudformation.eu-central-1.amazonaws.com/CloudformationSchema.zip"}
{"etag": "\"0a9e9a9a0dc6facc824f365f7e5cb16e\"", "url": "https://schema.cloudformation.eu-central-1.amazonaws.com/CloudformationSchema.zip"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"etag": "\"e6ca57fbf262f4058bd8e4e39fd59c7d\"", "url": "https://schema.cloudformation.ap-south-1.amazonaws.com/CloudformationSchema.zip"}
{"etag": "\"6489176dd4bba1d1979c97e698bf6a69\"", "url": "https://schema.cloudformation.ap-south-1.amazonaws.com/CloudformationSchema.zip"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"etag": "\"85c7f8f3fab2e4e4801376c02c1ba68f\"", "url": "https://schema.cloudformation.ap-southeast-4.amazonaws.com/CloudformationSchema.zip"}
{"etag": "\"1b05d262da282d4757cbd937874848a3\"", "url": "https://schema.cloudformation.ap-southeast-4.amazonaws.com/CloudformationSchema.zip"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"etag": "\"bd0f462167a4bba019eef954a321369e\"", "url": "https://schema.cloudformation.us-east-2.amazonaws.com/CloudformationSchema.zip"}
{"etag": "\"faf4cd61db62f89e5e1058a2f7783da6\"", "url": "https://schema.cloudformation.us-east-2.amazonaws.com/CloudformationSchema.zip"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"etag": "\"cc2ccd1ad83ecf92920eb785d76f7029\"", "url": "https://schema.cloudformation.ap-southeast-1.amazonaws.com/CloudformationSchema.zip"}
{"etag": "\"754e501de3902e1de87f2f57e61c4238\"", "url": "https://schema.cloudformation.ap-southeast-1.amazonaws.com/CloudformationSchema.zip"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"etag": "\"952006f25873a9b8a7a484af3fb7bda1\"", "url": "https://schema.cloudformation.ap-northeast-2.amazonaws.com/CloudformationSchema.zip"}
{"etag": "\"a743a3ee9b3692c1bee0317b3f0b740f\"", "url": "https://schema.cloudformation.ap-northeast-2.amazonaws.com/CloudformationSchema.zip"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"etag": "\"02e56a71d2d9c250df2dd024cae1e6b8\"", "url": "https://schema.cloudformation.ap-southeast-3.amazonaws.com/CloudformationSchema.zip"}
{"etag": "\"f1517b109b7dad36b7b0feb350bedf49\"", "url": "https://schema.cloudformation.ap-southeast-3.amazonaws.com/CloudformationSchema.zip"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"etag": "\"309e8b2e3425d77ef67010a6c43da57b\"", "url": "https://schema.cloudformation.ap-east-1.amazonaws.com/CloudformationSchema.zip"}
{"etag": "\"d8c3a5c11e710f4ebb5fe1eee3b3f910\"", "url": "https://schema.cloudformation.ap-east-1.amazonaws.com/CloudformationSchema.zip"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"etag": "\"2df68147099660c918ad0e83dc356419\"", "url": "https://schema.cloudformation.sa-east-1.amazonaws.com/CloudformationSchema.zip"}
{"etag": "\"a3222442280299facfd86f35ef14b6eb\"", "url": "https://schema.cloudformation.sa-east-1.amazonaws.com/CloudformationSchema.zip"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"etag": "\"5e634bc88689a8ab8bce204d0b57660d\"", "url": "https://schema.cloudformation.ap-southeast-2.amazonaws.com/CloudformationSchema.zip"}
{"etag": "\"71ab6babdaa5f43689ee162835b85853\"", "url": "https://schema.cloudformation.ap-southeast-2.amazonaws.com/CloudformationSchema.zip"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"etag": "\"5edcf3854aa5b8f11b6bfee1a4d2746d\"", "url": "https://schema.cloudformation.ca-west-1.amazonaws.com/CloudformationSchema.zip"}
{"etag": "\"d4e4dcbc4dadd679556c86241c1f18e7\"", "url": "https://schema.cloudformation.ca-west-1.amazonaws.com/CloudformationSchema.zip"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"etag": "\"a7a9cb80f014475db63716061156885c\"", "url": "https://schema.cloudformation.eu-central-2.amazonaws.com/CloudformationSchema.zip"}
{"etag": "\"73ebb28713014e7e4b35f52aa06aa1cf\"", "url": "https://schema.cloudformation.eu-central-2.amazonaws.com/CloudformationSchema.zip"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"etag": "\"5e41e68d96eef89d4e61b8ccea19d555\"", "url": "https://schema.cloudformation.eu-north-1.amazonaws.com/CloudformationSchema.zip"}
{"etag": "\"5829d5c557f814a26d5abacb675469b1\"", "url": "https://schema.cloudformation.eu-north-1.amazonaws.com/CloudformationSchema.zip"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"etag": "\"7302690aedc69d50aa211855338d0a3f\"", "url": "https://schema.cloudformation.eu-south-2.amazonaws.com/CloudformationSchema.zip"}
{"etag": "\"e922e755a7c374ef57e65ea76aa9697d\"", "url": "https://schema.cloudformation.eu-south-2.amazonaws.com/CloudformationSchema.zip"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"etag": "\"48d98cdbdc1754d95d1cee26e5f9fc9d\"", "url": "https://schema.cloudformation.ca-central-1.amazonaws.com/CloudformationSchema.zip"}
{"etag": "\"d07b69197a7353b267a1594fd68fe728\"", "url": "https://schema.cloudformation.ca-central-1.amazonaws.com/CloudformationSchema.zip"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"etag": "\"71bb5ad5d3909700aa5473e59c4d4831\"", "url": "https://schema.cloudformation.eu-west-3.amazonaws.com/CloudformationSchema.zip"}
{"etag": "\"5e70338b6fb4db7882d6733dbc0b4299\"", "url": "https://schema.cloudformation.eu-west-3.amazonaws.com/CloudformationSchema.zip"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"etag": "\"6289722dad60968a8b68ff63af49dbbd\"", "url": "https://schema.cloudformation.ap-northeast-3.amazonaws.com/CloudformationSchema.zip"}
{"etag": "\"7b65805e8574450beebe592e34b1bdb5\"", "url": "https://schema.cloudformation.ap-northeast-3.amazonaws.com/CloudformationSchema.zip"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"etag": "\"7b5e4274f2a1b38696dd040579a28410\"", "url": "https://schema.cloudformation.us-west-2.amazonaws.com/CloudformationSchema.zip"}
{"etag": "\"6346217dd69678b380d76a34c8dcd55c\"", "url": "https://schema.cloudformation.us-west-2.amazonaws.com/CloudformationSchema.zip"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"etag": "\"f4835306b0a327ec8aad04c51f0e247f\"", "url": "https://schema.cloudformation.ap-south-2.amazonaws.com/CloudformationSchema.zip"}
{"etag": "\"19942c573883fcd87cea3f49e94563ae\"", "url": "https://schema.cloudformation.ap-south-2.amazonaws.com/CloudformationSchema.zip"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"etag": "\"0e95510b53ab754970ddca008c67c2d4\"", "url": "https://schema.cloudformation.us-east-1.amazonaws.com/CloudformationSchema.zip"}
{"etag": "\"71a2b1013f69978557919514942992d4\"", "url": "https://schema.cloudformation.us-east-1.amazonaws.com/CloudformationSchema.zip"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"etag": "\"2db61544901899a81d8f39d2a550f41e\"", "url": "https://schema.cloudformation.il-central-1.amazonaws.com/CloudformationSchema.zip"}
{"etag": "\"f37045c31ae98236e5d944dd8cec4778\"", "url": "https://schema.cloudformation.il-central-1.amazonaws.com/CloudformationSchema.zip"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"etag": "\"3a0ba04189ee6bc71afa430d7b9086cf\"", "url": "https://schema.cloudformation.eu-west-1.amazonaws.com/CloudformationSchema.zip"}
{"etag": "\"254cb029a9a10edc92a0f8e567da79ca\"", "url": "https://schema.cloudformation.eu-west-1.amazonaws.com/CloudformationSchema.zip"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"etag": "\"c51c693c3184880c5f7a1d1c651adc45\"", "url": "https://schema.cloudformation.ap-northeast-1.amazonaws.com/CloudformationSchema.zip"}
{"etag": "\"7e7cd3bcdd1bcd328f57fb0537babc79\"", "url": "https://schema.cloudformation.ap-northeast-1.amazonaws.com/CloudformationSchema.zip"}
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"allOf": [
{
"if": {
"properties": {
"VolumeType": {
"enum": [
"io1",
"io2"
],
"type": "string"
}
},
"required": [
"VolumeType"
]
},
"then": {
"required": [
"Iops"
]
}
},
{
"if": {
"properties": {
"VolumeType": {
"enum": [
"gp2",
"st1",
"sc1",
"standard"
],
"type": "string"
}
},
"required": [
"VolumeType"
]
},
"then": {
"properties": {
"Iops": false
}
}
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@
"LaunchTemplateName"
]
},
{
"op": "add",
"path": "/definitions/BlockDeviceMapping/properties/VirtualName/pattern",
"value": "^ephemeral([0-9]|[1][0-9]|[2][0-3])$"
},
{
"op": "add",
"path": "/dependentExcluded",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[
{
"op": "add",
"path": "/definitions/BlockDevice/cfnLint",
"value": [
"AWS::AutoScaling::LaunchConfiguration/Properties/BlockDeviceMappings/Ebs"
]
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[
{
"op": "add",
"path": "/definitions/DistributionConfig/properties/Aliases/items/cfnLint",
"value": [
"AWS::CloudFront::Distribution/Properties/DistributionConfig/Aliases/Alias"
]
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@
"AWS::EC2::Instance/Properties/InstanceType"
]
},
{
"op": "add",
"path": "/definitions/Ebs/cfnLint",
"value": [
"AWS::EC2::Instance/Properties/BlockDeviceMappings/Ebs"
]
},
{
"op": "add",
"path": "/properties/AvailabilityZone/cfnLint",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
"NoDevice"
]
},
{
"op": "add",
"path": "/definitions/BlockDeviceMapping/properties/VirtualName/pattern",
"value": "^ephemeral([0-9]|[1][0-9]|[2][0-3])$"
},
{
"op": "add",
"path": "/requiredXor",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,12 @@
"value": [
"AWS::EC2::LaunchTemplate/LaunchTemplateData/Placement/AvailabilityZone"
]
},
{
"op": "add",
"path": "/definitions/Ebs/cfnLint",
"value": [
"AWS::EC2::LaunchTemplate/Properties/BlockDeviceMappings/Ebs"
]
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
"NoDevice"
]
},
{
"op": "add",
"path": "/definitions/BlockDeviceMapping/properties/VirtualName/pattern",
"value": "^ephemeral([0-9]|[1][0-9]|[2][0-3])$"
},
{
"op": "add",
"path": "/definitions/LaunchTemplateData/requiredXor",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,12 @@
"value": [
"AWS::EC2::SpotFleet/Properties/SpotFleetRequestConfigData/IamFleetRole"
]
},
{
"op": "add",
"path": "/definitions/EbsBlockDevice/cfnLint",
"value": [
"AWS::EC2::SpotFleet/Properties/BlockDeviceMappings/Ebs"
]
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
"NoDevice"
]
},
{
"op": "add",
"path": "/definitions/BlockDeviceMapping/properties/VirtualName/pattern",
"value": "^ephemeral([0-9]|[1][0-9]|[2][0-3])$"
},
{
"op": "add",
"path": "/requiredXor",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,12 @@
"value": [
"AWS::OpsWorks::Instance/Properties/AvailabilityZone"
]
},
{
"op": "add",
"path": "/definitions/EbsBlockDevice/cfnLint",
"value": [
"AWS::OpsWorks::Instance/Properties/BlockDeviceMappings/Ebs"
]
}
]
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
[
{
"op": "add",
"path": "/definitions/BlockDeviceMapping/properties/VirtualName/pattern",
"value": "^ephemeral([0-9]|[1][0-9]|[2][0-3])$"
},
{
"op": "add",
"path": "/definitions/BlockDeviceMapping/requiredXor",
Expand Down
Loading

0 comments on commit 71bc75f

Please sign in to comment.