Skip to content

Commit

Permalink
chore(release): 2.43.0 (#22176)
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored Sep 21, 2022
2 parents 48a95f1 + 89ebd94 commit 487870a
Show file tree
Hide file tree
Showing 295 changed files with 8,704 additions and 965 deletions.
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

0 comments on commit 487870a

Please sign in to comment.