Skip to content

Commit 64f92d6

Browse files
authored
Merge branch 'master' into master
2 parents d77c599 + b2b234a commit 64f92d6

File tree

217 files changed

+5108
-5258
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

217 files changed

+5108
-5258
lines changed

CHANGELOG.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,61 @@
22

33
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.
44

5+
## [1.140.0](https://github.com/aws/aws-cdk/compare/v1.139.0...v1.140.0) (2022-01-20)
6+
7+
8+
### ⚠ BREAKING CHANGES TO EXPERIMENTAL FEATURES
9+
10+
* **apigatewayv2:** `HttpIntegrationType.LAMBDA_PROXY` has been renamed to `HttpIntegrationType.AWS_PROXY`
11+
* **iot:** the class `FirehoseStreamAction` has been renamed to `FirehosePutRecordAction`
12+
13+
### Features
14+
15+
* **apigatewayv2:** HttpRouteIntegration supports AWS services integrations ([#18154](https://github.com/aws/aws-cdk/issues/18154)) ([a8094c7](https://github.com/aws/aws-cdk/commit/a8094c7d9970557077f560ccd24882216094ee3c)), closes [#16287](https://github.com/aws/aws-cdk/issues/16287)
16+
* **apigatewayv2:** support for mock integration type ([#18129](https://github.com/aws/aws-cdk/issues/18129)) ([7779c14](https://github.com/aws/aws-cdk/commit/7779c147c7445d9e8ccafa9b732521c9021a6234)), closes [#15008](https://github.com/aws/aws-cdk/issues/15008)
17+
* **apigatewayv2:** websocket api: api keys ([#16636](https://github.com/aws/aws-cdk/issues/16636)) ([24f8f74](https://github.com/aws/aws-cdk/commit/24f8f74ebec023f5e3f5bd2bdfc89575a53b38f3))
18+
* **assertions:** `stringLikeRegexp()` matcher ([#18491](https://github.com/aws/aws-cdk/issues/18491)) ([b49b002](https://github.com/aws/aws-cdk/commit/b49b002e40f5b901935f52827f417bb3851badc2))
19+
* **assertions:** support for parameters ([#18469](https://github.com/aws/aws-cdk/issues/18469)) ([d0d6fc5](https://github.com/aws/aws-cdk/commit/d0d6fc520491351b44cac78aa90284c82a9499b2)), closes [#16720](https://github.com/aws/aws-cdk/issues/16720)
20+
* **aws-neptune:** add autoMinorVersionUpgrade to cluster props ([#18394](https://github.com/aws/aws-cdk/issues/18394)) ([8b5320a](https://github.com/aws/aws-cdk/commit/8b5320ac5e5c320db46bc74f33b3841977dd3a5d)), closes [#17545](https://github.com/aws/aws-cdk/issues/17545)
21+
* **aws-s3:** support number of newer versions to retain in lifecycle policy ([#18225](https://github.com/aws/aws-cdk/issues/18225)) ([e1731b1](https://github.com/aws/aws-cdk/commit/e1731b11c9417a9a4d6cf0f2089c62a721e8d074)), closes [#17996](https://github.com/aws/aws-cdk/issues/17996) [#17996](https://github.com/aws/aws-cdk/issues/17996)
22+
* **cfnspec:** cloudformation spec v53.0.0 ([#18468](https://github.com/aws/aws-cdk/issues/18468)) ([50637e0](https://github.com/aws/aws-cdk/commit/50637e08590c2051d9a1e446ee7ded47e85d02b3))
23+
* **cfnspec:** cloudformation spec v53.0.0 ([#18480](https://github.com/aws/aws-cdk/issues/18480)) ([38e1fe4](https://github.com/aws/aws-cdk/commit/38e1fe42d8b30d6afaf4a3ccc90dd15d6a5d8255))
24+
* **cfnspec:** cloudformation spec v53.0.0 ([#18524](https://github.com/aws/aws-cdk/issues/18524)) ([517d517](https://github.com/aws/aws-cdk/commit/517d517a0bb3f7f6e98538dca736086b86b206c8))
25+
* **cfnspec:** cloudformation spec v53.0.0 ([#18551](https://github.com/aws/aws-cdk/issues/18551)) ([926310b](https://github.com/aws/aws-cdk/commit/926310bace65a763972d56c0df5730cdc44f8f82))
26+
* **cli:** support hotswapping Lambda functions that use Docker images ([#18319](https://github.com/aws/aws-cdk/issues/18319)) ([6b553b7](https://github.com/aws/aws-cdk/commit/6b553b7f84e5cde8a1fc533af95ad440c020e834)), closes [#18302](https://github.com/aws/aws-cdk/issues/18302) [#18408](https://github.com/aws/aws-cdk/issues/18408)
27+
* **cli:** support hotswapping Lambda functions with inline code ([#18408](https://github.com/aws/aws-cdk/issues/18408)) ([d0b8512](https://github.com/aws/aws-cdk/commit/d0b8512449759bf74bb53aabbb6d5224b5f8c5ae)), closes [#18319](https://github.com/aws/aws-cdk/issues/18319)
28+
* **cli:** watch streams resources' CloudWatch logs to the terminal ([#18159](https://github.com/aws/aws-cdk/issues/18159)) ([a9038ae](https://github.com/aws/aws-cdk/commit/a9038ae9c7d9b15b89ae24cfa24aefa6012674bc)), closes [#18122](https://github.com/aws/aws-cdk/issues/18122)
29+
* **cognito:** identity pools ([#16190](https://github.com/aws/aws-cdk/issues/16190)) ([59fe395](https://github.com/aws/aws-cdk/commit/59fe395a5adcd35bd59c6d9c74f4a2606aec88b0))
30+
* **ec2:** add Hpc6a instances ([#18445](https://github.com/aws/aws-cdk/issues/18445)) ([c7f39ca](https://github.com/aws/aws-cdk/commit/c7f39ca97874c1d8d5286ab347a97fc458547830))
31+
* **ec2:** add support for al2022 and amzn2 with kernel 5.x ([#18117](https://github.com/aws/aws-cdk/issues/18117)) ([6b73d1d](https://github.com/aws/aws-cdk/commit/6b73d1d3d0ac05042c1e43a64068938138fe8421))
32+
* **ec2:** create Peers via security group ids ([#18248](https://github.com/aws/aws-cdk/issues/18248)) ([9d1b2c7](https://github.com/aws/aws-cdk/commit/9d1b2c7b1f0147089f912c32a61d7ba86edb543c)), closes [#7111](https://github.com/aws/aws-cdk/issues/7111)
33+
* **ecs-service-extensions:** Enable default logging to CloudWatch for extensions (under feature flag) ([#17817](https://github.com/aws/aws-cdk/issues/17817)) ([06666f4](https://github.com/aws/aws-cdk/commit/06666f4727b9745d001bc20f027b535538bb8250))
34+
* **iot:** add Action to put record to Kinesis Data stream ([#18321](https://github.com/aws/aws-cdk/issues/18321)) ([1480213](https://github.com/aws/aws-cdk/commit/1480213a032549ab7319e0c3a66e02e9b6a9c4ab)), closes [#17703](https://github.com/aws/aws-cdk/issues/17703)
35+
* **lambda-nodejs:** ES modules ([#18346](https://github.com/aws/aws-cdk/issues/18346)) ([e23b63f](https://github.com/aws/aws-cdk/commit/e23b63fc106c4781e3dd39a16d4a3e3c81bdd874)), closes [#13274](https://github.com/aws/aws-cdk/issues/13274)
36+
* **opensearch:** added opensearch 1.1 to engineversion ([#18432](https://github.com/aws/aws-cdk/issues/18432)) ([e01a57a](https://github.com/aws/aws-cdk/commit/e01a57aa3085a8282123afbc3583b1b78a075c9a)), closes [#18431](https://github.com/aws/aws-cdk/issues/18431)
37+
38+
39+
### Bug Fixes
40+
41+
* **apigateway:** `enabled` property of `ApiKeyProps` is ignored ([#18407](https://github.com/aws/aws-cdk/issues/18407)) ([c31f9b4](https://github.com/aws/aws-cdk/commit/c31f9b44165f872f8dd51605e00f4801ed611d4d))
42+
* **applicationautoscaling:** typo in `DYANMODB_WRITE_CAPACITY_UTILIZATION` ([#18085](https://github.com/aws/aws-cdk/issues/18085)) ([626e6aa](https://github.com/aws/aws-cdk/commit/626e6aa1a27feffe7ce60a46a6fdcf26f317eaef)), closes [#17209](https://github.com/aws/aws-cdk/issues/17209)
43+
* **assertions:** object partiality is dropped passing through arrays ([#18525](https://github.com/aws/aws-cdk/issues/18525)) ([eb29e6f](https://github.com/aws/aws-cdk/commit/eb29e6ff0308eb320ec772cc35cdbf781168198e))
44+
* **cli:** `cdk watch` constantly prints 'messages suppressed' ([#18486](https://github.com/aws/aws-cdk/issues/18486)) ([9b266f4](https://github.com/aws/aws-cdk/commit/9b266f49643d058709771892f908f1c2ae248f95)), closes [#18451](https://github.com/aws/aws-cdk/issues/18451)
45+
* **cli:** warning to upgrade to bootstrap version >= undefined ([#18489](https://github.com/aws/aws-cdk/issues/18489)) ([da5a305](https://github.com/aws/aws-cdk/commit/da5a305875f0b82b896861be3fcb12fddaa0cc7b))
46+
* **ec2:** interface endpoints do not work with `Vpc.fromLookup()` ([#18554](https://github.com/aws/aws-cdk/issues/18554)) ([f55cd2b](https://github.com/aws/aws-cdk/commit/f55cd2bd86405cc61d3eb24c2b827c2cd133363d)), closes [#17600](https://github.com/aws/aws-cdk/issues/17600)
47+
* **ec2:** launch template names in imdsv2 not unique across stacks (under feature flag) ([#17766](https://github.com/aws/aws-cdk/issues/17766)) ([2a80e4b](https://github.com/aws/aws-cdk/commit/2a80e4b113bac0716f5aa1d4806e425759da1743))
48+
* **ecs:** respect LogGroup's region for aws-log-driver ([#18212](https://github.com/aws/aws-cdk/issues/18212)) ([b6e3e51](https://github.com/aws/aws-cdk/commit/b6e3e517ac42b7951bc4ca4c1fd62422e3b49092)), closes [#17747](https://github.com/aws/aws-cdk/issues/17747)
49+
* **elbv2:** BaseLoadBalancer.vpc is not optional ([#18474](https://github.com/aws/aws-cdk/issues/18474)) ([f511c17](https://github.com/aws/aws-cdk/commit/f511c17aac8ca4d3fa94ace051d9946dc23f40a3)), closes [aws/jsii#3342](https://github.com/aws/jsii/issues/3342)
50+
* **iot:** `FirehoseStreamAction` is now called `FirehosePutRecordAction` ([#18356](https://github.com/aws/aws-cdk/issues/18356)) ([c016a9f](https://github.com/aws/aws-cdk/commit/c016a9fcf51f2415e6e0fcca2255da384c8abbc1)), closes [/github.com/aws/aws-cdk/pull/18321#discussion_r781620195](https://github.com/aws//github.com/aws/aws-cdk/pull/18321/issues/discussion_r781620195)
51+
* **pipelines:** "Maximum schema version supported" error ([#18404](https://github.com/aws/aws-cdk/issues/18404)) ([a684ff4](https://github.com/aws/aws-cdk/commit/a684ff47d56038a94c82cdbad9588da939963351)), closes [#18370](https://github.com/aws/aws-cdk/issues/18370)
52+
* **pipelines:** graphnode dependencies can have duplicates ([#18450](https://github.com/aws/aws-cdk/issues/18450)) ([2b0b5ea](https://github.com/aws/aws-cdk/commit/2b0b5ea5db7ce8103a641c1267b1c213453ac145))
53+
* **secretsmanager:** Secret requires KMS key for some same-account access ([#17812](https://github.com/aws/aws-cdk/issues/17812)) ([91f3539](https://github.com/aws/aws-cdk/commit/91f3539f4aa8383adcb2273790ddb469fb1274a6)), closes [#15450](https://github.com/aws/aws-cdk/issues/15450)
54+
55+
56+
### Reverts
57+
58+
* **s3:** add EventBridge bucket notifications ([#18150](https://github.com/aws/aws-cdk/issues/18150)) ([#18507](https://github.com/aws/aws-cdk/issues/18507)) ([2041278](https://github.com/aws/aws-cdk/commit/204127862d5fb1d2e6dd573a1621254e52eca4aa))
59+
560
## [1.139.0](https://github.com/aws/aws-cdk/compare/v1.138.2...v1.139.0) (2022-01-11)
661

762

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ let us know if it's not up-to-date (even better, submit a PR with your correcti
4646

4747
The following steps describe how to set up the AWS CDK repository on your local machine.
4848
The alternative is to use [Gitpod](https://www.gitpod.io/), a Cloud IDE for your development.
49-
See [Gitpod section](#gitpod) on how to set up the CDK repo on Gitpod.
49+
See [Gitpod section](#gitpod-alternative) on how to set up the CDK repo on Gitpod.
5050

5151
### Setup
5252

packages/@aws-cdk/app-delivery/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
"constructs": "^3.3.69"
6161
},
6262
"devDependencies": {
63-
"@aws-cdk/assert-internal": "0.0.0",
63+
"@aws-cdk/assertions": "0.0.0",
6464
"@aws-cdk/aws-s3": "0.0.0",
6565
"@aws-cdk/cdk-build-tools": "0.0.0",
6666
"@aws-cdk/cdk-integ-tools": "0.0.0",

packages/@aws-cdk/app-delivery/test/pipeline-deploy-stack-action.test.ts

Lines changed: 65 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import '@aws-cdk/assert-internal/jest';
2-
import { isSuperObject } from '@aws-cdk/assert-internal';
1+
import { Match, Matcher, Template } from '@aws-cdk/assertions';
32
import * as cfn from '@aws-cdk/aws-cloudformation';
43
import * as codebuild from '@aws-cdk/aws-codebuild';
54
import * as codepipeline from '@aws-cdk/aws-codepipeline';
@@ -135,56 +134,43 @@ describeDeprecated('pipeline deploy stack action', () => {
135134
capabilities: [cfn.CloudFormationCapabilities.ANONYMOUS_IAM, cfn.CloudFormationCapabilities.AUTO_EXPAND],
136135
adminPermissions: false,
137136
}));
138-
expect(pipelineStack).toHaveResource('AWS::CodePipeline::Pipeline', hasPipelineAction({
139-
Configuration: {
140-
StackName: 'TestStack',
141-
ActionMode: 'CHANGE_SET_REPLACE',
142-
Capabilities: 'CAPABILITY_NAMED_IAM',
143-
},
137+
138+
Template.fromStack(pipelineStack).hasResourceProperties('AWS::CodePipeline::Pipeline', hasPipelineActionConfiguration({
139+
StackName: 'TestStack',
140+
ActionMode: 'CHANGE_SET_REPLACE',
141+
Capabilities: 'CAPABILITY_NAMED_IAM',
144142
}));
145-
expect(pipelineStack).toHaveResource('AWS::CodePipeline::Pipeline', hasPipelineAction({
146-
Configuration: {
147-
StackName: 'AnonymousIAM',
148-
ActionMode: 'CHANGE_SET_REPLACE',
149-
Capabilities: 'CAPABILITY_IAM',
150-
},
143+
Template.fromStack(pipelineStack).hasResourceProperties('AWS::CodePipeline::Pipeline', hasPipelineActionConfiguration({
144+
StackName: 'AnonymousIAM',
145+
ActionMode: 'CHANGE_SET_REPLACE',
146+
Capabilities: 'CAPABILITY_IAM',
151147
}));
152-
expect(pipelineStack).not.toHaveResource('AWS::CodePipeline::Pipeline', hasPipelineAction({
153-
Configuration: {
154-
StackName: 'NoCapStack',
155-
ActionMode: 'CHANGE_SET_REPLACE',
156-
Capabilities: 'CAPABILITY_NAMED_IAM',
157-
},
148+
Template.fromStack(pipelineStack).hasResourceProperties('AWS::CodePipeline::Pipeline', Match.not(hasPipelineActionConfiguration({
149+
StackName: 'NoCapStack',
150+
ActionMode: 'CHANGE_SET_REPLACE',
151+
Capabilities: 'CAPABILITY_NAMED_IAM',
152+
})));
153+
Template.fromStack(pipelineStack).hasResourceProperties('AWS::CodePipeline::Pipeline', Match.not(hasPipelineActionConfiguration({
154+
StackName: 'NoCapStack',
155+
ActionMode: 'CHANGE_SET_REPLACE',
156+
Capabilities: 'CAPABILITY_IAM',
157+
})));
158+
Template.fromStack(pipelineStack).hasResourceProperties('AWS::CodePipeline::Pipeline', hasPipelineActionConfiguration({
159+
StackName: 'NoCapStack',
160+
ActionMode: 'CHANGE_SET_REPLACE',
158161
}));
159-
expect(pipelineStack).not.toHaveResource('AWS::CodePipeline::Pipeline', hasPipelineAction({
160-
Configuration: {
161-
StackName: 'NoCapStack',
162-
ActionMode: 'CHANGE_SET_REPLACE',
163-
Capabilities: 'CAPABILITY_IAM',
164-
},
162+
Template.fromStack(pipelineStack).hasResourceProperties('AWS::CodePipeline::Pipeline', hasPipelineActionConfiguration({
163+
StackName: 'AutoExpand',
164+
ActionMode: 'CHANGE_SET_REPLACE',
165+
Capabilities: 'CAPABILITY_AUTO_EXPAND',
165166
}));
166-
expect(pipelineStack).toHaveResource('AWS::CodePipeline::Pipeline', hasPipelineAction({
167-
Configuration: {
168-
StackName: 'NoCapStack',
169-
ActionMode: 'CHANGE_SET_REPLACE',
170-
},
167+
Template.fromStack(pipelineStack).hasResourceProperties('AWS::CodePipeline::Pipeline', hasPipelineActionConfiguration({
168+
StackName: 'AnonymousIAMAndAutoExpand',
169+
ActionMode: 'CHANGE_SET_REPLACE',
170+
Capabilities: 'CAPABILITY_IAM,CAPABILITY_AUTO_EXPAND',
171171
}));
172-
expect(pipelineStack).toHaveResource('AWS::CodePipeline::Pipeline', hasPipelineAction({
173-
Configuration: {
174-
StackName: 'AutoExpand',
175-
ActionMode: 'CHANGE_SET_REPLACE',
176-
Capabilities: 'CAPABILITY_AUTO_EXPAND',
177-
},
178-
}));
179-
expect(pipelineStack).toHaveResource('AWS::CodePipeline::Pipeline', hasPipelineAction({
180-
Configuration: {
181-
StackName: 'AnonymousIAMAndAutoExpand',
182-
ActionMode: 'CHANGE_SET_REPLACE',
183-
Capabilities: 'CAPABILITY_IAM,CAPABILITY_AUTO_EXPAND',
184-
},
185-
}));
186-
187172
});
173+
188174
test('users can use admin permissions', () => {
189175
const pipelineStack = getTestStack();
190176
const selfUpdatingStack = createSelfUpdatingStack(pipelineStack);
@@ -196,7 +182,7 @@ describeDeprecated('pipeline deploy stack action', () => {
196182
input: selfUpdatingStack.synthesizedApp,
197183
adminPermissions: true,
198184
}));
199-
expect(pipelineStack).toHaveResource('AWS::IAM::Policy', {
185+
Template.fromStack(pipelineStack).hasResourceProperties('AWS::IAM::Policy', {
200186
PolicyDocument: {
201187
Version: '2012-10-17',
202188
Statement: [
@@ -251,15 +237,13 @@ describeDeprecated('pipeline deploy stack action', () => {
251237
],
252238
},
253239
});
254-
expect(pipelineStack).toHaveResource('AWS::CodePipeline::Pipeline', hasPipelineAction({
255-
Configuration: {
256-
StackName: 'TestStack',
257-
ActionMode: 'CHANGE_SET_REPLACE',
258-
Capabilities: 'CAPABILITY_NAMED_IAM,CAPABILITY_AUTO_EXPAND',
259-
},
240+
Template.fromStack(pipelineStack).hasResourceProperties('AWS::CodePipeline::Pipeline', hasPipelineActionConfiguration({
241+
StackName: 'TestStack',
242+
ActionMode: 'CHANGE_SET_REPLACE',
243+
Capabilities: 'CAPABILITY_NAMED_IAM,CAPABILITY_AUTO_EXPAND',
260244
}));
261-
262245
});
246+
263247
test('users can supply a role for deploy action', () => {
264248
const pipelineStack = getTestStack();
265249
const selfUpdatingStack = createSelfUpdatingStack(pipelineStack);
@@ -313,7 +297,7 @@ describeDeprecated('pipeline deploy stack action', () => {
313297
}));
314298

315299
// THEN //
316-
expect(pipelineStack).toHaveResource('AWS::IAM::Policy', {
300+
Template.fromStack(pipelineStack).hasResourceProperties('AWS::IAM::Policy', {
317301
PolicyDocument: {
318302
Version: '2012-10-17',
319303
Statement: [
@@ -391,7 +375,7 @@ describeDeprecated('pipeline deploy stack action', () => {
391375
const app = new cdk.App();
392376

393377
const deployedStack = new cdk.Stack(app, 'DeployedStack');
394-
for (let i = 0 ; i < assetCount ; i++) {
378+
for (let i = 0; i < assetCount; i++) {
395379
deployedStack.node.addMetadata(cxschema.ArtifactMetadataEntryType.ASSET, {});
396380
}
397381

@@ -406,7 +390,6 @@ describeDeprecated('pipeline deploy stack action', () => {
406390
},
407391
),
408392
);
409-
410393
});
411394

412395
test('allows overriding the ChangeSet and Execute action names', () => {
@@ -425,25 +408,21 @@ describeDeprecated('pipeline deploy stack action', () => {
425408
],
426409
});
427410

428-
expect(stack).toHaveResourceLike('AWS::CodePipeline::Pipeline', {
429-
Stages: [
430-
{},
431-
{},
432-
{
411+
Template.fromStack(stack).hasResourceProperties('AWS::CodePipeline::Pipeline', {
412+
Stages: Match.arrayWith([
413+
Match.objectLike({
433414
Name: 'Deploy',
434-
Actions: [
435-
{
415+
Actions: Match.arrayWith([
416+
Match.objectLike({
436417
Name: 'Prepare',
437-
},
438-
{
418+
}),
419+
Match.objectLike({
439420
Name: 'Deploy',
440-
},
441-
],
442-
},
443-
],
421+
}),
422+
]),
423+
}),
424+
]),
444425
});
445-
446-
447426
});
448427
});
449428

@@ -481,7 +460,7 @@ function createSelfUpdatingStack(pipelineStack: cdk.Stack): SelfUpdatingPipeline
481460
});
482461

483462
// simple source
484-
const bucket = s3.Bucket.fromBucketArn( pipeline, 'PatternBucket', 'arn:aws:s3:::totally-fake-bucket');
463+
const bucket = s3.Bucket.fromBucketArn(pipeline, 'PatternBucket', 'arn:aws:s3:::totally-fake-bucket');
485464
const sourceOutput = new codepipeline.Artifact('SourceOutput');
486465
const sourceAction = new cpactions.S3SourceAction({
487466
actionName: 'S3Source',
@@ -509,15 +488,16 @@ function createSelfUpdatingStack(pipelineStack: cdk.Stack): SelfUpdatingPipeline
509488
return { synthesizedApp: buildOutput, pipeline };
510489
}
511490

512-
function hasPipelineAction(expectedAction: any): (props: any) => boolean {
513-
return (props: any) => {
514-
for (const stage of props.Stages) {
515-
for (const action of stage.Actions) {
516-
if (isSuperObject(action, expectedAction, [], true)) {
517-
return true;
518-
}
519-
}
520-
}
521-
return false;
522-
};
523-
}
491+
function hasPipelineActionConfiguration(expectedActionConfiguration: any): Matcher {
492+
return Match.objectLike({
493+
Stages: Match.arrayWith([
494+
Match.objectLike({
495+
Actions: Match.arrayWith([
496+
Match.objectLike({
497+
Configuration: expectedActionConfiguration,
498+
}),
499+
]),
500+
}),
501+
]),
502+
});
503+
}

packages/@aws-cdk/assertions/NOTICE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,4 +85,4 @@ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
8585
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
8686
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
8787

88-
----------------
88+
----------------

packages/@aws-cdk/assertions/README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,35 @@ target array. Out of order will be recorded as a match failure.
299299
Alternatively, the `Match.arrayEquals()` API can be used to assert that the target is
300300
exactly equal to the pattern array.
301301

302+
### String Matchers
303+
304+
The `Match.stringLikeRegexp()` API can be used to assert that the target matches the
305+
provided regular expression.
306+
307+
```ts
308+
// Given a template -
309+
// {
310+
// "Resources": {
311+
// "MyBar": {
312+
// "Type": "Foo::Bar",
313+
// "Properties": {
314+
// "Template": "const includeHeaders = true;"
315+
// }
316+
// }
317+
// }
318+
// }
319+
320+
// The following will NOT throw an assertion error
321+
template.hasResourceProperties('Foo::Bar', {
322+
Template: Match.stringLikeRegexp('includeHeaders = (true|false)'),
323+
});
324+
325+
// The following will throw an assertion error
326+
template.hasResourceProperties('Foo::Bar', {
327+
Template: Match.stringLikeRegexp('includeHeaders = null'),
328+
});
329+
```
330+
302331
### Not Matcher
303332

304333
The not matcher inverts the search pattern and matches all patterns in the path that does

0 commit comments

Comments
 (0)