Skip to content

Commit 47d7ec4

Browse files
authored
2 parents d035432 + a4ef723 commit 47d7ec4

File tree

326 files changed

+8385
-763
lines changed

Some content is hidden

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

326 files changed

+8385
-763
lines changed

.github/workflows/yarn-upgrade.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ jobs:
6767
lerna exec --parallel ncu -- --upgrade --reject='@types/node,@types/prettier,@types/fs-extra,constructs,typescript,aws-sdk,aws-sdk-mock,${{ steps.list-packages.outputs.list }}' --target=minor
6868
# Upgrade package.jsons in init templates
6969
for pj in $(find packages/aws-cdk/lib/init-templates -name package.json); do
70-
(cd $(dirname $pj) && ncu --upgrade --reject='@types/node,@types/prettier,@types/fs-extra,constructs,typescript,aws-sdk,aws-sdk-mock,ts-jest,jest,${{ steps.list-packages.outputs.list }}')
70+
(cd $(dirname $pj) && ncu --upgrade --reject='@types/jest,@types/node,@types/prettier,@types/fs-extra,constructs,typescript,aws-sdk,aws-sdk-mock,ts-jest,jest,${{ steps.list-packages.outputs.list }}')
7171
done
7272
7373
# This will ensure the current lockfile is up-to-date with the dependency specifications (necessary for "yarn update" to run)

CHANGELOG.v2.alpha.md

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
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+
## [2.29.0-alpha.0](https://github.com/aws/aws-cdk/compare/v2.28.1-alpha.0...v2.29.0-alpha.0) (2022-06-22)
6+
57
## [2.28.1-alpha.0](https://github.com/aws/aws-cdk/compare/v2.28.0-alpha.0...v2.28.1-alpha.0) (2022-06-15)
68

79
## [2.28.0-alpha.0](https://github.com/aws/aws-cdk/compare/v2.27.0-alpha.0...v2.28.0-alpha.0) (2022-06-14)

CHANGELOG.v2.md

