Skip to content

Commit

Permalink
fix(imagebuilder): revert property field typings
Browse files Browse the repository at this point in the history
Certain fields of the `ImageBuilder` service used to be typed as
`Json` (i.e., arbitrary data).

- In TypeScript, you would pass that data as an object literal with
  *capitalized* properties.
- In Python, you would pass it as a `dict`
- In Java, you would pass it as a `HashMap`
- etc

In the new CloudFormation spec, it is now typed as a struct. This
adds type information that didn't use to be there. CDK now generates
classes for it.

- In TypeScript, you must now pass an object literal with
  *lowercased* properties.
- In Python, you must now pass it as an instance of a class.
- In Java, you must now use a builder to construct the object.

Because of this, adding types to properties is a breaking change to the
L1 layer. If you don't pass the information correctly, an empty object
comes out the other end, probably not rendering what you expected.

This is disastrous for construct libraries that are using L1s, as they
are not in control when users upgrade their libraries but they may all
of a sudden be broken with no recourse. Case in point:
[ParallelCluster3](https://github.com/aws/aws-parallelcluster)
  • Loading branch information
rix0rrr committed Apr 22, 2022
1 parent 3f74a81 commit 5e4dca2
Showing 1 changed file with 2 additions and 69 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,86 +129,19 @@
}
}
},
"AWS::ImageBuilder::DistributionConfiguration.AmiDistributionConfiguration": {
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-imagebuilder-distributionconfiguration-amidistributionconfiguration.html",
"Properties": {
"AmiTags": {
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-imagebuilder-distributionconfiguration-amidistributionconfiguration.html#cfn-imagebuilder-distributionconfiguration-amidistributionconfiguration-amitags",
"PrimitiveItemType": "String",
"Required": false,
"Type": "Map",
"UpdateType": "Mutable"
},
"Description": {
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-imagebuilder-distributionconfiguration-amidistributionconfiguration.html#cfn-imagebuilder-distributionconfiguration-amidistributionconfiguration-description",
"PrimitiveType": "String",
"Required": false,
"UpdateType": "Mutable"
},
"KmsKeyId": {
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-imagebuilder-distributionconfiguration-amidistributionconfiguration.html#cfn-imagebuilder-distributionconfiguration-amidistributionconfiguration-kmskeyid",
"PrimitiveType": "String",
"Required": false,
"UpdateType": "Mutable"
},
"LaunchPermissionConfiguration": {
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-imagebuilder-distributionconfiguration-amidistributionconfiguration.html#cfn-imagebuilder-distributionconfiguration-amidistributionconfiguration-launchpermissionconfiguration",
"Required": false,
"Type": "LaunchPermissionConfiguration",
"UpdateType": "Mutable"
},
"Name": {
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-imagebuilder-distributionconfiguration-amidistributionconfiguration.html#cfn-imagebuilder-distributionconfiguration-amidistributionconfiguration-name",
"PrimitiveType": "String",
"Required": false,
"UpdateType": "Mutable"
},
"TargetAccountIds": {
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-imagebuilder-distributionconfiguration-amidistributionconfiguration.html#cfn-imagebuilder-distributionconfiguration-amidistributionconfiguration-targetaccountids",
"PrimitiveItemType": "String",
"Required": false,
"Type": "List",
"UpdateType": "Mutable"
}
}
},
"AWS::ImageBuilder::DistributionConfiguration.ContainerDistributionConfiguration": {
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-imagebuilder-distributionconfiguration-containerdistributionconfiguration.html",
"Properties": {
"ContainerTags": {
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-imagebuilder-distributionconfiguration-containerdistributionconfiguration.html#cfn-imagebuilder-distributionconfiguration-containerdistributionconfiguration-containertags",
"PrimitiveItemType": "String",
"Required": false,
"Type": "List",
"UpdateType": "Mutable"
},
"Description": {
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-imagebuilder-distributionconfiguration-containerdistributionconfiguration.html#cfn-imagebuilder-distributionconfiguration-containerdistributionconfiguration-description",
"PrimitiveType": "String",
"Required": false,
"UpdateType": "Mutable"
},
"TargetRepository": {
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-imagebuilder-distributionconfiguration-containerdistributionconfiguration.html#cfn-imagebuilder-distributionconfiguration-containerdistributionconfiguration-targetrepository",
"Required": false,
"Type": "TargetContainerRepository",
"UpdateType": "Mutable"
}
}
},
"AWS::ImageBuilder::DistributionConfiguration.Distribution": {
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-imagebuilder-distributionconfiguration-distribution.html",
"Properties": {
"AmiDistributionConfiguration": {
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-imagebuilder-distributionconfiguration-distribution.html#cfn-imagebuilder-distributionconfiguration-distribution-amidistributionconfiguration",
"PrimitiveType": "Json",
"Required": false,
"Type": "AmiDistributionConfiguration",
"UpdateType": "Mutable"
},
"ContainerDistributionConfiguration": {
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-imagebuilder-distributionconfiguration-distribution.html#cfn-imagebuilder-distributionconfiguration-distribution-containerdistributionconfiguration",
"PrimitiveType": "Json",
"Required": false,
"Type": "ContainerDistributionConfiguration",
"UpdateType": "Mutable"
},
"LaunchTemplateConfigurations": {
Expand Down

0 comments on commit 5e4dca2

Please sign in to comment.