Skip to content

Commit

Permalink
chore(release): 2.41.0 (#21955)
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored Sep 7, 2022
2 parents 56ba2ab + 28e080a commit 6ad48a3
Show file tree
Hide file tree
Showing 2,967 changed files with 79,034 additions and 70,241 deletions.
1 change: 1 addition & 0 deletions .gitallowed
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ account: '422531588944'
account: '924023996002'
account: '919366029133' #cn-north-1
account: '919830735681' #cn-northwest-1
account: '909464085924' #ap-southeast-3

# The account IDs of password rotation applications of Serverless Application Repository
# https://docs.aws.amazon.com/secretsmanager/latest/userguide/enable-rotation-rds.html
Expand Down
13 changes: 13 additions & 0 deletions CHANGELOG.v2.alpha.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@

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.41.0-alpha.0](https://github.com/aws/aws-cdk/compare/v2.40.0-alpha.0...v2.41.0-alpha.0) (2022-09-07)


### Features

* **batch:** add propagate tags prop in job definition ([#21904](https://github.com/aws/aws-cdk/issues/21904)) ([1bc4526](https://github.com/aws/aws-cdk/commit/1bc4526261c2fbdd6ce6c371ba1d9da2f79e07bd)), closes [#21740](https://github.com/aws/aws-cdk/issues/21740)


### Bug Fixes

* **lambda-python:** bundling with poetry is broken ([#21945](https://github.com/aws/aws-cdk/issues/21945)) ([4b37157](https://github.com/aws/aws-cdk/commit/4b37157b47ab38124b62649649d0df9b701cb7fe)), closes [#21867](https://github.com/aws/aws-cdk/issues/21867)
* **lambda-python:** poetry bundling fails on python3.7 ([#21950](https://github.com/aws/aws-cdk/issues/21950)) ([809e1b0](https://github.com/aws/aws-cdk/commit/809e1b0d5dc29be02f95ea4361b6f87f94325f3d))

## [2.40.0-alpha.0](https://github.com/aws/aws-cdk/compare/v2.39.1-alpha.0...v2.40.0-alpha.0) (2022-08-31)


Expand Down
22 changes: 22 additions & 0 deletions CHANGELOG.v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,28 @@

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.41.0](https://github.com/aws/aws-cdk/compare/v2.40.0...v2.41.0) (2022-09-07)


### Features

* **assertions:** add function for verifying the number of matching resource properties ([#21707](https://github.com/aws/aws-cdk/issues/21707)) ([80cb527](https://github.com/aws/aws-cdk/commit/80cb527c01173a060064606b8fe286d5510f145e))
* **custom-resource:** allow AwsCustomResource to be placed in vpc ([#21357](https://github.com/aws/aws-cdk/issues/21357)) ([62d7bf8](https://github.com/aws/aws-cdk/commit/62d7bf83b4bfe6358e86ecf1c332e51a3909bd8a))
* **ec2:** allow private non-nat subnets ([#21699](https://github.com/aws/aws-cdk/issues/21699)) ([e1794e3](https://github.com/aws/aws-cdk/commit/e1794e346c2a04bf8f2e5f63138095a79f512cfe))
* **ecs:** add `maxSwap` and `swappiness` properties to LinuxParameters ([#18703](https://github.com/aws/aws-cdk/issues/18703)) ([08eb1d6](https://github.com/aws/aws-cdk/commit/08eb1d66ae9caa6589c3ee66c4040a4e116adf52)), closes [#18460](https://github.com/aws/aws-cdk/issues/18460)
* **lambda-event-sources:** add kafka consumerGroupId support ([#21791](https://github.com/aws/aws-cdk/issues/21791)) ([b36bc11](https://github.com/aws/aws-cdk/commit/b36bc1146d06c7b9decface9f4ed9edeca61aa56))
* compress aws-cdk-lib tablet file ([#21854](https://github.com/aws/aws-cdk/issues/21854)) ([5a3db2d](https://github.com/aws/aws-cdk/commit/5a3db2d19dc5525bfef568f17fffa09657b6ef21))
* **ecs:** add function for adding secrets to containers after instantiating them ([#21826](https://github.com/aws/aws-cdk/issues/21826)) ([572f781](https://github.com/aws/aws-cdk/commit/572f7815cc5447aac9413b374ebbfd92bfa610a6)), closes [#18959](https://github.com/aws/aws-cdk/issues/18959)


### Bug Fixes

* **aws-cdk:** cdk bootstrap print JSON template when using --json option ([#21852](https://github.com/aws/aws-cdk/issues/21852)) ([7bc3d18](https://github.com/aws/aws-cdk/commit/7bc3d18ff742140a35238af0241b5dc4c2cf73ee)), closes [#21456](https://github.com/aws/aws-cdk/issues/21456) [#21456](https://github.com/aws/aws-cdk/issues/21456)
* **core:** `--debug` doesn't record stack traces ([#21931](https://github.com/aws/aws-cdk/issues/21931)) ([9f2ea45](https://github.com/aws/aws-cdk/commit/9f2ea458609b29a91eb792165be6de596ce1aea9))
* **events:** additional plaintext header are not set on eventbridge connection ([#21857](https://github.com/aws/aws-cdk/issues/21857)) ([f3f4814](https://github.com/aws/aws-cdk/commit/f3f4814b66ef2b0070fb6b25af9f6566bc1783a0))
* **events-targets:** cannot set retry policy to 0 retry attempts ([#21900](https://github.com/aws/aws-cdk/issues/21900)) ([5549f16](https://github.com/aws/aws-cdk/commit/5549f1692270bce06a1d9cde952f9cd23a04204b)), closes [40aws-cdk/aws-events-targets/lib/util.ts#L54-L59](https://github.com/40aws-cdk/aws-events-targets/lib/util.ts/issues/L54-L59) [#21864](https://github.com/aws/aws-cdk/issues/21864)
* **stepfunctions:** cfnSpec breaks definitionSubstitutions prop ([#21887](https://github.com/aws/aws-cdk/issues/21887)) ([3adf841](https://github.com/aws/aws-cdk/commit/3adf84188947eb2fde6171f70d0d9c2dcdb78563)), closes [#21653](https://github.com/aws/aws-cdk/issues/21653)

## [2.40.0](https://github.com/aws/aws-cdk/compare/v2.39.1...v2.40.0) (2022-08-31)


Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@
"devDependencies": {
"@types/prettier": "2.6.0",
"@yarnpkg/lockfile": "^1.1.0",
"cdk-generate-synthetic-examples": "^0.1.16",
"cdk-generate-synthetic-examples": "^0.1.17",
"conventional-changelog-cli": "^2.2.2",
"fs-extra": "^9.1.0",
"graceful-fs": "^4.2.10",
"jest-junit": "^13.2.0",
"jsii-diff": "^1.66.0",
"jsii-pacmak": "^1.66.0",
"jsii-reflect": "^1.66.0",
"jsii-rosetta": "^1.66.0",
"jsii-diff": "^1.67.0",
"jsii-pacmak": "^1.67.0",
"jsii-reflect": "^1.67.0",
"jsii-rosetta": "^1.67.0",
"lerna": "^4.0.0",
"patch-package": "^6.4.7",
"semver": "^6.3.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"version": "17.0.0",
"version": "20.0.0",
"files": {
"df2531bee6d1a5c15a480c358ebc18e306c13a2c9e3ee55d1116b6ef3c327f34": {
"4844d07f1e19de1a0f6926b94b9bc19bf4e39bbb14b8511dee5d345f776182c7": {
"source": {
"path": "CICD.template.json",
"packaging": "file"
},
"destinations": {
"current_account-current_region": {
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
"objectKey": "df2531bee6d1a5c15a480c358ebc18e306c13a2c9e3ee55d1116b6ef3c327f34.json",
"objectKey": "4844d07f1e19de1a0f6926b94b9bc19bf4e39bbb14b8511dee5d345f776182c7.json",
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -468,5 +468,39 @@
]
}
}
},
"Parameters": {
"BootstrapVersion": {
"Type": "AWS::SSM::Parameter::Value<String>",
"Default": "/cdk-bootstrap/hnb659fds/version",
"Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]"
}
},
"Rules": {
"CheckBootstrapVersion": {
"Assertions": [
{
"Assert": {
"Fn::Not": [
{
"Fn::Contains": [
[
"1",
"2",
"3",
"4",
"5"
],
{
"Ref": "BootstrapVersion"
}
]
}
]
},
"AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI."
}
]
}
}
}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"version":"17.0.0"}
{"version":"20.0.0"}
Original file line number Diff line number Diff line change
@@ -1,19 +1,43 @@
{
"version": "17.0.0",
"version": "20.0.0",
"artifacts": {
"Tree": {
"type": "cdk:tree",
"properties": {
"file": "tree.json"
}
},
"CICD.assets": {
"type": "cdk:asset-manifest",
"properties": {
"file": "CICD.assets.json",
"requiresBootstrapStackVersion": 6,
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version"
}
},
"CICD": {
"type": "aws:cloudformation:stack",
"environment": "aws://unknown-account/unknown-region",
"properties": {
"templateFile": "CICD.template.json",
"validateOnSynth": false
"validateOnSynth": false,
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}",
"cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}",
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/4844d07f1e19de1a0f6926b94b9bc19bf4e39bbb14b8511dee5d345f776182c7.json",
"requiresBootstrapStackVersion": 6,
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version",
"additionalDependencies": [
"CICD.assets"
],
"lookupRole": {
"arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}",
"requiresBootstrapStackVersion": 8,
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version"
}
},
"dependencies": [
"CICD.assets"
],
"metadata": {
"/CICD/ArtifactBucket/Resource": [
{
Expand Down Expand Up @@ -74,6 +98,18 @@
"type": "aws:cdk:logicalId",
"data": "CodePipelineDeployChangeSetRoleDefaultPolicy289820BE"
}
],
"/CICD/BootstrapVersion": [
{
"type": "aws:cdk:logicalId",
"data": "BootstrapVersion"
}
],
"/CICD/CheckBootstrapVersion": [
{
"type": "aws:cdk:logicalId",
"data": "CheckBootstrapVersion"
}
]
},
"displayName": "CICD"
Expand Down
24 changes: 12 additions & 12 deletions packages/@aws-cdk/app-delivery/test/cicd.integ.snapshot/tree.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"path": "Tree",
"constructInfo": {
"fqn": "constructs.Construct",
"version": "10.0.9"
"version": "10.1.85"
}
},
"CICD": {
Expand Down Expand Up @@ -288,13 +288,13 @@
"path": "CICD/CodePipeline/Source/GitHub",
"constructInfo": {
"fqn": "constructs.Construct",
"version": "10.0.9"
"version": "10.1.85"
}
}
},
"constructInfo": {
"fqn": "constructs.Construct",
"version": "10.0.9"
"version": "10.1.85"
}
},
"Deploy": {
Expand Down Expand Up @@ -354,7 +354,7 @@
"path": "CICD/CodePipeline/Deploy/Execute/CodePipelineActionRole/8389e75f-0810-4838-bf64-d6f85a95cf83",
"constructInfo": {
"fqn": "constructs.Construct",
"version": "10.0.9"
"version": "10.1.85"
}
},
"DefaultPolicy": {
Expand Down Expand Up @@ -433,7 +433,7 @@
},
"constructInfo": {
"fqn": "constructs.Construct",
"version": "10.0.9"
"version": "10.1.85"
}
},
"ChangeSet": {
Expand Down Expand Up @@ -489,7 +489,7 @@
"path": "CICD/CodePipeline/Deploy/ChangeSet/CodePipelineActionRole/8389e75f-0810-4838-bf64-d6f85a95cf83",
"constructInfo": {
"fqn": "constructs.Construct",
"version": "10.0.9"
"version": "10.1.85"
}
},
"DefaultPolicy": {
Expand Down Expand Up @@ -708,13 +708,13 @@
},
"constructInfo": {
"fqn": "constructs.Construct",
"version": "10.0.9"
"version": "10.1.85"
}
}
},
"constructInfo": {
"fqn": "constructs.Construct",
"version": "10.0.9"
"version": "10.1.85"
}
}
},
Expand All @@ -725,14 +725,14 @@
}
},
"constructInfo": {
"fqn": "@aws-cdk/core.Stack",
"version": "0.0.0"
"fqn": "constructs.Construct",
"version": "10.1.85"
}
}
},
"constructInfo": {
"fqn": "@aws-cdk/core.App",
"version": "0.0.0"
"fqn": "constructs.Construct",
"version": "10.1.85"
}
}
}
11 changes: 11 additions & 0 deletions packages/@aws-cdk/assertions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,17 @@ in a template.
template.resourceCountIs('Foo::Bar', 2);
```

You can also count the number of resources of a specific type whose `Properties`
section contains the specified properties:

```ts
template.resourcePropertiesCountIs('Foo::Bar', {
Foo: 'Bar',
Baz: 5,
Qux: [ 'Waldo', 'Fred' ],
}, 1);
```

## Resource Matching & Retrieval

Beyond resource counting, the module also allows asserting that a resource with
Expand Down
26 changes: 24 additions & 2 deletions packages/@aws-cdk/assertions/lib/private/resources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,12 @@ export function hasResource(template: Template, type: string, props: any): strin
}

export function hasResourceProperties(template: Template, type: string, props: any): string | void {
// amended needs to be a deep copy to avoid modifying the template.
let amended = JSON.parse(JSON.stringify(template));
let amended = template;

// special case to exclude AbsentMatch because adding an empty Properties object will affect its evaluation.
if (!Matcher.isMatcher(props) || !(props instanceof AbsentMatch)) {
// amended needs to be a deep copy to avoid modifying the template.
amended = JSON.parse(JSON.stringify(template));
amended = addEmptyProperties(amended);
}

Expand All @@ -52,6 +53,27 @@ export function countResources(template: Template, type: string): number {
return Object.entries(types).length;
}

export function countResourcesProperties(template: Template, type: string, props: any): number {
let amended = template;

// special case to exclude AbsentMatch because adding an empty Properties object will affect its evaluation.
if (!Matcher.isMatcher(props) || !(props instanceof AbsentMatch)) {
// amended needs to be a deep copy to avoid modifying the template.
amended = JSON.parse(JSON.stringify(template));
amended = addEmptyProperties(amended);
}

const section = amended.Resources ?? {};
const result = matchSection(filterType(section, type), Match.objectLike({
Properties: props,
}));

if (result.match) {
return Object.keys(result.matches).length;
}
return 0;
}

function addEmptyProperties(template: Template): Template {
let section = template.Resources ?? {};

Expand Down
16 changes: 15 additions & 1 deletion packages/@aws-cdk/assertions/lib/template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { checkTemplateForCyclicDependencies } from './private/cyclic';
import { findMappings, hasMapping } from './private/mappings';
import { findOutputs, hasOutput } from './private/outputs';
import { findParameters, hasParameter } from './private/parameters';
import { countResources, findResources, hasResource, hasResourceProperties } from './private/resources';
import { countResources, countResourcesProperties, findResources, hasResource, hasResourceProperties } from './private/resources';
import { Template as TemplateType } from './private/template';

/**
Expand Down Expand Up @@ -71,6 +71,20 @@ export class Template {
}
}

/**
* Assert that the given number of resources of the given type and properties exists in the
* CloudFormation template.
* @param type the resource type; ex: `AWS::S3::Bucket`
* @param props the 'Properties' section of the resource as should be expected in the template.
* @param count number of expected instances
*/
public resourcePropertiesCountIs(type: string, props: any, count: number): void {
const counted = countResourcesProperties(this.template, type, props);
if (counted !== count) {
throw new Error(`Expected ${count} resources of type ${type} but found ${counted}`);
}
}

/**
* Assert that a resource of the given type and properties exists in the
* CloudFormation template.
Expand Down
Loading

0 comments on commit 6ad48a3

Please sign in to comment.