Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(release): 2.43.0 #22176

Merged
merged 27 commits into from
Sep 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
b3c9464
fix(certificatemanager): unable to set removal policy on DnsValidated…
corymhall Sep 15, 2022
2e797b5
Revert "fix(certificatemanager): unable to set removal policy on DnsV…
corymhall Sep 15, 2022
22a1a8c
Merge branch 'main' into merge-back/2.42.0
mergify[bot] Sep 16, 2022
5fc7ca2
chore(merge-back): 2.42.0 (#22084)
mergify[bot] Sep 16, 2022
d0e0ab9
fix(integ-tests): can't enable lookups when creating an IntegTest (#2…
corymhall Sep 17, 2022
ce27789
fix(codedeploy): unable to configure disable automatically rollback (…
msysh Sep 17, 2022
b8c2abf
docs(aws-lambda): mark NODEJS_12_X as deprecated (#22093)
coderbyheart Sep 19, 2022
8280709
fix(cli): Lambda hotswap fails if environment contains tokens (#22099)
tmokmss Sep 19, 2022
dbede40
feat(ec2): flowlog setting add MaxAggregationInterval (#22098)
watany-dev Sep 19, 2022
205e493
revert(init-templates): csharp and fsharp app init fails when path co…
iliapolo Sep 19, 2022
ce0f018
Merge branch 'main' into merge-back/2.42.1
mergify[bot] Sep 19, 2022
53fd0e6
chore(merge-back): 2.42.1 (#22128)
mergify[bot] Sep 19, 2022
6840bc3
chore: Updating the prlinter (#22113)
Naumel Sep 20, 2022
384ba2b
fix(cli): "EACCES: Permission denied" on 'cdk init' (#22111)
rix0rrr Sep 20, 2022
e860ffc
chore(rds): add mysql engine version 8.0.30 (#22114)
WinterYukky Sep 20, 2022
35b2806
fix(integ-tests): AwsApiCall Custom Resource length could be greater …
dontirun Sep 20, 2022
a4364ce
fix(api-gateway): SpecRestApi ignores disableExecuteApiEndpoint prope…
TheRealAmazonKendra Sep 20, 2022
291bf34
chore(pr-lint): provide output to user in comments (#22029)
TheRealAmazonKendra Sep 20, 2022
cfaf2ba
chore(pr-linter): use github-actions bot to write to PRs (#22152)
TheRealAmazonKendra Sep 20, 2022
9f0264c
docs(iam): hints at accountId as string type (#22149)
misterjacko Sep 21, 2022
ce59b6a
fix(s3-deployment): fails when `destinationKeyPrefix` is a token with…
iliapolo Sep 21, 2022
edfd3e2
chore: introduce github merit badger workflow (#21898)
kaizencc Sep 21, 2022
fbb941f
feat(stepfunctions-tasks): additional IAM statements for AWS SDK serv…
jogold Sep 21, 2022
fd41cdd
chore: add bots to list of ignore-usernames (#22171)
scanlonp Sep 21, 2022
9726e8f
feat(cfnspec): cloudformation spec v89.0.0 (#22105)
aws-cdk-automation Sep 21, 2022
ee83650
chore(release): 2.43.0
Sep 21, 2022
89ebd94
Update CHANGELOG.v2.md
iliapolo Sep 21, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@ Owner: Core CDK team
[issue-label-assign.yml](issue-label-assign.yml): Github action for automatically adding labels and/or setting assignees when an Issue or PR is opened or edited based on user-defined Area
Owner: CDK support team

### PR Labeler
[pr-labeler.yml](pr-labeler.yml): GitHub action for automatically porting triage labels from issues
linked in the PR description to the PR.
Owner: Core CDK team

### GitHub Merit Badger
[github-merit-badger.yml](github-merit-badger.yml): GitHub action that adds 'merit badges' to pull
requests based on the users prior contributions to the CDK.
Owner: Core CDK team

## Issue Triggered

### Closed Issue Message
Expand All @@ -44,4 +54,9 @@ Owner: CDK support team
### Yarn Upgrader
[yarn-upgrade.yml](yarn-upgrade.yml): Upgrades yarn dependencies and creates a
patch file for downloading.
Owner: Core CDK team

### Issue Reprioritizer
[issue-reprioritization.yml](issue-reprioritization.yml): GitHub action that labels `p2`
issues as `p1` if a certain level of community engagement is met.
Owner: Core CDK team
20 changes: 20 additions & 0 deletions .github/workflows/github-merit-badger.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: github-merit-badger
on:
pull_request_target:
types:
- opened

jobs:
call-action:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: kaizencc/github-merit-badger@main
id: merit-badger
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
badges: '[beginning-contributor,repeat-contributor,valued-contributor,admired-contributor,star-contributor,distinguished-contributor]'
thresholds: '[0,3,6,13,25,50]'
badge-type: 'achievement'
ignore-usernames: '[RomainMuller,rix0rrr,Jerry-AWS,MrArnoldPalmer,iliapolo,otaviomacedo,madeline-k,kaizencc,comcalvi,corymhall,peterwoodworth,ryparker,TheRealAmazonKendra,vinayak-kukreja,Naumel,mrgrain,aws-cdk-automation,dependabot,mergify]'
2 changes: 1 addition & 1 deletion .github/workflows/pr-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
validate-pr:
permissions:
contents: read
pull-requests: read
pull-requests: write
runs-on: ubuntu-latest
steps:

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

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


### Bug Fixes

* **integ-tests:** AwsApiCall Custom Resource length could be greater than 60 characters ([#22119](https://github.com/aws/aws-cdk/issues/22119)) ([35b2806](https://github.com/aws/aws-cdk/commit/35b280616a420987b6553f73bc91a736b06d4e1a))
* **integ-tests:** can't enable lookups when creating an IntegTest ([#22075](https://github.com/aws/aws-cdk/issues/22075)) ([d0e0ab9](https://github.com/aws/aws-cdk/commit/d0e0ab9d3744372edd56aa984daac4de26272673))

## [2.42.1-alpha.0](https://github.com/aws/aws-cdk/compare/v2.42.0-alpha.0...v2.42.1-alpha.0) (2022-09-19)

## [2.42.0-alpha.0](https://github.com/aws/aws-cdk/compare/v2.41.0-alpha.0...v2.42.0-alpha.0) (2022-09-15)
Expand Down
20 changes: 20 additions & 0 deletions CHANGELOG.v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,26 @@

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.43.0](https://github.com/aws/aws-cdk/compare/v2.42.1...v2.43.0) (2022-09-21)


### Features

* **cfnspec:** cloudformation spec v89.0.0 ([#22105](https://github.com/aws/aws-cdk/issues/22105)) ([9726e8f](https://github.com/aws/aws-cdk/commit/9726e8fa07bcf496c79f8ab3be1c9f04b0e5dc3a))
* **ec2:** flowlog setting add MaxAggregationInterval ([#22098](https://github.com/aws/aws-cdk/issues/22098)) ([dbede40](https://github.com/aws/aws-cdk/commit/dbede408ee21e2e62137867a7fd040890daf77c7))
* **stepfunctions-tasks:** additional IAM statements for AWS SDK service integration ([#22070](https://github.com/aws/aws-cdk/issues/22070)) ([fbb941f](https://github.com/aws/aws-cdk/commit/fbb941f848fc363c93ae79d899532ed4522f31b1)), closes [#22006](https://github.com/aws/aws-cdk/issues/22006)


### Bug Fixes

* **api-gateway:** SpecRestApi ignores disableExecuteApiEndpoint property ([#22133](https://github.com/aws/aws-cdk/issues/22133)) ([a4364ce](https://github.com/aws/aws-cdk/commit/a4364ceb9a5303768c5c1447857af44f1fe9e8ce)), closes [#21295](https://github.com/aws/aws-cdk/issues/21295)
* **certificatemanager:** unable to set removal policy on DnsValidatedCertificate ([#22040](https://github.com/aws/aws-cdk/issues/22040)) ([b3c9464](https://github.com/aws/aws-cdk/commit/b3c9464d0e0d333db132daec96cdd283145a6ce5)), closes [#20649](https://github.com/aws/aws-cdk/issues/20649)
* **cli:** "EACCES: Permission denied" on 'cdk init' ([#22111](https://github.com/aws/aws-cdk/issues/22111)) ([384ba2b](https://github.com/aws/aws-cdk/commit/384ba2b7fc2ae9c5a70d0e5633fcc463b2cea282)), closes [#21049](https://github.com/aws/aws-cdk/issues/21049) [#22090](https://github.com/aws/aws-cdk/issues/22090)
* **cli:** Lambda hotswap fails if environment contains tokens ([#22099](https://github.com/aws/aws-cdk/issues/22099)) ([8280709](https://github.com/aws/aws-cdk/commit/8280709219d95ac4bd76e21bfe8214a02afaa413)), closes [#22088](https://github.com/aws/aws-cdk/issues/22088)
* **codedeploy:** unable to configure disable automatically rollback ([#22083](https://github.com/aws/aws-cdk/issues/22083)) ([ce27789](https://github.com/aws/aws-cdk/commit/ce277899e9df2ae9d69e94bdaa931e130cd4c95a)), closes [#21691](https://github.com/aws/aws-cdk/issues/21691)
* **s3-deployment:** fails when `destinationKeyPrefix` is a token with a long string representation ([#22163](https://github.com/aws/aws-cdk/issues/22163)) ([ce59b6a](https://github.com/aws/aws-cdk/commit/ce59b6aaa7a19ec074547824c3641822ab853213))


## [2.42.1](https://github.com/aws/aws-cdk/compare/v2.42.0...v2.42.1) (2022-09-19)


Expand Down
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -267,10 +267,10 @@ Integration tests perform a few functions in the CDK code base -

The following list contains common scenarios where we _know_ that integration tests are required.
This is not an exhaustive list and we will, by default, require integration tests for all
new features unless there is a good reason why one is not needed.
new features and all fixes unless there is a good reason why one is not needed.

1. Adding a new feature that is using previously unused CloudFormation resource types
2. Adding a new feature that is using previously unused (or untested) CloudFormation properties
1. Adding a new feature
2. Adding a fix to an existing feature
3. Involves configuring resource types across services (i.e. integrations)
4. Adding a new supported version (e.g. a new [AuroraMysqlEngineVersion](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_rds.AuroraMysqlEngineVersion.html))
5. Adding any functionality via a [Custom Resource](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.custom_resources-readme.html)
Expand Down
1 change: 1 addition & 0 deletions packages/@aws-cdk/aws-apigateway/lib/restapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -652,6 +652,7 @@ export class SpecRestApi extends RestApiBase {
bodyS3Location: apiDefConfig.inlineDefinition ? undefined : apiDefConfig.s3Location,
endpointConfiguration: this._configureEndpoints(props),
parameters: props.parameters,
disableExecuteApiEndpoint: props.disableExecuteApiEndpoint,
});

props.apiDefinition.bindAfterCreate(this, this);
Expand Down
92 changes: 92 additions & 0 deletions packages/@aws-cdk/aws-apigateway/test/integ.spec-restapi.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
import * as path from 'path';
import * as lambda from '@aws-cdk/aws-lambda';
import * as cdk from '@aws-cdk/core';
import { IntegTest } from '@aws-cdk/integ-tests';
import * as apigateway from '../lib';

class Test extends cdk.Stack {
constructor(scope: cdk.App, id: string) {
super(scope, id);

const api = new apigateway.SpecRestApi(this, 'my-api', {
apiDefinition: apigateway.ApiDefinition.fromAsset(path.join(__dirname, 'sample-definition.yaml')),
disableExecuteApiEndpoint: true,
retainDeployments: true,
cloudWatchRole: true,
deployOptions: {
cacheClusterEnabled: true,
stageName: 'beta',
description: 'beta stage',
loggingLevel: apigateway.MethodLoggingLevel.INFO,
dataTraceEnabled: true,
methodOptions: {
'/api/appliances/GET': {
cachingEnabled: true,
},
},
},
});

const handler = new lambda.Function(this, 'MyHandler', {
runtime: lambda.Runtime.NODEJS_14_X,
code: lambda.Code.fromInline(`exports.handler = ${handlerCode}`),
handler: 'index.handler',
});

const v1 = api.root.addResource('v1');

const integration = new apigateway.LambdaIntegration(handler);

const toys = v1.addResource('toys');
const getToysMethod: apigateway.Method = toys.addMethod('GET', integration, { apiKeyRequired: true });
toys.addMethod('POST');
toys.addMethod('PUT');

const appliances = v1.addResource('appliances');
appliances.addMethod('GET');

const books = v1.addResource('books');
books.addMethod('GET', integration);
books.addMethod('POST', integration);

function handlerCode(event: any, _: any, callback: any) {
return callback(undefined, {
isBase64Encoded: false,
statusCode: 200,
headers: { 'content-type': 'application/json' },
body: JSON.stringify(event),
});
}

const key = api.addApiKey('ApiKey');
const plan = api.addUsagePlan('UsagePlan', {
name: 'Basic',
apiKey: key,
description: 'Free tier monthly usage plan',
throttle: { rateLimit: 5 },
quota: {
limit: 10000,
period: apigateway.Period.MONTH,
},
});
plan.addApiStage({
stage: api.deploymentStage,
throttle: [
{
method: getToysMethod,
throttle: {
rateLimit: 10,
burstLimit: 2,
},
},
],
});
}
}

const app = new cdk.App();

const testCase = new Test(app, 'test-apigateway-spec-restapi');
new IntegTest(app, 'apigateway-spec-restapi', {
testCases: [testCase],
});
49 changes: 48 additions & 1 deletion packages/@aws-cdk/aws-apigateway/test/restapi.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1150,7 +1150,21 @@ describe('restapi', () => {
});
});

test('"disableExecuteApiEndpoint" can disable the default execute-api endpoint', () => {
test('disableExecuteApiEndpoint is false when set to false in RestApi', () => {
// GIVEN
const stack = new Stack();

// WHEN
const api = new apigw.RestApi(stack, 'my-api', { disableExecuteApiEndpoint: false });
api.root.addMethod('GET');

// THEN
Template.fromStack(stack).hasResourceProperties('AWS::ApiGateway::RestApi', {
DisableExecuteApiEndpoint: false,
});
});

test('disableExecuteApiEndpoint is true when set to true in RestApi', () => {
// GIVEN
const stack = new Stack();

Expand All @@ -1164,6 +1178,39 @@ describe('restapi', () => {
});
});

test('disableExecuteApiEndpoint is false when set to false in SpecRestApi', () => {
// GIVEN
const stack = new Stack();

// WHEN
const api = new apigw.SpecRestApi(stack, 'my-api', {
apiDefinition: apigw.ApiDefinition.fromInline({ foo: 'bar' }),
disableExecuteApiEndpoint: false,
});
api.root.addMethod('GET');

// THEN
Template.fromStack(stack).hasResourceProperties('AWS::ApiGateway::RestApi', {
DisableExecuteApiEndpoint: false,
});
});

test('disableExecuteApiEndpoint is true when set to true in SpecRestApi', () => {
// GIVEN
const stack = new Stack();

// WHEN
const api = new apigw.SpecRestApi(stack, 'my-api', {
apiDefinition: apigw.ApiDefinition.fromInline({ foo: 'bar' }),
disableExecuteApiEndpoint: true,
});
api.root.addMethod('GET');

// THEN
Template.fromStack(stack).hasResourceProperties('AWS::ApiGateway::RestApi', {
DisableExecuteApiEndpoint: true,
});
});

describe('Description', () => {
test('description can be set', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"version": "21.0.0",
"files": {
"21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": {
"source": {
"path": "apigatewayspecrestapiDefaultTestDeployAssertD16AA485.template.json",
"packaging": "file"
},
"destinations": {
"current_account-current_region": {
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
"objectKey": "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json",
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
}
}
}
},
"dockerImages": {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"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
@@ -0,0 +1,30 @@
openapi: "3.0.2"
info:
version: 1.0.0
title: Test API for CDK
paths:
/pets:
get:
summary: Test Method
operationId: testMethod
responses:
"200":
description: A paged array of pets
content:
application/json:
schema:
$ref: "#/components/schemas/Empty"
x-amazon-apigateway-integration:
responses:
default:
statusCode: "200"
requestTemplates:
application/json: "{\"statusCode\": 200}"
passthroughBehavior: when_no_match
type: mock

components:
schemas:
Empty:
title: Empty Schema
type: object
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"version":"21.0.0"}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"version": "21.0.0",
"testCases": {
"apigateway-spec-restapi/DefaultTest": {
"stacks": [
"test-apigateway-spec-restapi"
],
"assertionStack": "apigateway-spec-restapi/DefaultTest/DeployAssert",
"assertionStackName": "apigatewayspecrestapiDefaultTestDeployAssertD16AA485"
}
}
}
Loading