Skip to content

Commit 5862f7a

Browse files
authored
2 parents fb67c77 + e1be4b6 commit 5862f7a

File tree

469 files changed

+15473
-4600
lines changed

Some content is hidden

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

469 files changed

+15473
-4600
lines changed

.github/workflows/issue-label-assign.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ env:
7070
[
7171
{"area":"package/tools","keywords":["cli","command line","init","synth","diff","bootstrap"],"labels":["package/tools"],"enableGlobalAffixes":false},
7272
{"area":"@aws-cdk/alexa-ask","keywords":["alexa-ask","alexa"],"labels":["@aws-cdk/alexa-ask"]},
73-
{"area":"@aws-cdk/app-delivery","keywords":["app-delivery"],"labels":["@aws-cdk/app-delivery"]},
7473
{"area":"@aws-cdk/assert","keywords":["assert"],"labels":["@aws-cdk/assert"]},
7574
{"area":"@aws-cdk/assertions","keywords":["assertions"],"labels":["@aws-cdk/assertions"]},
7675
{"area":"@aws-cdk/assets","keywords":["assets","staging"],"labels":["@aws-cdk/assets"]},
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: pr-linter-exemption-labeler
2+
on:
3+
issue_comment:
4+
types:
5+
- created
6+
- edited
7+
- deleted
8+
9+
jobs:
10+
pr_commented:
11+
name: PR Comment
12+
if: ${{ (github.event.issue.pull_request) && (github.event.issue.state == 'open') }}
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: TheRealAmazonKendra/pr-linter-exemption-labeler@main
16+
with:
17+
github-token: ${{ secrets.PROJEN_GITHUB_TOKEN }}

.github/workflows/yarn-upgrade-v1main.yml

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626

2727
- name: Locate Yarn cache
2828
id: yarn-cache
29-
run: echo "::set-output name=dir::$(yarn cache dir)"
29+
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
3030

3131
- name: Restore Yarn cache
3232
uses: actions/cache@v3
@@ -39,34 +39,30 @@ jobs:
3939
run: yarn install --frozen-lockfile
4040
- name: Install Tools
4141
run: |-
42-
npm -g install lerna npm-check-updates@^9.0.0
42+
npm -g install lerna js-yaml npm-check-updates@^9.0.0
4343
- name: Build CLI
44-
run: cd packages/aws-cdk && ../../scripts/buildup
44+
run: lerna run build --scope aws-cdk --include-dependencies --stream
4545
- name: Build Integ Runner
46-
run: cd packages/@aws-cdk/integ-runner && ../../../scripts/buildup
46+
run: lerna run build --scope @aws-cdk/integ-runner --include-dependencies --stream
4747
- name: List Mono-Repo Packages
4848
id: list-packages
4949
# These need to be ignored from the `ncu` runs!
5050
run: |-
51-
echo -n "::set-output name=list::"
52-
node -p "$(lerna ls --all --json 2>/dev/null).map(item => item.name).join(',')"
51+
echo "list=$(lerna ls --all --json 2>/dev/null | jq -r 'map(.name) | join(",")')" >> $GITHUB_OUTPUT
5352
- name: Run "ncu -u"
54-
# We special-case @types/node because we want to stay on the current major (minimum supported node release)
55-
# We special-case @types/fs-extra because the current major (9.x) is broken with @types/node >= 10
53+
# We special-case some @types because they need to be pinned to specific versions due to breaking changes in minor upgrades https://github.com/DefinitelyTyped/DefinitelyTyped/issues/64266
5654
# We special-case aws-sdk because of breaking changes with TS interface exports in recent minor versions - https://github.com/aws/aws-sdk-js/issues/3453
57-
# We special-case typescript because it's not semantically versionned
55+
# We special-case typescript because it's not semantically versioned
5856
# We special-case constructs because we want to stay in control of the minimum compatible version
5957
# We special-case lerna because we have a patch on it that stops applying if Lerna upgrades. Remove this once https://github.com/lerna/lerna/pull/2874 releases.
6058
# We special-case aws-sdk-mock because of breaking changes in type exports https://github.com/dwyl/aws-sdk-mock/pull/260. We are not respecting `@ts-ignore`
6159
run: |-
6260
# Upgrade dependencies at repository root
63-
ncu --upgrade --filter=@types/node,@types/fs-extra --target=minor
6461
ncu --upgrade --filter=typescript --target=patch
65-
ncu --upgrade --reject=@types/node,@types/prettier,@types/fs-extra,constructs,typescript,lerna --target=minor
62+
ncu --upgrade --reject=@types/node,@types/prettier,constructs,typescript,lerna --target=minor
6663
# Upgrade all the packages
67-
lerna exec --parallel ncu -- --upgrade --filter=@types/node,@types/fs-extra --target=minor
6864
lerna exec --parallel ncu -- --upgrade --filter=typescript --target=patch
69-
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
65+
lerna exec --parallel ncu -- --upgrade --reject='@types/node,@types/prettier,constructs,typescript,aws-sdk,aws-sdk-mock,${{ steps.list-packages.outputs.list }}' --target=minor
7066
7167
# This will ensure the current lockfile is up-to-date with the dependency specifications (necessary for "yarn update" to run)
7268
- name: Run "yarn install"

.github/workflows/yarn-upgrade.yml

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,32 +37,28 @@ jobs:
3737
run: yarn install --frozen-lockfile
3838
- name: Install Tools
3939
run: |-
40-
npm -g install lerna npm-check-updates@^9.0.0
40+
npm -g install lerna js-yaml npm-check-updates@^9.0.0
4141
- name: Build Integ Runner
42-
run: cd packages/@aws-cdk/integ-runner && ../../../scripts/buildup
42+
run: lerna run build --scope @aws-cdk/integ-runner --include-dependencies
4343
- name: List Mono-Repo Packages
4444
id: list-packages
4545
# These need to be ignored from the `ncu` runs!
4646
run: |-
47-
echo -n "::set-output name=list::"
48-
echo "list=$(lerna ls --all --json 2>/dev/null | jq -r 'map(.name) | join(",")')" >> $GITHUB_OUTPUT
47+
echo "list=$(lerna ls --all --json 2>/dev/null | jq -r 'map(.name) | join(",")')" >> $GITHUB_OUTPUT
4948
- name: Run "ncu -u"
50-
# We special-case @types/node because we want to stay on the current major (minimum supported node release)
51-
# We special-case @types/fs-extra because the current major (9.x) is broken with @types/node >= 10
49+
# We special-case some @types because they need to be pinned to specific versions due to breaking changes in minor upgrades https://github.com/DefinitelyTyped/DefinitelyTyped/issues/64266
5250
# We special-case aws-sdk because of breaking changes with TS interface exports in recent minor versions - https://github.com/aws/aws-sdk-js/issues/3453
53-
# We special-case typescript because it's not semantically versionned
51+
# We special-case typescript because it's not semantically versioned
5452
# We special-case constructs because we want to stay in control of the minimum compatible version
5553
# We special-case lerna because we have a patch on it that stops applying if Lerna upgrades. Remove this once https://github.com/lerna/lerna/pull/2874 releases.
5654
# We special-case aws-sdk-mock because of breaking changes in type exports https://github.com/dwyl/aws-sdk-mock/pull/260. We are not respecting `@ts-ignore`
5755
run: |-
5856
# Upgrade dependencies at repository root
59-
ncu --upgrade --filter=@types/node,@types/fs-extra --target=minor
6057
ncu --upgrade --filter=typescript --target=patch
61-
ncu --upgrade --reject=@types/node,@types/prettier,@types/fs-extra,constructs,typescript,lerna --target=minor
58+
ncu --upgrade --reject=@types/node,@types/prettier,constructs,typescript,lerna --target=minor
6259
# Upgrade all the packages
63-
lerna exec --parallel ncu -- --upgrade --filter=@types/node,@types/fs-extra --target=minor
6460
lerna exec --parallel ncu -- --upgrade --filter=typescript --target=patch
65-
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
61+
lerna exec --parallel ncu -- --upgrade --reject='@types/node,@types/prettier,constructs,typescript,aws-sdk,aws-sdk-mock,${{ steps.list-packages.outputs.list }}' --target=minor
6662
# Upgrade package.jsons in init templates
6763
for pj in $(find packages/aws-cdk/lib/init-templates -name package.json); do
6864
(cd $(dirname $pj) && ncu --upgrade --reject='constructs,${{ steps.list-packages.outputs.list }}')

CHANGELOG.v2.alpha.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@
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.65.0-alpha.0](https://github.com/aws/aws-cdk/compare/v2.64.0-alpha.0...v2.65.0-alpha.0) (2023-02-15)
6+
7+
8+
### Features
9+
10+
* **glue:** support Ray jobs ([#23822](https://github.com/aws/aws-cdk/issues/23822)) ([8de50d6](https://github.com/aws/aws-cdk/commit/8de50d624c8703a12713dcffbc764688868f22b0))
11+
* **redshift:** IAM roles can be attached to a cluster, post creation ([#23791](https://github.com/aws/aws-cdk/issues/23791)) ([1a46808](https://github.com/aws/aws-cdk/commit/1a46808b03e8f6d09846f999ae3dc65b190f5f26)), closes [#22632](https://github.com/aws/aws-cdk/issues/22632)
12+
* **synthetics:** support runtime 3.9 ([#24101](https://github.com/aws/aws-cdk/issues/24101)) ([9d23cad](https://github.com/aws/aws-cdk/commit/9d23caded8aca42d3b78de1bc7e89c38a4d6805e))
13+
514
## [2.64.0-alpha.0](https://github.com/aws/aws-cdk/compare/v2.63.2-alpha.0...v2.64.0-alpha.0) (2023-02-09)
615

716

CHANGELOG.v2.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,32 @@
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.65.0](https://github.com/aws/aws-cdk/compare/v2.64.0...v2.65.0) (2023-02-15)
6+
7+
8+
### Features
9+
10+
* **autoscaling:** L2 construct for enabling capacity rebalance of autoscaling ([#24025](https://github.com/aws/aws-cdk/issues/24025)) ([d2c63f5](https://github.com/aws/aws-cdk/commit/d2c63f55f8657315ad4e4dd463cfcae07cb66e53)), closes [#22625](https://github.com/aws/aws-cdk/issues/22625)
11+
* **chatbot:** support guardrail policies ([#24114](https://github.com/aws/aws-cdk/issues/24114)) ([4c72a7d](https://github.com/aws/aws-cdk/commit/4c72a7dc3994ba190f1e1aa467d3087228bcb881)), closes [#20788](https://github.com/aws/aws-cdk/issues/20788)
12+
* **core:** Allow passing Docker build secrets ([#23778](https://github.com/aws/aws-cdk/issues/23778)) ([74512fa](https://github.com/aws/aws-cdk/commit/74512fa339e0a2937213f519c109ef1207e9d0c6)), closes [#14910](https://github.com/aws/aws-cdk/issues/14910) [#14395](https://github.com/aws/aws-cdk/issues/14395)
13+
* **elbv2:** add metrics to INetworkTargetGroup and IApplicationTargetGroup ([#23993](https://github.com/aws/aws-cdk/issues/23993)) ([6a9e43f](https://github.com/aws/aws-cdk/commit/6a9e43f0c6f966df4671267eeda21638611dfb1c)), closes [#23853](https://github.com/aws/aws-cdk/issues/23853) [#10850](https://github.com/aws/aws-cdk/issues/10850)
14+
* **lambda:** add insights version 1.0.178.0 ([#23836](https://github.com/aws/aws-cdk/issues/23836)) ([5272908](https://github.com/aws/aws-cdk/commit/527290854d0fa31e7f41497ede0c1b8b0e1b9ad4))
15+
16+
17+
### Bug Fixes
18+
19+
* **bootstrap:** remove Security Hub finding S3.10 ([#24175](https://github.com/aws/aws-cdk/issues/24175)) ([a1da757](https://github.com/aws/aws-cdk/commit/a1da757ce348b4bd66a6d0e7776f2ff8e9f531b6)), closes [/docs.aws.amazon.com/securityhub/latest/userguide/securityhub-standards-fsbp-controls.html#fsbp-s3-10](https://github.com/aws//docs.aws.amazon.com/securityhub/latest/userguide/securityhub-standards-fsbp-controls.html/issues/fsbp-s3-10)
20+
* **codedeploy:** unable to remove alarms from deployment group ([#23308](https://github.com/aws/aws-cdk/issues/23308)) ([eee005f](https://github.com/aws/aws-cdk/commit/eee005f4949d7438467c7448ba8326efa4b79221))
21+
* **codepipeline:** x-env ECS deployment lacking support stack-dependency ([#24053](https://github.com/aws/aws-cdk/issues/24053)) ([adfe4fa](https://github.com/aws/aws-cdk/commit/adfe4fa137bb748961b4a767d538335490e13ed1)), closes [#24050](https://github.com/aws/aws-cdk/issues/24050) [#24051](https://github.com/aws/aws-cdk/issues/24051)
22+
* **core:** messages are displayed multiple times per construct ([#24019](https://github.com/aws/aws-cdk/issues/24019)) ([57770bb](https://github.com/aws/aws-cdk/commit/57770bb12ea6d77373f1e9e8e04f6757b440f277)), closes [#9565](https://github.com/aws/aws-cdk/issues/9565)
23+
* **ec2:** enable set throughput param to CfnVolume ([#24118](https://github.com/aws/aws-cdk/issues/24118)) ([32781f8](https://github.com/aws/aws-cdk/commit/32781f825352f9cb43d8fed5c122b454275b3076)), closes [#24107](https://github.com/aws/aws-cdk/issues/24107) [#24107](https://github.com/aws/aws-cdk/issues/24107)
24+
* **elbv2:** healthcheck interval is overly restrictive ([#24157](https://github.com/aws/aws-cdk/issues/24157)) ([4f83e02](https://github.com/aws/aws-cdk/commit/4f83e02b85229ebdff3f32ba6fd662ffd707d8db)), closes [#24156](https://github.com/aws/aws-cdk/issues/24156)
25+
* **iam:** PrincipalWithConditions.addCondition fails with a new key ([#23782](https://github.com/aws/aws-cdk/issues/23782)) ([8951d01](https://github.com/aws/aws-cdk/commit/8951d013bea5dad54b94a6a683f56275ff4e6dba)), closes [#23781](https://github.com/aws/aws-cdk/issues/23781)
26+
* **iam:** SamlConsolePrincipal does not work in China [#22091](https://github.com/aws/aws-cdk/issues/22091) ([#24034](https://github.com/aws/aws-cdk/issues/24034)) ([2902043](https://github.com/aws/aws-cdk/commit/29020435aeb1a9fb6401572520d0adca8155dc60))
27+
* **pipelines:** SelfMutation CodeBuild project not accessible ([#24073](https://github.com/aws/aws-cdk/issues/24073)) ([5942978](https://github.com/aws/aws-cdk/commit/594297862f2626b64b174d6998886a40f1b316be))
28+
* **rds:** database proxies use ids as their resource names directly (under feature flag) ([#23703](https://github.com/aws/aws-cdk/issues/23703)) ([03a0f79](https://github.com/aws/aws-cdk/commit/03a0f79b40e3be95de5421370703eb54c06b7dd7)), closes [#18578](https://github.com/aws/aws-cdk/issues/18578)
29+
* **s3:** logging bucket blocks KMS_MANAGED encryption ([#23514](https://github.com/aws/aws-cdk/issues/23514)) ([1e8926f](https://github.com/aws/aws-cdk/commit/1e8926fa9bcf561135beaa31379ec1f1e6f79901))
30+
531
## [2.64.0](https://github.com/aws/aws-cdk/compare/v2.63.2...v2.64.0) (2023-02-09)
632

733

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Third-party Language Deprecation: language version is only supported until its E
3333
\
3434
Jump To:
3535
[Developer Guide](https://docs.aws.amazon.com/cdk/latest/guide) |
36-
[API Reference](https://docs.aws.amazon.com/cdk/api/latest/docs/aws-construct-library.html) |
36+
[API Reference](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-construct-library.html) |
3737
[Getting Started](#getting-started) |
3838
[Getting Help](#getting-help) |
3939
[Contributing](#contributing) |

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@
1616
"postinstall": "patch-package --error-on-fail"
1717
},
1818
"devDependencies": {
19+
"@types/node": "18.11.18",
1920
"@types/prettier": "2.6.0",
2021
"@yarnpkg/lockfile": "^1.1.0",
21-
"cdk-generate-synthetic-examples": "^0.1.140",
22+
"cdk-generate-synthetic-examples": "^0.1.151",
2223
"conventional-changelog-cli": "^2.2.2",
2324
"fs-extra": "^9.1.0",
2425
"graceful-fs": "^4.2.10",

packages/@aws-cdk-testing/cli-integ/bin/run-suite.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ async function main() {
2222
type: 'string',
2323
requiresArg: true,
2424
})
25+
.option('test-file', {
26+
description: 'The specific test file to run',
27+
type: 'string',
28+
requiresArg: true,
29+
})
2530
.option('use-source', {
2631
descripton: 'Use TypeScript packages from the given source repository (or "auto")',
2732
alias: 's',
@@ -121,6 +126,7 @@ async function main() {
121126
...args.test ? ['-t', args.test] : [],
122127
...args.verbose ? ['--verbose'] : [],
123128
...passWithNoTests ? ['--passWithNoTests'] : [],
129+
...args['test-file'] ? [args['test-file']] : [],
124130
], path.resolve(__dirname, '..', 'resources', 'integ.jest.config.js'));
125131

126132
} finally {

packages/@aws-cdk-testing/cli-integ/lib/integ-test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export function integTest(
1717
name: string,
1818
callback: (context: TestContext) => Promise<void>,
1919
timeoutMillis?: number,
20-
) {
20+
): void {
2121

2222
// Integ tests can run concurrently, and are responsible for blocking
2323
// themselves if they cannot. Because `test.concurrent` executes the test
@@ -62,4 +62,4 @@ function shouldSkip(testName: string) {
6262
export function randomString() {
6363
// Crazy
6464
return Math.random().toString(36).replace(/[^a-z0-9]+/g, '');
65-
}
65+
}

packages/@aws-cdk-testing/cli-integ/lib/npm.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const MINIMUM_VERSION = '3.9';
66
* Use NPM preinstalled on the machine to look up a list of TypeScript versions
77
*/
88
export function typescriptVersionsSync(): string[] {
9-
const { stdout } = spawnSync('npm', ['--silent', 'view', `typescript@>=${MINIMUM_VERSION}`, 'version', '--json']);
9+
const { stdout } = spawnSync('npm', ['--silent', 'view', `typescript@>=${MINIMUM_VERSION}`, 'version', '--json'], { encoding: 'utf-8' });
1010

1111
const versions: string[] = JSON.parse(stdout);
1212
return Array.from(new Set(versions.map(v => v.split('.').slice(0, 2).join('.'))));

packages/@aws-cdk-testing/cli-integ/lib/staging/npm.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
/* eslint-disable no-console */
22
import * as path from 'path';
3-
import { updateIniKey, loadLines, writeLines } from '../files';
4-
import { shell } from '../shell';
53
import { LoginInformation } from './codeartifact';
64
import { parallelShell } from './parallel-shell';
75
import { UsageDir } from './usage-dir';
6+
import { updateIniKey, loadLines, writeLines } from '../files';
7+
import { shell } from '../shell';
88

99
export async function npmLogin(login: LoginInformation, usageDir: UsageDir) {
1010
// Creating an ~/.npmrc that references an envvar is what you're supposed to do. (https://docs.npmjs.com/private-modules/ci-server-config)

packages/@aws-cdk-testing/cli-integ/lib/with-aws.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { AwsClients } from './aws';
22
import { TestContext } from './integ-test';
33
import { ResourcePool } from './resource-pool';
4+
import { DisableBootstrapContext } from './with-cdk-app';
45

56
export type AwsContext = { readonly aws: AwsClients };
67

@@ -9,12 +10,15 @@ export type AwsContext = { readonly aws: AwsClients };
910
*
1011
* Allocate the next region from the REGION pool and dispose it afterwards.
1112
*/
12-
export function withAws<A extends TestContext>(block: (context: A & AwsContext) => Promise<void>) {
13-
return (context: A) => regionPool().using(async (region) => {
13+
export function withAws(
14+
block: (context: TestContext & AwsContext & DisableBootstrapContext) => Promise<void>,
15+
disableBootstrap: boolean = false,
16+
): (context: TestContext) => Promise<void> {
17+
return (context: TestContext) => regionPool().using(async (region) => {
1418
const aws = await AwsClients.forRegion(region, context.output);
1519
await sanityCheck(aws);
1620

17-
return block({ ...context, aws });
21+
return block({ ...context, disableBootstrap, aws });
1822
});
1923
}
2024

@@ -60,4 +64,4 @@ async function sanityCheck(aws: AwsClients) {
6064
throw new Error('AWS credentials probably not configured, see previous error');
6165
}
6266
}
63-
let sanityChecked: boolean | undefined;
67+
let sanityChecked: boolean | undefined;

0 commit comments

Comments
 (0)