+28
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,34 @@
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+
## [2.29.0](https://github.com/aws/aws-cdk/compare/v2.28.1...v2.29.0) (2022-06-22)
6+
7+
8+
### Features
9+
10+
* **apigateway:** Add LambdaIntegrationOptions to LambdaRestApi ([#17065](https://github.com/aws/aws-cdk/issues/17065)) ([b117469](https://github.com/aws/aws-cdk/commit/b1174699833cff61a839eab293521e14659b00c2)), closes [#3269](https://github.com/aws/aws-cdk/issues/3269)
11+
* **aws-eks:** allow the use of graviton3 processors ([#20543](https://github.com/aws/aws-cdk/issues/20543)) ([98b52de](https://github.com/aws/aws-cdk/commit/98b52def344881b3e119660f08260ef89409103b))
12+
* **cfnspec:** cloudformation spec v76.0.0 ([#20726](https://github.com/aws/aws-cdk/issues/20726)) ([4dbb246](https://github.com/aws/aws-cdk/commit/4dbb2460d658fc8f734773545be6b47ebebaea5c))
13+
* **events-targets:** Add DLQ support for SNS target ([#20062](https://github.com/aws/aws-cdk/issues/20062)) ([1148a47](https://github.com/aws/aws-cdk/commit/1148a47514450769e12a829188071592b2b3e3b6)), closes [#19741](https://github.com/aws/aws-cdk/issues/19741)
14+
* **lambda:** inline function code can exceed 4096 bytes ([#20624](https://github.com/aws/aws-cdk/issues/20624)) ([a014c30](https://github.com/aws/aws-cdk/commit/a014c30d5727afcc48706878dc4bf77a22bb122f))
15+
* **pipelines:** add support for caching to codebuild steps ([#20533](https://github.com/aws/aws-cdk/issues/20533)) ([81ef665](https://github.com/aws/aws-cdk/commit/81ef6650d123726ee01ec6cecba77d37244290e4)), closes [#16375](https://github.com/aws/aws-cdk/issues/16375) [#19084](https://github.com/aws/aws-cdk/issues/19084)
16+
* **route53:** replace existing record sets ([#20416](https://github.com/aws/aws-cdk/issues/20416)) ([2f92c35](https://github.com/aws/aws-cdk/commit/2f92c35b17034859c2ec1514f3b2601d188d31c9))
17+
* **secretsmanager:** exclude characters for hosted rotation ([#20768](https://github.com/aws/aws-cdk/issues/20768)) ([d66534a](https://github.com/aws/aws-cdk/commit/d66534a1a848083a39ffcc9161b050955f0fdc40))
18+
* **servicediscovery:** add hostedzoneid as attribute to namespace ([#20583](https://github.com/aws/aws-cdk/issues/20583)) ([454d60f](https://github.com/aws/aws-cdk/commit/454d60fdfcf348fbc114bfdfe5c6dc8429fb0afd)), closes [#20510](https://github.com/aws/aws-cdk/issues/20510)
19+
20+
21+
### Bug Fixes
22+
23+
* **autoscaling:** osType is wrong when using CloudformationInit with launchTemplate ([#20759](https://github.com/aws/aws-cdk/issues/20759)) ([610b7b5](https://github.com/aws/aws-cdk/commit/610b7b56462f848e4b2659ed6e821852612ece67))
24+
* **codepipeline:** cannot deploy pipeline stack with crossAccountKeys twice (under feature flag) ([#20745](https://github.com/aws/aws-cdk/issues/20745)) ([c262034](https://github.com/aws/aws-cdk/commit/c262034afd2468c5bcf1cf47c45a70116c378d3e)), closes [#18828](https://github.com/aws/aws-cdk/issues/18828)
25+
* **core:** CfnMapping values cannot be used in other stacks ([#20616](https://github.com/aws/aws-cdk/issues/20616)) ([f5c2284](https://github.com/aws/aws-cdk/commit/f5c2284c70b66c5cdf246f68815543a9ea85c868)), closes [#18920](https://github.com/aws/aws-cdk/issues/18920)
26+
* **core:** Durations in the expected unit are not tested for integer-ness ([#20742](https://github.com/aws/aws-cdk/issues/20742)) ([ddb4766](https://github.com/aws/aws-cdk/commit/ddb4766785e27fbd4d672a5ff31fb07c3d3d389a))
27+
* **events-targets:** cloudwatch logs requires specific input template ([#20748](https://github.com/aws/aws-cdk/issues/20748)) ([26ff3c7](https://github.com/aws/aws-cdk/commit/26ff3c7748dbdb1faa5d7adf30242b307db2db47)), closes [#19451](https://github.com/aws/aws-cdk/issues/19451)
28+
* **iam:** add `defaultPolicyName` to prevent policies overwriting each other in multi-stack deployments ([#20705](https://github.com/aws/aws-cdk/issues/20705)) ([703e62e](https://github.com/aws/aws-cdk/commit/703e62e5542508f67ce9060e47b98621b3059115)), closes [#16074](https://github.com/aws/aws-cdk/issues/16074)
29+
* **iam:** duplicate PolicyStatements lead to too many overflow policies ([#20767](https://github.com/aws/aws-cdk/issues/20767)) ([e692ad2](https://github.com/aws/aws-cdk/commit/e692ad29afa9c489829b76acfe51a42ed8b7a5a4))
30+
* **init-templates:** unable to initialize typescript templates ([#20752](https://github.com/aws/aws-cdk/issues/20752)) ([665534d](https://github.com/aws/aws-cdk/commit/665534d63b7c3aea2fa84843dd06965c75b261e5)), closes [#20751](https://github.com/aws/aws-cdk/issues/20751)
31+
* **route53:** improve fromHostedZoneId error message ([#20755](https://github.com/aws/aws-cdk/issues/20755)) ([2cbbb79](https://github.com/aws/aws-cdk/commit/2cbbb7929727983aa4495cbf43e0f91509c2cfed)), closes [#8406](https://github.com/aws/aws-cdk/issues/8406)
32+
533
## [2.28.1](https://github.com/aws/aws-cdk/compare/v2.28.0...v2.28.1) (2022-06-15)
634

735

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

+15
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,21 @@ item.addMethod('GET'); // GET /items/{item}
107107
item.addMethod('DELETE', new apigateway.HttpIntegration('http://amazon.com'));
108108
```
109109

110+
Additionally, `integrationOptions` can be supplied to explicitly define
111+
options of the Lambda integration:
112+
113+
```ts
114+
declare const backend: lambda.Function;
115+
116+
const api = new apigateway.LambdaRestApi(this, 'myapi', {
117+
handler: backend,
118+
integrationOptions: {
119+
allowTestInvoke: false,
120+
timeout: Duration.seconds(1),
121+
}
122+
})
123+
```
124+
110125
## AWS StepFunctions backed APIs
111126

112127
You can use Amazon API Gateway with AWS Step Functions as the backend integration, specifically Synchronous Express Workflows.

packages/@aws-cdk/aws-apigateway/lib/lambda-api.ts

+10-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as lambda from '@aws-cdk/aws-lambda';
22
import { Construct } from 'constructs';
3-
import { LambdaIntegration } from './integrations';
3+
import { LambdaIntegration, LambdaIntegrationOptions } from './integrations';
44
import { Method } from './method';
55
import { ProxyResource, Resource } from './resource';
66
import { RestApi, RestApiProps } from './restapi';
@@ -14,6 +14,13 @@ export interface LambdaRestApiProps extends RestApiProps {
1414
*/
1515
readonly handler: lambda.IFunction;
1616

17+
/**
18+
* Specific Lambda integration options.
19+
*
20+
* @default see defaults defined in {@link LambdaIntegrationOptions}.
21+
*/
22+
readonly integrationOptions?: LambdaIntegrationOptions;
23+
1724
/**
1825
* If true, route all requests to the Lambda Function
1926
*
@@ -43,12 +50,12 @@ export interface LambdaRestApiProps extends RestApiProps {
4350
*/
4451
export class LambdaRestApi extends RestApi {
4552
constructor(scope: Construct, id: string, props: LambdaRestApiProps) {
46-
if ((props.options && props.options.defaultIntegration) || props.defaultIntegration) {
53+
if (props.options?.defaultIntegration || props.defaultIntegration) {
4754
throw new Error('Cannot specify "defaultIntegration" since Lambda integration is automatically defined');
4855
}
4956

5057
super(scope, id, {
51-
defaultIntegration: new LambdaIntegration(props.handler),
58+
defaultIntegration: new LambdaIntegration(props.handler, props.integrationOptions),
5259
...props.options, // deprecated, but we still support
5360
...props,
5461
});

packages/@aws-cdk/aws-apigateway/rosetta/default.ts-fixture

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Fixture with packages imported, but nothing else
22
import { Construct } from 'constructs';
3-
import { Stack } from '@aws-cdk/core';
3+
import { Duration, Stack } from '@aws-cdk/core';
44
import apigateway = require('@aws-cdk/aws-apigateway');
55
import cognito = require('@aws-cdk/aws-cognito');
66
import lambda = require('@aws-cdk/aws-lambda');
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import { Code, Function, Runtime } from '@aws-cdk/aws-lambda';
2+
import { App, Stack } from '@aws-cdk/core';
3+
import { Construct } from 'constructs';
4+
import { LambdaRestApi, PassthroughBehavior } from '../lib';
5+
6+
class LambdaApiIntegrationOptionsNonProxyIntegrationStack extends Stack {
7+
constructor(scope: Construct) {
8+
super(scope, 'LambdaApiIntegrationOptionsNonProxyIntegrationStack');
9+
10+
const fn = new Function(this, 'myfn', {
11+
code: Code.fromInline('foo'),
12+
runtime: Runtime.NODEJS_14_X,
13+
handler: 'index.handler',
14+
});
15+
16+
new LambdaRestApi(this, 'lambdarestapi', {
17+
handler: fn,
18+
integrationOptions: {
19+
proxy: false,
20+
passthroughBehavior: PassthroughBehavior.WHEN_NO_MATCH,
21+
integrationResponses: [
22+
{
23+
statusCode: '200',
24+
responseTemplates: {
25+
'application/json': JSON.stringify({ message: 'Hello, word' }),
26+
},
27+
},
28+
],
29+
},
30+
});
31+
}
32+
}
33+
34+
const app = new App();
35+
new LambdaApiIntegrationOptionsNonProxyIntegrationStack(app);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import { Code, Function, Runtime } from '@aws-cdk/aws-lambda';
2+
import { App, Duration, Stack } from '@aws-cdk/core';
3+
import { Construct } from 'constructs';
4+
import { LambdaRestApi } from '../lib';
5+
6+
class LambdaApiIntegrationOptionsStack extends Stack {
7+
constructor(scope: Construct) {
8+
super(scope, 'LambdaApiIntegrationOptionsStack');
9+
10+
const fn = new Function(this, 'myfn', {
11+
code: Code.fromInline('foo'),
12+
runtime: Runtime.NODEJS_14_X,
13+
handler: 'index.handler',
14+
});
15+
16+
new LambdaRestApi(this, 'lambdarestapi', {
17+
handler: fn,
18+
integrationOptions: {
19+
timeout: Duration.seconds(1),
20+
},
21+
});
22+
}
23+
}
24+
25+
const app = new App();
26+
new LambdaApiIntegrationOptionsStack(app);

0 commit comments

Comments
 (0)