Skip to content

Commit

Permalink
chore(release): 2.48.0 (#22664)
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored Oct 27, 2022
2 parents 3528e3d + 45abb4a commit e8725cb
Show file tree
Hide file tree
Showing 620 changed files with 25,042 additions and 2,835 deletions.
9 changes: 0 additions & 9 deletions .devcontainer.json

This file was deleted.

19 changes: 19 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM jsii/superchain:1-buster-slim

USER root

# Change uid/guid of superchain so it can work with the docker-in-docker feature
RUN groupmod --gid 1000 superchain \
&& usermod --uid 1000 --gid 1000 superchain \
&& chown -R 1000:1000 /home/superchain

USER superchain

# Setup oh-my-zsh
RUN sudo apt-get update && export DEBIAN_FRONTEND=noninteractive \
&& sudo apt-get -y install --no-install-recommends zsh vim \
&& sudo rm -rf /var/lib/apt/lists/* \
&& sudo chsh -s $(which zsh) $(whoami)
RUN sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended \
# Required, otherwise shell is extermly slow due the size of the aws-cdk
&& sudo sh -c 'echo "[oh-my-zsh]\n hide-dirty = 1" > /etc/gitconfig'
21 changes: 21 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "aws-cdk",
"build": {
"dockerfile": "Dockerfile"
},

"customizations": {
"vscode": {
"extensions": ["dbaeumer.vscode-eslint"]
}
},

"postCreateCommand": "yarn install",
"remoteUser": "superchain",
"features": {
"docker-in-docker": {
"version": "latest",
"moby": true
}
}
}
2 changes: 1 addition & 1 deletion .github/workflows/auto-approve.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ jobs:
permissions:
pull-requests: write
steps:
- uses: hmarr/auto-approve-action@v3.0.0
- uses: hmarr/auto-approve-action@v3.1.0
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
7 changes: 7 additions & 0 deletions CHANGELOG.v2.alpha.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

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.48.0-alpha.0](https://github.com/aws/aws-cdk/compare/v2.47.0-alpha.0...v2.48.0-alpha.0) (2022-10-27)


### Features

* **synthetics:** runtime version syn-nodejs-puppeteer-3.7 ([#22610](https://github.com/aws/aws-cdk/issues/22610)) ([326637c](https://github.com/aws/aws-cdk/commit/326637c2879657bfac33b5cc60dced7471abf7c8))

## [2.47.0-alpha.0](https://github.com/aws/aws-cdk/compare/v2.46.0-alpha.0...v2.47.0-alpha.0) (2022-10-20)


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.48.0](https://github.com/aws/aws-cdk/compare/v2.47.0...v2.48.0) (2022-10-27)


### Features

* **cfnspec:** cloudformation spec v93.0.0 ([#22562](https://github.com/aws/aws-cdk/issues/22562)) ([2afb718](https://github.com/aws/aws-cdk/commit/2afb718b02e8fef70729981c2f1cd5b23449dcde))
* **cfnspec:** cloudformation spec v94.0.0 ([#22599](https://github.com/aws/aws-cdk/issues/22599)) ([e5be100](https://github.com/aws/aws-cdk/commit/e5be10049047d29e9e687f5f4f39037275d51d38))
* **cfnspec:** cloudformation spec v94.0.0 ([#22649](https://github.com/aws/aws-cdk/issues/22649)) ([42160fc](https://github.com/aws/aws-cdk/commit/42160fc2e5532acfb6b97652f6ad0e3354b32baa))
* **cli:** allow disabling parallel asset publishing ([#22579](https://github.com/aws/aws-cdk/issues/22579)) ([69981ac](https://github.com/aws/aws-cdk/commit/69981ac07b40ce3f690f6c1ad0010b51f29103a6)), closes [#19367](https://github.com/aws/aws-cdk/issues/19367)
* **ec2:** Vpc supports allocating CIDR from AWS IPAM ([#22458](https://github.com/aws/aws-cdk/issues/22458)) ([7ed9cd1](https://github.com/aws/aws-cdk/commit/7ed9cd14aa5aaff90badb6438a0941fbca2d370c))
* **eks:** support for Kubernetes version 1.22 ([#22604](https://github.com/aws/aws-cdk/issues/22604)) ([91704aa](https://github.com/aws/aws-cdk/commit/91704aa3632dd6424017ae7aafebda832f309315)), closes [#20263](https://github.com/aws/aws-cdk/issues/20263)
* **rds:** dual-stack mode support ([#22596](https://github.com/aws/aws-cdk/issues/22596)) ([89a7365](https://github.com/aws/aws-cdk/commit/89a73651ccd619b9b1878c40214e4647095803de)), closes [#19525](https://github.com/aws/aws-cdk/issues/19525)


### Bug Fixes

* **apigateway:** relax access log format check to allow either requestId or extendedRequestId ([#22591](https://github.com/aws/aws-cdk/issues/22591)) ([1a16ad0](https://github.com/aws/aws-cdk/commit/1a16ad0bf422e17b8c56d1fe2581eda7c60e7522))
* **eks:** kubectl layer must contain AWS CLI ([#22559](https://github.com/aws/aws-cdk/issues/22559)) ([d8b4c09](https://github.com/aws/aws-cdk/commit/d8b4c091d85eb818c6e106416eea52d26f4fa73b))
* **ssm:** `StringParameter.fromSecureStringParameterAttributes` not working without version ([#22618](https://github.com/aws/aws-cdk/issues/22618)) ([b33b9b0](https://github.com/aws/aws-cdk/commit/b33b9b0a3ce2cfd79082bb743b36c6fda9e8278b)), closes [#18729](https://github.com/aws/aws-cdk/issues/18729) [#22311](https://github.com/aws/aws-cdk/issues/22311)

## [2.47.0](https://github.com/aws/aws-cdk/compare/v2.46.0...v2.47.0) (2022-10-20)


Expand Down
13 changes: 11 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ This document describes how to set up a development environment and submit your
let us know if it's not up-to-date (even better, submit a PR with your corrections ;-)).

- [Getting Started](#getting-started)
- [Local setup](#setup)
- [Dev Container](#dev-container)
- [Pull Requests](#pull-requests)
- [Step 1: Find something to work on](#step-1-find-something-to-work-on)
- [Step 2: Design (optional)](#step-2-design)
Expand All @@ -23,7 +25,7 @@ let us know if it's not up-to-date (even better, submit a PR with your correcti
- [Breaking Changes](#breaking-changes)
- [Documentation](#documentation)
- [Rosetta](#rosetta)
- [Tools](#tools)
- [Tools](#tools-advanced)
- [Linters](#linters)
- [cfn2ts](#cfn2ts)
- [scripts/foreach.sh](#scriptsforeachsh)
Expand Down Expand Up @@ -147,7 +149,14 @@ docker$ exit

The `dist/` folder within each module contains the packaged up language artifacts.

## Gitpod (Alternative)
### Dev Container

The AWS CDK provides a VS Code Dev Container with all dependencies pre-installed.
Please follow the [setup instructions](https://code.visualstudio.com/docs/remote/containers-tutorial) to configure VS Code.

With VS Code setup, you will be prompted to open the `aws-cdk` repo in a Dev Container, or you can choos "Dev Containers: Reopen in Container" from the VS Code command palette.

### Gitpod (Alternative)

You may also set up your local development environment using [Gitpod](http://gitpod.io) -
a service that allows you to spin up an in-browser Visual Studio Code-compatible editor,
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@
"devDependencies": {
"@types/prettier": "2.6.0",
"@yarnpkg/lockfile": "^1.1.0",
"cdk-generate-synthetic-examples": "^0.1.36",
"cdk-generate-synthetic-examples": "^0.1.43",
"conventional-changelog-cli": "^2.2.2",
"fs-extra": "^9.1.0",
"graceful-fs": "^4.2.10",
"jest-junit": "^13.2.0",
"jsii-diff": "^1.69.0",
"jsii-pacmak": "^1.69.0",
"jsii-reflect": "^1.69.0",
"jsii-rosetta": "^1.69.0",
"jsii-diff": "^1.70.0",
"jsii-pacmak": "^1.70.0",
"jsii-reflect": "^1.70.0",
"jsii-rosetta": "^1.70.0",
"lerna": "^4.0.0",
"patch-package": "^6.4.7",
"patch-package": "^6.5.0",
"semver": "^6.3.0",
"standard-version": "^9.5.0",
"typescript": "~3.9.10"
Expand Down
26 changes: 13 additions & 13 deletions packages/@aws-cdk/aws-apigateway/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,13 @@ You can use Amazon API Gateway with AWS Step Functions as the backend integratio

The `StepFunctionsRestApi` only supports integration with Synchronous Express state machine. The `StepFunctionsRestApi` construct makes this easy by setting up input, output and error mapping.

The construct sets up an API endpoint and maps the `ANY` HTTP method and any calls to the API endpoint starts an express workflow execution for the underlying state machine.
The construct sets up an API endpoint and maps the `ANY` HTTP method and any calls to the API endpoint starts an express workflow execution for the underlying state machine.

Invoking the endpoint with any HTTP method (`GET`, `POST`, `PUT`, `DELETE`, ...) in the example below will send the request to the state machine as a new execution. On success, an HTTP code `200` is returned with the execution output as the Response Body.

If the execution fails, an HTTP `500` response is returned with the `error` and `cause` from the execution output as the Response Body. If the request is invalid (ex. bad execution input) HTTP code `400` is returned.

The response from the invocation contains only the `output` field from the
The response from the invocation contains only the `output` field from the
[StartSyncExecution](https://docs.aws.amazon.com/step-functions/latest/apireference/API_StartSyncExecution.html#API_StartSyncExecution_ResponseSyntax) API.
In case of failures, the fields `error` and `cause` are returned as part of the response.
Other metadata such as billing details, AWS account ID and resource ARNs are not returned in the API response.
Expand All @@ -154,7 +154,7 @@ const stateMachine: stepfunctions.IStateMachine = new stepfunctions.StateMachine
definition: stateMachineDefinition,
stateMachineType: stepfunctions.StateMachineType.EXPRESS,
});

new apigateway.StepFunctionsRestApi(this, 'StepFunctionsRestApi', {
deploy: true,
stateMachine: stateMachine,
Expand All @@ -172,7 +172,7 @@ AWS Step Functions will receive the request body in its input as follows:
```json
{
"body": {
"customerId": 1
"customerId": 1
},
"path": "/",
"querystring": {}
Expand Down Expand Up @@ -1128,8 +1128,8 @@ Access logging creates logs every time an API method is accessed. Access logs ca
who has accessed the API, how the caller accessed the API and what responses were generated.
Access logs are configured on a Stage of the RestApi.
Access logs can be expressed in a format of your choosing, and can contain any access details, with a
minimum that it must include the 'requestId'. The list of variables that can be expressed in the access
log can be found
minimum that it must include either 'requestId' or 'extendedRequestId'. The list of variables that
can be expressed in the access log can be found
[here](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-mapping-template-reference.html#context-variable-reference).
Read more at [Setting Up CloudWatch API Logging in API
Gateway](https://docs.aws.amazon.com/apigateway/latest/developerguide/set-up-logging.html)
Expand All @@ -1140,9 +1140,9 @@ const prdLogGroup = new logs.LogGroup(this, "PrdLogs");
const api = new apigateway.RestApi(this, 'books', {
deployOptions: {
accessLogDestination: new apigateway.LogGroupLogDestination(prdLogGroup),
accessLogFormat: apigateway.AccessLogFormat.jsonWithStandardFields()
}
})
accessLogFormat: apigateway.AccessLogFormat.jsonWithStandardFields(),
},
});
const deployment = new apigateway.Deployment(this, 'Deployment', {api});

// development stage
Expand All @@ -1159,8 +1159,8 @@ new apigateway.Stage(this, 'dev', {
resourcePath: true,
responseLength: true,
status: true,
user: true
})
user: true,
}),
});
```

Expand Down Expand Up @@ -1378,8 +1378,8 @@ api.addGatewayResponse('test-response', {
type: apigateway.ResponseType.ACCESS_DENIED,
statusCode: '500',
responseHeaders: {
'Access-Control-Allow-Origin': "test.com",
'test-key': 'test-value'
'Access-Control-Allow-Origin': 'test.com',
'test-key': 'test-value',
},
templates: {
'application/json': '{ "message": $context.error.messageString, "statusCode": "488", "type": "$context.error.responseType" }'
Expand Down
3 changes: 2 additions & 1 deletion packages/@aws-cdk/aws-apigateway/lib/gateway-response.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { IResource, Resource } from '@aws-cdk/core';
import { Construct } from 'constructs';
import { CfnGatewayResponse, CfnGatewayResponseProps } from './apigateway.generated';
import { IRestApi } from './restapi';
import { normalizeResponseParameterValue } from './util';

/**
* Represents gateway response resource.
Expand Down Expand Up @@ -88,7 +89,7 @@ export class GatewayResponse extends Resource implements IGatewayResponse {

const responseParameters: { [key: string]: string } = {};
for (const [header, value] of Object.entries(responseHeaders)) {
responseParameters[`gatewayresponse.header.${header}`] = value;
responseParameters[`gatewayresponse.header.${header}`] = normalizeResponseParameterValue(value) ;
}
return responseParameters;
}
Expand Down
8 changes: 5 additions & 3 deletions packages/@aws-cdk/aws-apigateway/lib/stage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ export interface StageOptions extends MethodDeploymentOptions {

/**
* A single line format of access logs of data, as specified by selected $content variables.
* The format must include at least `AccessLogFormat.contextRequestId()`.
* The format must include either `AccessLogFormat.contextRequestId()`
* or `AccessLogFormat.contextExtendedRequestId()`.
*
* @see https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-mapping-template-reference.html#context-variable-reference
*
* @default - Common Log Format
Expand Down Expand Up @@ -387,9 +389,9 @@ export class Stage extends StageBase {
} else {
if (accessLogFormat !== undefined &&
!Token.isUnresolved(accessLogFormat.toString()) &&
!/.*\$context.requestId.*/.test(accessLogFormat.toString())) {
!/.*\$context.(requestId|extendedRequestId)\b.*/.test(accessLogFormat.toString())) {

throw new Error('Access log must include at least `AccessLogFormat.contextRequestId()`');
throw new Error('Access log must include either `AccessLogFormat.contextRequestId()` or `AccessLogFormat.contextExtendedRequestId()`');
}
if (accessLogFormat !== undefined && accessLogDestination === undefined) {
throw new Error('Access log format is specified without a destination');
Expand Down
16 changes: 16 additions & 0 deletions packages/@aws-cdk/aws-apigateway/lib/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,22 @@ export function validateHttpMethod(method: string, messagePrefix: string = '') {
}
}

