Skip to content

Commit

Permalink
Merge branch 'master' into iotevents-variable
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] committed Mar 11, 2022
2 parents f73f24e + 1875c28 commit 154f68e
Show file tree
Hide file tree
Showing 20 changed files with 156 additions and 43 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/issue-label-assign.yml
Original file line number Diff line number Diff line change
Expand Up @@ -273,5 +273,6 @@ env:
{"area":"@aws-cdk/yaml-cfn","keywords":["(aws-yaml-cfn)","(yaml-cfn)"],"labels":["@aws-cdk/aws-yaml-cfn"],"assignees":["skinny85"]},
{"area":"@aws-cdk/aws-apprunner","keywords":["apprunner","aws-apprunner"],"labels":["@aws-cdk/aws-apprunner"],"assignees":["corymhall"]},
{"area":"@aws-cdk/aws-lightsail","keywords":["lightsail","aws-lightsail"],"labels":["@aws-cdk/aws-lightsail"],"assignees":["corymhall"]},
{"area":"@aws-cdk/aws-aps","keywords":["aps","aws-aps","prometheus"],"labels":["@aws-cdk/aws-aps"],"assignees":["corymhall"]}
{"area":"@aws-cdk/aws-aps","keywords":["aps","aws-aps","prometheus"],"labels":["@aws-cdk/aws-aps"],"assignees":["corymhall"]},
{"area":"@aws-cdk/triggers","keywords":["trigger","aws-cdk/triggers","triggers"],"labels":["@aws-cdk/triggers"],"assignees":["otaviomacedo"]}
]
34 changes: 34 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,40 @@

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.148.0](https://github.com/aws/aws-cdk/compare/v1.147.0...v1.148.0) (2022-03-09)


### Features

* **aws-apigateway:** add ability to include authorizer context in apigw sfn integration ([#18892](https://github.com/aws/aws-cdk/issues/18892)) ([e7c0c75](https://github.com/aws/aws-cdk/commit/e7c0c75dbc7cf71164673626dc0ab63fb3706223)), closes [#18891](https://github.com/aws/aws-cdk/issues/18891)
* **aws-s3objectlambda:** add L2 construct for S3 Object Lambda ([#15833](https://github.com/aws/aws-cdk/issues/15833)) ([fe9f750](https://github.com/aws/aws-cdk/commit/fe9f750bd9dd9974b9ae6f73c78fcd12ab2edd91)), closes [#13675](https://github.com/aws/aws-cdk/issues/13675)
* **cfnspec:** cloudformation spec v59.0.0 ([#19236](https://github.com/aws/aws-cdk/issues/19236)) ([f46a14d](https://github.com/aws/aws-cdk/commit/f46a14da9bec1aad7096b62666cb80ce42f04b53))
* **codebuild:** improved support for ARM build images ([#19052](https://github.com/aws/aws-cdk/issues/19052)) ([4eac4de](https://github.com/aws/aws-cdk/commit/4eac4deb98411e921e5a2e6477185207b8588f75)), closes [#18916](https://github.com/aws/aws-cdk/issues/18916) [#9817](https://github.com/aws/aws-cdk/issues/9817)
* **eks:** Service Account names validation ([#19251](https://github.com/aws/aws-cdk/issues/19251)) ([7c3099e](https://github.com/aws/aws-cdk/commit/7c3099e958d7bf0ddb5a7b08afb672a0c652b27d)), closes [#18189](https://github.com/aws/aws-cdk/issues/18189)
* **elasticsearch:** Decouple setting access policies from domain constructor ([#15876](https://github.com/aws/aws-cdk/issues/15876)) ([cefdfd3](https://github.com/aws/aws-cdk/commit/cefdfd384eeac1752567f672452296def68b1206))
* **iotevents:** support actions ([#18869](https://github.com/aws/aws-cdk/issues/18869)) ([e01654e](https://github.com/aws/aws-cdk/commit/e01654e792708ee283d7a31e1370d0d1ae383171))
* **iotevents:** support setting Events on input and exit for State ([#19249](https://github.com/aws/aws-cdk/issues/19249)) ([ffa9e0d](https://github.com/aws/aws-cdk/commit/ffa9e0d287d0a86e1e0eb7dc2dec16d9f3e84450))
* **lambda-nodejs:** support esbuild inject ([#19221](https://github.com/aws/aws-cdk/issues/19221)) ([3432c45](https://github.com/aws/aws-cdk/commit/3432c457fe38a83743d7ce2a5cb6c36a6ec01b8f)), closes [#19133](https://github.com/aws/aws-cdk/issues/19133)
* **s3:** add `s3:ObjectRestore:Delete` to `EventType` for notification ([#19250](https://github.com/aws/aws-cdk/issues/19250)) ([e0f863a](https://github.com/aws/aws-cdk/commit/e0f863a4c56041860e14c75b9aa5a6d35860fae6)), closes [#19223](https://github.com/aws/aws-cdk/issues/19223)
* **servicecatalog:** Service Catalog is now in Developer Preview ([#19204](https://github.com/aws/aws-cdk/issues/19204)) ([6dfc254](https://github.com/aws/aws-cdk/commit/6dfc254e1925597b4ef2ece9c132b1a0e580dd6d))


### Bug Fixes

* **apigatewayv2-integrations:** in case of multiple routes, only one execute permission is created ([#18716](https://github.com/aws/aws-cdk/issues/18716)) ([1e352ca](https://github.com/aws/aws-cdk/commit/1e352ca2ab458bfe4e1de6cf431166654ce9aa58))
* **aws-apigateway:** missing comma to make failure response payload valid json ([#19253](https://github.com/aws/aws-cdk/issues/19253)) ([b1fce4f](https://github.com/aws/aws-cdk/commit/b1fce4f1641c90a4b7d1d33139453260b452d5cd)), closes [#19252](https://github.com/aws/aws-cdk/issues/19252)
* **aws-route53-targets:** add support for custom cname_prefix urls in elastic beanstalk environment endpoint target ([#18804](https://github.com/aws/aws-cdk/issues/18804)) ([289a794](https://github.com/aws/aws-cdk/commit/289a79467d9974ee3582c9e30843b0eb9e90b467))
* **cli:** `watch` logs always end with the 'truncated' message ([#19241](https://github.com/aws/aws-cdk/issues/19241)) ([d3fdfe5](https://github.com/aws/aws-cdk/commit/d3fdfe5264e64cb333795b32edbad36cfaab3dc7)), closes [#18805](https://github.com/aws/aws-cdk/issues/18805)
* **cli:** deprecated stack ids printed at the end of synth ([#19216](https://github.com/aws/aws-cdk/issues/19216)) ([7d8a479](https://github.com/aws/aws-cdk/commit/7d8a4792a142f45109f35a51c6e1b3888d4111d3)), closes [#18599](https://github.com/aws/aws-cdk/issues/18599)
* **cli:** notices refresh doesn't respect the --no-notices flag ([#19226](https://github.com/aws/aws-cdk/issues/19226)) ([b3c5fe8](https://github.com/aws/aws-cdk/commit/b3c5fe8d0b695e06558bce23a6dd39b20265594f))
* **efs:** fix bug when setting both lifecyclePolicy and outOfInfrequentAccessPolicy ([#19082](https://github.com/aws/aws-cdk/issues/19082)) ([d435ab6](https://github.com/aws/aws-cdk/commit/d435ab6120c47464427489d98bea9347983a2123)), closes [#19058](https://github.com/aws/aws-cdk/issues/19058)
* **lambda-nodejs:** local tsc detection with pre compilation ([#19266](https://github.com/aws/aws-cdk/issues/19266)) ([5de7b86](https://github.com/aws/aws-cdk/commit/5de7b86d916be6ab892e75e18c54a327fe1f65ff)), closes [#19242](https://github.com/aws/aws-cdk/issues/19242)
* **lambda-python:** asset bundling fails on windows ([#19270](https://github.com/aws/aws-cdk/issues/19270)) ([0da57da](https://github.com/aws/aws-cdk/commit/0da57da9606d982788350a6257f0f0ed6e9fd92a)), closes [#18861](https://github.com/aws/aws-cdk/issues/18861)
* **lambda-python:** docker image gets built even when we don't need to bundle assets ([#16192](https://github.com/aws/aws-cdk/issues/16192)) ([5dc61ea](https://github.com/aws/aws-cdk/commit/5dc61eabc0ea3e6294f83db5deb8528461a1d5bc)), closes [#14747](https://github.com/aws/aws-cdk/issues/14747)
* **rds:** allow cluster from snapshot to enable encrypted storage ([#19175](https://github.com/aws/aws-cdk/issues/19175)) ([bd4141d](https://github.com/aws/aws-cdk/commit/bd4141d864612974829c95d530085d4f18bdfeb8)), closes [#17241](https://github.com/aws/aws-cdk/issues/17241)
* **rds:** read replica instance cannot join domain ([#19202](https://github.com/aws/aws-cdk/issues/19202)) ([cef8fec](https://github.com/aws/aws-cdk/commit/cef8fec1b0410daa6b57c152e9bad73dcc034397)), closes [#18786](https://github.com/aws/aws-cdk/issues/18786)
* **rds:** subnet selection not respected for multi user secret rotation ([#19237](https://github.com/aws/aws-cdk/issues/19237)) ([dc7a17c](https://github.com/aws/aws-cdk/commit/dc7a17cd20198a6eb52c2ab25857e73bd7048d26)), closes [#19233](https://github.com/aws/aws-cdk/issues/19233)

## [1.147.0](https://github.com/aws/aws-cdk/compare/v1.146.0...v1.147.0) (2022-03-01)


Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ specific to the CDK.

### Build

The full build of the CDK takes a long time complete; 1-2 hours depending on the performance of the build machine.
The full build of the CDK takes a long time to complete; 1-2 hours depending on the performance of the build machine.
However, most first time contributions will require changing only one CDK module, sometimes two. A full build of the
CDK is not required in these cases.

Expand Down Expand Up @@ -481,7 +481,7 @@ grantAwesomePowerBeta1();
```

Times goes by, we get feedback that this method will actually be much better
if it accept a `Principal`. Since adding a required property is a breaking
if it accepts a `Principal`. Since adding a required property is a breaking
change, we will add `grantAwesomePowerBeta2()` and deprecate
`grantAwesomePowerBeta1`:

Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-cognito/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ The two main components of Amazon Cognito are [user
pools](https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools.html) and [identity
pools](https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-identity.html). User pools are user directories
that provide sign-up and sign-in options for your app users. Identity pools enable you to grant your users access to
other AWS services. Identity Pool L2 Constructs can be found [here](../aws-cognito-identitypool).
other AWS services. Identity Pool L2 Constructs can be found [here](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cognito-identitypool-alpha-readme.html).

This module is part of the [AWS Cloud Development Kit](https://github.com/aws/aws-cdk) project.

Expand Down
4 changes: 2 additions & 2 deletions packages/@aws-cdk/aws-lambda-event-sources/lib/dynamodb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ export class DynamoEventSource extends StreamEventSource {

if (this.props.batchSize !== undefined
&& !Token.isUnresolved(this.props.batchSize)
&& (this.props.batchSize < 1 || this.props.batchSize > 1000)) {
throw new Error(`Maximum batch size must be between 1 and 1000 inclusive (given ${this.props.batchSize})`);
&& (this.props.batchSize < 1 || this.props.batchSize > 10000)) {
throw new Error(`Maximum batch size must be between 1 and 10000 inclusive (given ${this.props.batchSize})`);
}
}

Expand Down
14 changes: 7 additions & 7 deletions packages/@aws-cdk/aws-lambda-event-sources/test/dynamo.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ describe('DynamoEventSource', () => {

// WHEN
fn.addEventSource(new sources.DynamoEventSource(table, {
batchSize: 50,
batchSize: 5000,
startingPosition: lambda.StartingPosition.LATEST,
}));

Expand All @@ -131,7 +131,7 @@ describe('DynamoEventSource', () => {
'FunctionName': {
'Ref': 'Fn9270CBC0',
},
'BatchSize': 50,
'BatchSize': 5000,
'StartingPosition': 'LATEST',
});

Expand All @@ -153,7 +153,7 @@ describe('DynamoEventSource', () => {
type: 'Number',
default: 100,
minValue: 1,
maxValue: 1000,
maxValue: 10000,
});
// WHEN
fn.addEventSource(new sources.DynamoEventSource(table, {
Expand Down Expand Up @@ -217,12 +217,12 @@ describe('DynamoEventSource', () => {
expect(() => fn.addEventSource(new sources.DynamoEventSource(table, {
batchSize: 0,
startingPosition: lambda.StartingPosition.LATEST,
}))).toThrow(/Maximum batch size must be between 1 and 1000 inclusive \(given 0\)/);
}))).toThrow(/Maximum batch size must be between 1 and 10000 inclusive \(given 0\)/);


});

test('fails if batch size > 1000', () => {
test('fails if batch size > 10000', () => {
// GIVEN
const stack = new cdk.Stack();
const fn = new TestFunction(stack, 'Fn');
Expand All @@ -236,9 +236,9 @@ describe('DynamoEventSource', () => {

// WHEN
expect(() => fn.addEventSource(new sources.DynamoEventSource(table, {
batchSize: 1001,
batchSize: 10001,
startingPosition: lambda.StartingPosition.LATEST,
}))).toThrow(/Maximum batch size must be between 1 and 1000 inclusive \(given 1001\)/);
}))).toThrow(/Maximum batch size must be between 1 and 10000 inclusive \(given 10001\)/);


});
Expand Down
8 changes: 6 additions & 2 deletions packages/@aws-cdk/aws-lambda-nodejs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ Docker container even if `esbuild` is available in your environment. This can be

## Configuring `esbuild`

The `NodejsFunction` construct exposes some [esbuild options](https://esbuild.github.io/api/#build-api)
The `NodejsFunction` construct exposes [esbuild options](https://esbuild.github.io/api/#build-api)
via properties under `bundling`:

```ts
Expand Down Expand Up @@ -198,7 +198,11 @@ new lambda.NodejsFunction(this, 'my-handler', {
charset: lambda.Charset.UTF8, // do not escape non-ASCII characters, defaults to Charset.ASCII
format: lambda.OutputFormat.ESM, // ECMAScript module output format, defaults to OutputFormat.CJS (OutputFormat.ESM requires Node.js 14.x)
mainFields: ['module', 'main'], // prefer ECMAScript versions of dependencies
inject: ['./my-shim.js', './other-shim.js'] // allows to automatically replace a global variable with an import from another file
inject: ['./my-shim.js', './other-shim.js'], // allows to automatically replace a global variable with an import from another file
esbuildArgs: { // Pass additional arguments to esbuild
"--log-limit": "0",
"--splitting": true,
},
},
});
```
Expand Down
1 change: 1 addition & 0 deletions packages/@aws-cdk/aws-lambda-nodejs/lib/bundling.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ export class Bundling implements cdk.BundlingOptions {
...this.props.charset ? [`--charset=${this.props.charset}`] : [],
...this.props.mainFields ? [`--main-fields=${this.props.mainFields.join(',')}`] : [],
...this.props.inject ? this.props.inject.map(i => `--inject:${i}`) : [],
...this.props.esbuildArgs ? [Object.entries(this.props.esbuildArgs).map(([key, value]) => `${key}="${value}"`).join(' ')] : [],
];

let depsCommand = '';
Expand Down
22 changes: 21 additions & 1 deletion packages/@aws-cdk/aws-lambda-nodejs/lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,12 +203,32 @@ export interface BundlingOptions {
*/
readonly esbuildVersion?: string;

/**
* Build arguments to pass into esbuild.
*
* For example, to add the [--log-limit](https://esbuild.github.io/api/#log-limit) flag:
*
* ```text
* new NodejsFunction(scope, id, {
* ...
* bundling: {
* esbuildArgs: {
* "--log-limit": "0",
* }
* }
* });
* ```
*
* @default - no additional esbuild arguments are passed
*/
readonly esbuildArgs?: { [key: string]: string | boolean };

/**
* Build arguments to pass when building the bundling image.
*
* @default - no build arguments are passed
*/
readonly buildArgs?: { [key:string] : string };
readonly buildArgs?: { [key: string]: string };

/**
* Force bundling in a Docker container even if local bundling is
Expand Down
9 changes: 8 additions & 1 deletion packages/@aws-cdk/aws-lambda-nodejs/test/bundling.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,11 @@ test('esbuild bundling with esbuild options', () => {
},
format: OutputFormat.ESM,
inject: ['./my-shim.js'],
esbuildArgs: {
'--log-limit': '0',
'--resolve-extensions': '.ts,.js',
'--splitting': 'true',
},
});

// Correctly bundles with esbuild
Expand All @@ -218,7 +223,8 @@ test('esbuild bundling with esbuild options', () => {
assetHashType: AssetHashType.OUTPUT,
bundling: expect.objectContaining({
command: [
'bash', '-c',
'bash',
'-c',
[
'esbuild --bundle "/asset-input/lib/handler.ts"',
'--target=es2020 --platform=node --format=esm --outfile="/asset-output/index.mjs"',
Expand All @@ -227,6 +233,7 @@ test('esbuild bundling with esbuild options', () => {
'--log-level=silent --keep-names --tsconfig=/asset-input/lib/custom-tsconfig.ts',
'--metafile=/asset-output/index.meta.json --banner:js="/* comments */" --footer:js="/* comments */"',
'--charset=utf8 --main-fields=module,main --inject:./my-shim.js',
'--log-limit="0" --resolve-extensions=".ts,.js" --splitting="true"',
].join(' '),
],
}),
Expand Down
5 changes: 5 additions & 0 deletions packages/@aws-cdk/aws-lambda/lib/runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,11 @@ export class Runtime {
supportsCodeGuruProfiling: true,
});

/**
* The .NET 6 runtime (dotnet6)
*/
public static readonly DOTNET_6 = new Runtime('dotnet6', RuntimeFamily.DOTNET_CORE);

/**
* The .NET Core 1.0 runtime (dotnetcore1.0)
* Legacy runtime no longer supported by AWS Lambda.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { RegionInfo } from '@aws-cdk/region-info';
/**
* Use an Elastic Beanstalk environment URL as an alias record target.
* E.g. mysampleenvironment.xyz.us-east-1.elasticbeanstalk.com
* or mycustomcnameprefix.us-east-1.elasticbeanstalk.com
*
* Only supports Elastic Beanstalk environments created after 2016 that have a regional endpoint.
*/
Expand All @@ -18,7 +19,9 @@ export class ElasticBeanstalkEnvironmentEndpointTarget implements route53.IAlias
}

const dnsName = this.environmentEndpoint;
const region = cdk.Fn.select(2, cdk.Fn.split('.', dnsName));
const subDomains = cdk.Fn.split('.', dnsName);
const regionSubdomainIndex = subDomains.length - 3;
const region = cdk.Fn.select(regionSubdomainIndex, subDomains);
const { ebsEnvEndpointHostedZoneId: hostedZoneId } = RegionInfo.get(region);

if (!hostedZoneId || !dnsName) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,25 @@ test('use EBS environment as record target', () => {
},
});
});


test('support 4-levels subdomain URLs for EBS environments', () => {
// GIVEN
const stack = new Stack();
const zone = new route53.PublicHostedZone(stack, 'HostedZone', { zoneName: 'test.public' });

// WHEN
new route53.ARecord(stack, 'Alias', {
zone,
recordName: '_foo',
target: route53.RecordTarget.fromAlias(new targets.ElasticBeanstalkEnvironmentEndpointTarget('mycustomcnameprefix.us-east-1.elasticbeanstalk.com')),
});

// THEN
Template.fromStack(stack).hasResourceProperties('AWS::Route53::RecordSet', {
AliasTarget: {
DNSName: 'mycustomcnameprefix.us-east-1.elasticbeanstalk.com',
HostedZoneId: 'Z117KPS5GTRQ2G',
},
});
});
Loading

0 comments on commit 154f68e

Please sign in to comment.