From 5e4dca2c0429b2a4fb8723c282565a0481e29c0a Mon Sep 17 00:00:00 2001 From: Rico Huijbers Date: Fri, 22 Apr 2022 21:34:58 +0200 Subject: [PATCH 1/2] fix(imagebuilder): revert property field typings 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) --- .../000_official/000_AWS_ImageBuilder.json | 71 +------------------ 1 file changed, 2 insertions(+), 69 deletions(-) diff --git a/packages/@aws-cdk/cfnspec/spec-source/specification/000_cfn/000_official/000_AWS_ImageBuilder.json b/packages/@aws-cdk/cfnspec/spec-source/specification/000_cfn/000_official/000_AWS_ImageBuilder.json index cee37571bafe6..5b88d2f314351 100644 --- a/packages/@aws-cdk/cfnspec/spec-source/specification/000_cfn/000_official/000_AWS_ImageBuilder.json +++ b/packages/@aws-cdk/cfnspec/spec-source/specification/000_cfn/000_official/000_AWS_ImageBuilder.json @@ -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": { From 2bfd4d8840a2445235a8c2c3e9778c76c13c38ba Mon Sep 17 00:00:00 2001 From: Rico Huijbers Date: Fri, 22 Apr 2022 22:24:36 +0200 Subject: [PATCH 2/2] chore(release): 2.21.1 --- CHANGELOG.v2.alpha.md | 2 ++ CHANGELOG.v2.md | 7 +++++++ version.v2.json | 4 ++-- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.v2.alpha.md b/CHANGELOG.v2.alpha.md index 3d9982145a276..a6ffeb593208a 100644 --- a/CHANGELOG.v2.alpha.md +++ b/CHANGELOG.v2.alpha.md @@ -2,6 +2,8 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +## [2.21.1-alpha.0](https://github.com/aws/aws-cdk/compare/v2.21.0-alpha.0...v2.21.1-alpha.0) (2022-04-22) + ## [2.21.0-alpha.0](https://github.com/aws/aws-cdk/compare/v2.20.0-alpha.0...v2.21.0-alpha.0) (2022-04-22) diff --git a/CHANGELOG.v2.md b/CHANGELOG.v2.md index 8b7b5ed4e8952..06f60439585f6 100644 --- a/CHANGELOG.v2.md +++ b/CHANGELOG.v2.md @@ -2,6 +2,13 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +## [2.21.1](https://github.com/aws/aws-cdk/compare/v2.21.0...v2.21.1) (2022-04-22) + + +### Bug Fixes + +* **imagebuilder:** revert property field typings ([5e4dca2](https://github.com/aws/aws-cdk/commit/5e4dca2c0429b2a4fb8723c282565a0481e29c0a)) + ## [2.21.0](https://github.com/aws/aws-cdk/compare/v2.20.0...v2.21.0) (2022-04-22) diff --git a/version.v2.json b/version.v2.json index 98294137e7be3..dfe0b9652e96b 100644 --- a/version.v2.json +++ b/version.v2.json @@ -1,4 +1,4 @@ { - "version": "2.21.0", - "alphaVersion": "2.21.0-alpha.0" + "version": "2.21.1", + "alphaVersion": "2.21.1-alpha.0" } \ No newline at end of file