diff --git a/internal/aws/cfn/patch.go b/internal/aws/cfn/patch.go index 0dc6f5de..2b42e3a8 100644 --- a/internal/aws/cfn/patch.go +++ b/internal/aws/cfn/patch.go @@ -180,9 +180,22 @@ func patchDynamoDBTable(schema *Schema) error { return nil } -func patchAEC2VerifiedAccessTrustProvider(schema *Schema) error { +func patchEC2VerifiedAccessTrustProvider(schema *Schema) error { // This one is apparently a placeholder schema // Remove the extraneous def that points to itself delete(schema.Definitions, "SseSpecification") return nil } + +func patchEC2LaunchTemplate(schema *Schema) error { + // The schema is missing a definition for NetworkPerformanceOptions + // Delete it if the definition is not there (so this works if they add it) + name := "NetworkPerformanceOptions" + if _, ok := schema.Definitions[name]; !ok { + ltd, exists := schema.Definitions["LaunchTemplateData"] + if exists { + delete(ltd.Properties, name) + } + } + return nil +} diff --git a/internal/aws/cfn/schema.go b/internal/aws/cfn/schema.go index 1f28f034..a34f7917 100644 --- a/internal/aws/cfn/schema.go +++ b/internal/aws/cfn/schema.go @@ -98,7 +98,9 @@ func (schema *Schema) Patch() error { case "AWS::DynamoDB::Table": return patchDynamoDBTable(schema) case "AWS::EC2::VerifiedAccessTrustProvider": - return patchAEC2VerifiedAccessTrustProvider(schema) + return patchEC2VerifiedAccessTrustProvider(schema) + case "AWS::EC2::LaunchTemplate": + return patchEC2LaunchTemplate(schema) } return nil }