/**
* Response header values need to be enclosed in single quotes.
*/
export function normalizeResponseParameterValue(value: string) {
if (!value) {
return value;
}

// check if the value is already enclosed in single quotes
if (value.startsWith("'") && value.endsWith("'")) {
return value;
}

return `'${value}'`;
}

export function parseMethodOptionsPath(originalPath: string): { resourcePath: string, httpMethod: string } {
if (!originalPath.startsWith('/')) {
throw new Error(`Method options path must start with '/': ${originalPath}`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ describe('gateway response', () => {
responseHeaders: {
'Access-Control-Allow-Origin': 'test.com',
'test-key': 'test-value',
'another-test': "'test-value-enclosed-within-single-quotes'",
},
});

Expand All @@ -54,8 +55,9 @@ describe('gateway response', () => {
RestApiId: stack.resolve(api.restApiId),
StatusCode: '500',
ResponseParameters: {
'gatewayresponse.header.Access-Control-Allow-Origin': 'test.com',
'gatewayresponse.header.test-key': 'test-value',
'gatewayresponse.header.Access-Control-Allow-Origin': "'test.com'",
'gatewayresponse.header.test-key': "'test-value'",
'gatewayresponse.header.another-test': "'test-value-enclosed-within-single-quotes'",
},
ResponseTemplates: Match.absent(),
});
Expand Down
Loading

0 comments on commit e8725cb

Please sign in to comment.