Skip to content

Commit 2f95fc3

Browse files
authored
Merge pull request #618 from ericzbeard/v-1-20-1
Fixing incorrect schema
2 parents a3e5ece + db2f86f commit 2f95fc3

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

internal/aws/cfn/patch.go

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,9 +180,22 @@ func patchDynamoDBTable(schema *Schema) error {
180180
return nil
181181
}
182182

183-
func patchAEC2VerifiedAccessTrustProvider(schema *Schema) error {
183+
func patchEC2VerifiedAccessTrustProvider(schema *Schema) error {
184184
// This one is apparently a placeholder schema
185185
// Remove the extraneous def that points to itself
186186
delete(schema.Definitions, "SseSpecification")
187187
return nil
188188
}
189+
190+
func patchEC2LaunchTemplate(schema *Schema) error {
191+
// The schema is missing a definition for NetworkPerformanceOptions
192+
// Delete it if the definition is not there (so this works if they add it)
193+
name := "NetworkPerformanceOptions"
194+
if _, ok := schema.Definitions[name]; !ok {
195+
ltd, exists := schema.Definitions["LaunchTemplateData"]
196+
if exists {
197+
delete(ltd.Properties, name)
198+
}
199+
}
200+
return nil
201+
}

internal/aws/cfn/schema.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,9 @@ func (schema *Schema) Patch() error {
9898
case "AWS::DynamoDB::Table":
9999
return patchDynamoDBTable(schema)
100100
case "AWS::EC2::VerifiedAccessTrustProvider":
101-
return patchAEC2VerifiedAccessTrustProvider(schema)
101+
return patchEC2VerifiedAccessTrustProvider(schema)
102+
case "AWS::EC2::LaunchTemplate":
103+
return patchEC2LaunchTemplate(schema)
102104
}
103105
return nil
104106
}

0 commit comments

Comments
 (0)