From 01d5533dfa2147287e7ffa8f98ebe9c05f34bbab Mon Sep 17 00:00:00 2001 From: Steven Gubler Date: Fri, 4 Oct 2024 13:54:01 -0600 Subject: [PATCH 1/3] Move requireXor to SpotFleetRequestConfigData Fixes an issue with E3014 when checking AWS::EC2:SpotFleet resources. the original requireXor field had the correct fields but was placed at the root level of the resource instead of on the relevant definition. --- .../schemas/providers/ap_south_2/aws-ec2-spotfleet.json | 8 ++++---- .../providers/ap_southeast_4/aws-ec2-spotfleet.json | 8 ++++---- .../schemas/providers/il_central_1/aws-ec2-spotfleet.json | 8 ++++---- .../schemas/providers/us_east_1/aws-ec2-spotfleet.json | 8 ++++---- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/cfnlint/data/schemas/providers/ap_south_2/aws-ec2-spotfleet.json b/src/cfnlint/data/schemas/providers/ap_south_2/aws-ec2-spotfleet.json index cf6ff407a5..e9f20da329 100644 --- a/src/cfnlint/data/schemas/providers/ap_south_2/aws-ec2-spotfleet.json +++ b/src/cfnlint/data/schemas/providers/ap_south_2/aws-ec2-spotfleet.json @@ -345,6 +345,10 @@ "ImageId", "InstanceType" ], + "requiredXor": [ + "LaunchSpecifications", + "LaunchTemplateConfigs" + ], "type": "object" }, "SpotFleetMonitoring": { @@ -536,9 +540,5 @@ "required": [ "SpotFleetRequestConfigData" ], - "requiredXor": [ - "LaunchSpecifications", - "LaunchTemplateConfigs" - ], "typeName": "AWS::EC2::SpotFleet" } diff --git a/src/cfnlint/data/schemas/providers/ap_southeast_4/aws-ec2-spotfleet.json b/src/cfnlint/data/schemas/providers/ap_southeast_4/aws-ec2-spotfleet.json index cf6ff407a5..a7e66afdc0 100644 --- a/src/cfnlint/data/schemas/providers/ap_southeast_4/aws-ec2-spotfleet.json +++ b/src/cfnlint/data/schemas/providers/ap_southeast_4/aws-ec2-spotfleet.json @@ -428,6 +428,10 @@ "type": "string" } }, + "requiredXor": [ + "LaunchSpecifications", + "LaunchTemplateConfigs" + ], "required": [ "IamFleetRole", "TargetCapacity" @@ -536,9 +540,5 @@ "required": [ "SpotFleetRequestConfigData" ], - "requiredXor": [ - "LaunchSpecifications", - "LaunchTemplateConfigs" - ], "typeName": "AWS::EC2::SpotFleet" } diff --git a/src/cfnlint/data/schemas/providers/il_central_1/aws-ec2-spotfleet.json b/src/cfnlint/data/schemas/providers/il_central_1/aws-ec2-spotfleet.json index cf6ff407a5..e9f20da329 100644 --- a/src/cfnlint/data/schemas/providers/il_central_1/aws-ec2-spotfleet.json +++ b/src/cfnlint/data/schemas/providers/il_central_1/aws-ec2-spotfleet.json @@ -345,6 +345,10 @@ "ImageId", "InstanceType" ], + "requiredXor": [ + "LaunchSpecifications", + "LaunchTemplateConfigs" + ], "type": "object" }, "SpotFleetMonitoring": { @@ -536,9 +540,5 @@ "required": [ "SpotFleetRequestConfigData" ], - "requiredXor": [ - "LaunchSpecifications", - "LaunchTemplateConfigs" - ], "typeName": "AWS::EC2::SpotFleet" } diff --git a/src/cfnlint/data/schemas/providers/us_east_1/aws-ec2-spotfleet.json b/src/cfnlint/data/schemas/providers/us_east_1/aws-ec2-spotfleet.json index 2a0164a22c..2b09ab5669 100644 --- a/src/cfnlint/data/schemas/providers/us_east_1/aws-ec2-spotfleet.json +++ b/src/cfnlint/data/schemas/providers/us_east_1/aws-ec2-spotfleet.json @@ -764,6 +764,10 @@ "IamFleetRole", "TargetCapacity" ], + "requiredXor": [ + "LaunchSpecifications", + "LaunchTemplateConfigs" + ], "type": "object" }, "SpotFleetTagSpecification": { @@ -946,10 +950,6 @@ "required": [ "SpotFleetRequestConfigData" ], - "requiredXor": [ - "LaunchSpecifications", - "LaunchTemplateConfigs" - ], "typeName": "AWS::EC2::SpotFleet", "writeOnlyProperties": [ "/properties/SpotFleetRequestConfigData/TagSpecifications", From 779274c4b0044741b3d58dfaadf9a167439cf81c Mon Sep 17 00:00:00 2001 From: Kevin DeJong Date: Mon, 7 Oct 2024 16:18:55 -0700 Subject: [PATCH 2/3] Update patching scripts --- scripts/update_schemas_manually.py | 2 +- .../patches/extensions/all/aws_ec2_spotfleet/manual.json | 2 +- .../schemas/providers/ap_south_2/aws-ec2-spotfleet.json | 4 ++++ .../providers/ap_southeast_4/aws-ec2-spotfleet.json | 8 ++++---- .../schemas/providers/il_central_1/aws-ec2-spotfleet.json | 4 ++++ 5 files changed, 14 insertions(+), 6 deletions(-) diff --git a/scripts/update_schemas_manually.py b/scripts/update_schemas_manually.py index 74beb6fdf3..ccd691b26d 100755 --- a/scripts/update_schemas_manually.py +++ b/scripts/update_schemas_manually.py @@ -884,7 +884,7 @@ path="/definitions/BlockDeviceMapping/properties/VirtualName", ), Patch( - path="/", + path="/definitions/SpotFleetRequestConfigData", values={ "requiredXor": ["LaunchSpecifications", "LaunchTemplateConfigs"] }, diff --git a/src/cfnlint/data/schemas/patches/extensions/all/aws_ec2_spotfleet/manual.json b/src/cfnlint/data/schemas/patches/extensions/all/aws_ec2_spotfleet/manual.json index 50b628eb4e..40427842b4 100644 --- a/src/cfnlint/data/schemas/patches/extensions/all/aws_ec2_spotfleet/manual.json +++ b/src/cfnlint/data/schemas/patches/extensions/all/aws_ec2_spotfleet/manual.json @@ -15,7 +15,7 @@ }, { "op": "add", - "path": "/requiredXor", + "path": "/definitions/SpotFleetRequestConfigData/requiredXor", "value": [ "LaunchSpecifications", "LaunchTemplateConfigs" diff --git a/src/cfnlint/data/schemas/providers/ap_south_2/aws-ec2-spotfleet.json b/src/cfnlint/data/schemas/providers/ap_south_2/aws-ec2-spotfleet.json index e9f20da329..610044cc10 100644 --- a/src/cfnlint/data/schemas/providers/ap_south_2/aws-ec2-spotfleet.json +++ b/src/cfnlint/data/schemas/providers/ap_south_2/aws-ec2-spotfleet.json @@ -436,6 +436,10 @@ "IamFleetRole", "TargetCapacity" ], + "requiredXor": [ + "LaunchSpecifications", + "LaunchTemplateConfigs" + ], "type": "object" }, "SpotFleetTagSpecification": { diff --git a/src/cfnlint/data/schemas/providers/ap_southeast_4/aws-ec2-spotfleet.json b/src/cfnlint/data/schemas/providers/ap_southeast_4/aws-ec2-spotfleet.json index a7e66afdc0..d132978064 100644 --- a/src/cfnlint/data/schemas/providers/ap_southeast_4/aws-ec2-spotfleet.json +++ b/src/cfnlint/data/schemas/providers/ap_southeast_4/aws-ec2-spotfleet.json @@ -428,14 +428,14 @@ "type": "string" } }, - "requiredXor": [ - "LaunchSpecifications", - "LaunchTemplateConfigs" - ], "required": [ "IamFleetRole", "TargetCapacity" ], + "requiredXor": [ + "LaunchSpecifications", + "LaunchTemplateConfigs" + ], "type": "object" }, "SpotFleetTagSpecification": { diff --git a/src/cfnlint/data/schemas/providers/il_central_1/aws-ec2-spotfleet.json b/src/cfnlint/data/schemas/providers/il_central_1/aws-ec2-spotfleet.json index e9f20da329..610044cc10 100644 --- a/src/cfnlint/data/schemas/providers/il_central_1/aws-ec2-spotfleet.json +++ b/src/cfnlint/data/schemas/providers/il_central_1/aws-ec2-spotfleet.json @@ -436,6 +436,10 @@ "IamFleetRole", "TargetCapacity" ], + "requiredXor": [ + "LaunchSpecifications", + "LaunchTemplateConfigs" + ], "type": "object" }, "SpotFleetTagSpecification": { From 1672239517998f3898547b4557c5016e4924650b Mon Sep 17 00:00:00 2001 From: Kevin DeJong Date: Mon, 7 Oct 2024 16:25:56 -0700 Subject: [PATCH 3/3] Additional schema fixes --- .../data/schemas/providers/ap_south_2/aws-ec2-spotfleet.json | 4 ---- .../schemas/providers/il_central_1/aws-ec2-spotfleet.json | 4 ---- 2 files changed, 8 deletions(-) diff --git a/src/cfnlint/data/schemas/providers/ap_south_2/aws-ec2-spotfleet.json b/src/cfnlint/data/schemas/providers/ap_south_2/aws-ec2-spotfleet.json index 610044cc10..d132978064 100644 --- a/src/cfnlint/data/schemas/providers/ap_south_2/aws-ec2-spotfleet.json +++ b/src/cfnlint/data/schemas/providers/ap_south_2/aws-ec2-spotfleet.json @@ -345,10 +345,6 @@ "ImageId", "InstanceType" ], - "requiredXor": [ - "LaunchSpecifications", - "LaunchTemplateConfigs" - ], "type": "object" }, "SpotFleetMonitoring": { diff --git a/src/cfnlint/data/schemas/providers/il_central_1/aws-ec2-spotfleet.json b/src/cfnlint/data/schemas/providers/il_central_1/aws-ec2-spotfleet.json index 610044cc10..d132978064 100644 --- a/src/cfnlint/data/schemas/providers/il_central_1/aws-ec2-spotfleet.json +++ b/src/cfnlint/data/schemas/providers/il_central_1/aws-ec2-spotfleet.json @@ -345,10 +345,6 @@ "ImageId", "InstanceType" ], - "requiredXor": [ - "LaunchSpecifications", - "LaunchTemplateConfigs" - ], "type": "object" }, "SpotFleetMonitoring": {