Skip to content

Commit

Permalink
Merge branch 'master' into aws-iot-actions-logs-test-refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored Nov 9, 2021
2 parents 4eb3281 + acd64f4 commit 0bed861
Show file tree
Hide file tree
Showing 70 changed files with 598 additions and 139 deletions.
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,23 @@

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.

## [1.132.0](https://github.com/aws/aws-cdk/compare/v1.131.0...v1.132.0) (2021-11-09)


### Features

* **apigatewayv2:** http api - mTLS support ([#17284](https://github.com/aws/aws-cdk/issues/17284)) ([54be156](https://github.com/aws/aws-cdk/commit/54be1567546ffd52e83fbe52531f901c0b6c29c9)), closes [#12559](https://github.com/aws/aws-cdk/issues/12559)
* **stepfunctions-tasks:** add `AutoTerminationPolicy` to `EmrCreateCluster` ([#16976](https://github.com/aws/aws-cdk/issues/16976)) ([27ad7d8](https://github.com/aws/aws-cdk/commit/27ad7d86824b6378d470cda7304e7ae89ebbebf4))
* the assertions module is now stable! ([#17395](https://github.com/aws/aws-cdk/issues/17395)) ([ede5e22](https://github.com/aws/aws-cdk/commit/ede5e22da2e59218534c17c33a21cab98a3001a9))
* **cfnspec:** cloudformation spec v47.0.0 ([#17392](https://github.com/aws/aws-cdk/issues/17392)) ([7100d43](https://github.com/aws/aws-cdk/commit/7100d43ba7b9e9ce74fb64b33403aa8eaee63255))
* **lambda-nodejs:** custom asset hash ([#16412](https://github.com/aws/aws-cdk/issues/16412)) ([90da730](https://github.com/aws/aws-cdk/commit/90da730244513f9614604f6be3a77adbb6b17f79)), closes [#16157](https://github.com/aws/aws-cdk/issues/16157)


### Bug Fixes

* **codecommit:** notifyOnPullRequestMerged method has a typo in its name ([#17348](https://github.com/aws/aws-cdk/issues/17348)) ([cac5726](https://github.com/aws/aws-cdk/commit/cac572620210a435f679cf7d7d9f8b6e733b340c))
* **opensearch:** domain doesn't handle tokens in capacity configuration ([#17131](https://github.com/aws/aws-cdk/issues/17131)) ([2627939](https://github.com/aws/aws-cdk/commit/2627939108a2e979e385bf2942da1c05d48c678c)), closes [#15014](https://github.com/aws/aws-cdk/issues/15014)

## [1.131.0](https://github.com/aws/aws-cdk/compare/v1.130.0...v1.131.0) (2021-11-07)


Expand Down
5 changes: 5 additions & 0 deletions pack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ function lerna_scopes() {
echo "Extracting code samples" >&2
scripts/run-rosetta.sh $TMPDIR/jsii.txt

echo "Infusing examples back into assemblies" >&2
$ROSETTA infuse \
samples.tabl.json \
$(cat $TMPDIR/jsii.txt)

# Jsii packaging (all at once using jsii-pacmak)
echo "Packaging jsii modules" >&2
$PACMAK \
Expand Down
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@
"nohoist": [
"**/jszip",
"**/jszip/**",
"@aws-cdk/assertions-alpha/fs-extra",
"@aws-cdk/assertions-alpha/fs-extra/**",
"@aws-cdk/assertions/fs-extra",
"@aws-cdk/assertions/fs-extra/**",
"@aws-cdk/aws-amplify-alpha/yaml",
"@aws-cdk/aws-amplify-alpha/yaml/**",
"@aws-cdk/aws-amplify/yaml",
Expand Down
88 changes: 87 additions & 1 deletion packages/@aws-cdk/assertions/NOTICE
Original file line number Diff line number Diff line change
@@ -1,2 +1,88 @@
AWS Cloud Development Kit (AWS CDK)
Copyright 2018-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
Copyright 2018-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.

-------------------------------------------------------------------------------

The AWS CDK includes the following third-party software/licensing:

** fs-extra - https://www.npmjs.com/package/fs-extra
Copyright (c) 2011-2017 JP Richardson

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files
(the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify,
merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

----------------

** at-least-node - https://www.npmjs.com/package/at-least-node
Copyright (c) 2020 Ryan Zimmerman <[email protected]>

Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

----------------

** graceful-fs - https://www.npmjs.com/package/graceful-fs
Copyright (c) Isaac Z. Schlueter, Ben Noordhuis, and Contributors

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

----------------

** jsonfile - https://www.npmjs.com/package/jsonfile
Copyright (c) 2012-2015, JP Richardson <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files
(the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify,
merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

----------------

** universalify - https://www.npmjs.com/package/universalify
Copyright (c) 2017, Ryan Zimmerman <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the 'Software'), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

----------------
6 changes: 6 additions & 0 deletions packages/@aws-cdk/assertions/lib/template.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import * as path from 'path';
import { Stack, Stage } from '@aws-cdk/core';
import * as fs from 'fs-extra';
import { Match } from './match';
import { Matcher } from './matcher';
import { findMappings, hasMapping } from './private/mappings';
Expand Down Expand Up @@ -179,5 +181,9 @@ function toTemplate(stack: Stack): any {
throw new Error('unexpected: all stacks must be part of a Stage or an App');
}
const assembly = root.synth();
if (stack.nestedStackParent) {
// if this is a nested stack (it has a parent), then just read the template as a string
return JSON.parse(fs.readFileSync(path.join(assembly.directory, stack.templateFile)).toString('utf-8'));
}
return assembly.getStackArtifact(stack.artifactId).template;
}
9 changes: 7 additions & 2 deletions packages/@aws-cdk/assertions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"metadata": {
"jsii": {
"rosetta": {
"strict": false
"strict": true
}
}
}
Expand All @@ -64,6 +64,7 @@
"devDependencies": {
"@aws-cdk/cdk-build-tools": "0.0.0",
"@aws-cdk/pkglint": "0.0.0",
"@types/fs-extra": "^9.0.13",
"@types/jest": "^27.0.2",
"constructs": "^3.3.69",
"jest": "^27.3.1",
Expand All @@ -73,14 +74,18 @@
"@aws-cdk/cloud-assembly-schema": "0.0.0",
"@aws-cdk/core": "0.0.0",
"@aws-cdk/cx-api": "0.0.0",
"constructs": "^3.3.69"
"constructs": "^3.3.69",
"fs-extra": "^9.1.0"
},
"peerDependencies": {
"@aws-cdk/cloud-assembly-schema": "0.0.0",
"@aws-cdk/core": "0.0.0",
"@aws-cdk/cx-api": "0.0.0",
"constructs": "^3.3.69"
},
"bundledDependencies": [
"fs-extra"
],
"repository": {
"url": "https://github.com/aws/aws-cdk.git",
"type": "git",
Expand Down
44 changes: 35 additions & 9 deletions packages/@aws-cdk/assertions/test/template.test.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { App, CfnMapping, CfnOutput, CfnResource, Stack } from '@aws-cdk/core';
import { App, CfnMapping, CfnOutput, CfnResource, NestedStack, Stack } from '@aws-cdk/core';
import { Construct } from 'constructs';
import { Match, Template } from '../lib';

describe('Template', () => {
describe('asObject', () => {
test('fromString', () => {
const template = Template.fromString(`{
test('fromString', () => {
const template = Template.fromString(`{
"Resources": {
"Foo": {
"Type": "Baz::Qux",
Expand All @@ -14,30 +13,57 @@ describe('Template', () => {
}
}`);

expect(template.toJSON()).toEqual({
Resources: {
Foo: {
Type: 'Baz::Qux',
Properties: { Fred: 'Waldo' },
},
},
});
});

describe('fromStack', () => {
test('default', () => {
const app = new App({
context: {
'@aws-cdk/core:newStyleStackSynthesis': false,
},
});
const stack = new Stack(app);
new CfnResource(stack, 'Foo', {
type: 'Foo::Bar',
properties: {
Baz: 'Qux',
},
});
const template = Template.fromStack(stack);

expect(template.toJSON()).toEqual({
Resources: {
Foo: {
Type: 'Baz::Qux',
Properties: { Fred: 'Waldo' },
Type: 'Foo::Bar',
Properties: { Baz: 'Qux' },
},
},
});
});

test('fromStack', () => {
test('nested', () => {
const app = new App({
context: {
'@aws-cdk/core:newStyleStackSynthesis': false,
},
});
const stack = new Stack(app);
new CfnResource(stack, 'Foo', {
const nested = new NestedStack(stack, 'MyNestedStack');
new CfnResource(nested, 'Foo', {
type: 'Foo::Bar',
properties: {
Baz: 'Qux',
},
});
const template = Template.fromStack(stack);
const template = Template.fromStack(nested);

expect(template.toJSON()).toEqual({
Resources: {
Expand Down
9 changes: 8 additions & 1 deletion packages/@aws-cdk/aws-apigateway/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,14 @@
]
}
},
"projectReferences": true
"projectReferences": true,
"metadata": {
"jsii": {
"rosetta": {
"strict": true
}
}
}
},
"repository": {
"type": "git",
Expand Down
9 changes: 8 additions & 1 deletion packages/@aws-cdk/aws-apigatewayv2-authorizers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,14 @@
]
}
},
"projectReferences": true
"projectReferences": true,
"metadata": {
"jsii": {
"rosetta": {
"strict": true
}
}
}
},
"repository": {
"type": "git",
Expand Down
13 changes: 5 additions & 8 deletions packages/@aws-cdk/aws-apigatewayv2-integrations/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ The following example creates a new header - `header2` - as a copy of `header1`
```ts
import { HttpAlbIntegration } from '@aws-cdk/aws-apigatewayv2-integrations';

declare const lb: elbv2.NetworkLoadBalancer;
declare const lb: elbv2.ApplicationLoadBalancer;
const listener = lb.addListener('listener', { port: 80 });
listener.addTargets('target', {
port: 80,
Expand All @@ -182,9 +182,8 @@ const httpEndpoint = new apigwv2.HttpApi(this, 'HttpProxyPrivateApi', {
defaultIntegration: new HttpAlbIntegration({
listener,
parameterMapping: new apigwv2.ParameterMapping()
.appendHeader('header2', apigwv2.MappingValue.header('header1'))
.appendHeader('header2', apigwv2.MappingValue.requestHeader('header1'))
.removeHeader('header1'),
}),
}),
});
```
Expand All @@ -194,7 +193,7 @@ To add mapping keys and values not yet supported by the CDK, use the `custom()`
```ts
import { HttpAlbIntegration } from '@aws-cdk/aws-apigatewayv2-integrations';

declare const lb: elbv2.NetworkLoadBalancer;
declare const lb: elbv2.ApplicationLoadBalancer;
const listener = lb.addListener('listener', { port: 80 });
listener.addTargets('target', {
port: 80,
Expand All @@ -203,9 +202,7 @@ listener.addTargets('target', {
const httpEndpoint = new apigwv2.HttpApi(this, 'HttpProxyPrivateApi', {
defaultIntegration: new HttpAlbIntegration({
listener,
parameterMapping: new apigwv2.ParameterMapping()
.custom('myKey', 'myValue'),
}),
parameterMapping: new apigwv2.ParameterMapping().custom('myKey', 'myValue'),
}),
});
```
Expand All @@ -217,7 +214,7 @@ WebSocket integrations connect a route to backend resources. The following integ

### Lambda WebSocket Integration

Lambda integrations enable integrating a WebSocket API route with a Lambda function. When a client connects/disconnects
Lambda integrations enable integrating a WebSocket API route with a Lambda function. When a client connects/disconnects
or sends message specific to a route, the API Gateway service forwards the request to the Lambda function

The API Gateway service will invoke the lambda function with an event payload of a specific format.
Expand Down
9 changes: 8 additions & 1 deletion packages/@aws-cdk/aws-apigatewayv2-integrations/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,14 @@
]
}
},
"projectReferences": true
"projectReferences": true,
"metadata": {
"jsii": {
"rosetta": {
"strict": true
}
}
}
},
"repository": {
"type": "git",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ export interface ScalableTargetProps {
*
* This string consists of the resource type and unique identifier.
*
* @example service/ecsStack-MyECSCluster-AB12CDE3F4GH/ecsStack-MyECSService-AB12CDE3F4GH
* Example value: `service/ecsStack-MyECSCluster-AB12CDE3F4GH/ecsStack-MyECSService-AB12CDE3F4GH`
*
* @see https://docs.aws.amazon.com/autoscaling/application/APIReference/API_RegisterScalableTarget.html
*/
readonly resourceId: string;
Expand All @@ -49,7 +50,7 @@ export interface ScalableTargetProps {
*
* Specify the service namespace, resource type, and scaling property.
*
* @example ecs:service:DesiredCount
* Example value: `ecs:service:DesiredCount`
* @see https://docs.aws.amazon.com/autoscaling/application/APIReference/API_ScalingPolicy.html
*/
readonly scalableDimension: string;
Expand Down Expand Up @@ -82,7 +83,8 @@ export class ScalableTarget extends Resource implements IScalableTarget {
/**
* ID of the Scalable Target
*
* @example service/ecsStack-MyECSCluster-AB12CDE3F4GH/ecsStack-MyECSService-AB12CDE3F4GH|ecs:service:DesiredCount|ecs
* Example value: `service/ecsStack-MyECSCluster-AB12CDE3F4GH/ecsStack-MyECSService-AB12CDE3F4GH|ecs:service:DesiredCount|ecs`
*
* @attribute
*/
public readonly scalableTargetId: string;
Expand Down
Loading

0 comments on commit 0bed861

Please sign in to comment.