Skip to content

Commit f9d9bfa

Browse files
Merge branch 'main' into formatJsdoc
2 parents 3caff81 + d1d179f commit f9d9bfa

121 files changed

Lines changed: 32343 additions & 20657 deletions

File tree

Some content is hidden

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

.github/workflows/request-cli-integ-test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
:arrow_right: **PR build request submitted to `test-main-pipeline`** :arrow_left:
6161
6262
A maintainer must now check the pipeline and add the `pr-linter/cli-integ-tested` label once the pipeline succeeds.
63-
comment_tag: request-cli-integ-test
63+
comment-tag: request-cli-integ-test
6464
mode: recreate
6565
# Post as our automation user
66-
GITHUB_TOKEN: ${{ secrets.PROJEN_GITHUB_TOKEN }}
66+
github-token: ${{ secrets.PROJEN_GITHUB_TOKEN }}

CHANGELOG.v2.alpha.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,24 @@
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.163.1-alpha.0](https://github.com/aws/aws-cdk/compare/v2.163.0-alpha.0...v2.163.1-alpha.0) (2024-10-22)
6+
7+
## [2.163.0-alpha.0](https://github.com/aws/aws-cdk/compare/v2.162.1-alpha.0...v2.163.0-alpha.0) (2024-10-21)
8+
9+
10+
### Features
11+
12+
* **ec2:** disable api termination ([#30620](https://github.com/aws/aws-cdk/issues/30620)) ([108737d](https://github.com/aws/aws-cdk/commit/108737d613e2a2da20a53fe92a4dac2b43d21044))
13+
* **kinesisfirehose-alpha:** refactor sourceStream property to support multiple types of sources ([#31723](https://github.com/aws/aws-cdk/issues/31723)) ([0260046](https://github.com/aws/aws-cdk/commit/026004682f25d324b5f82b8d0ed92820c55233c1))
14+
* **pipes-enrichments:** support API destination enrichment ([#31312](https://github.com/aws/aws-cdk/issues/31312)) ([1557793](https://github.com/aws/aws-cdk/commit/1557793f696da77ab592e81165dbbb5c0886e7e2)), closes [#29383](https://github.com/aws/aws-cdk/issues/29383)
15+
* **pipes-targets:** add CloudWatch Logs ([#30665](https://github.com/aws/aws-cdk/issues/30665)) ([893769e](https://github.com/aws/aws-cdk/commit/893769ed22818a6c31ec1bdd58d458f50ba28c48))
16+
17+
18+
### Bug Fixes
19+
20+
* **ec2:** exposed userDataCausesReplacement in BastionHostLinuxProps ([#31416](https://github.com/aws/aws-cdk/issues/31416)) ([029c298](https://github.com/aws/aws-cdk/commit/029c298db9875214eb16b88689b13f5e244b5ea4)), closes [#31348](https://github.com/aws/aws-cdk/issues/31348)
21+
* **scheduler-alpha:** remove `targetOverrides` prop from Schedule ([#31799](https://github.com/aws/aws-cdk/issues/31799)) ([be4154b](https://github.com/aws/aws-cdk/commit/be4154b3a2bba28700b8476dfb26af54da0bdc6f))
22+
523
## [2.162.1-alpha.0](https://github.com/aws/aws-cdk/compare/v2.162.0-alpha.0...v2.162.1-alpha.0) (2024-10-11)
624

725
## [2.162.0-alpha.0](https://github.com/aws/aws-cdk/compare/v2.161.1-alpha.0...v2.162.0-alpha.0) (2024-10-10)

CHANGELOG.v2.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,44 @@
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.163.1](https://github.com/aws/aws-cdk/compare/v2.163.0...v2.163.1) (2024-10-22)
6+
7+
8+
### Bug Fixes
9+
10+
* 'Need to perform AWS calls for account' when doing cross-account deployments ([#31846](https://github.com/aws/aws-cdk/issues/31846)) ([5aa63d1](https://github.com/aws/aws-cdk/commit/5aa63d136294a42df2f65a3705655eb3c108fc2c)), closes [#31845](https://github.com/aws/aws-cdk/issues/31845)
11+
12+
## [2.163.0](https://github.com/aws/aws-cdk/compare/v2.162.1...v2.163.0) (2024-10-21)
13+
14+
15+
### Features
16+
17+
* **cli:** garbage collect s3 assets (under `--unstable` flag) ([#31611](https://github.com/aws/aws-cdk/issues/31611)) ([0a0e4ad](https://github.com/aws/aws-cdk/commit/0a0e4ad271197ccec2242d247516616f966a959c))
18+
* **cognito:** support `emailVerified` for `AttributeMapping` interface ([#31632](https://github.com/aws/aws-cdk/issues/31632)) ([5de7835](https://github.com/aws/aws-cdk/commit/5de783504111b6a04dc8d1da7c67a30200f3e3e5)), closes [#30467](https://github.com/aws/aws-cdk/issues/30467) [#30467](https://github.com/aws/aws-cdk/issues/30467)
19+
* **dynamodb:** enable contributor insights for global secondary index ([#30560](https://github.com/aws/aws-cdk/issues/30560)) ([799b541](https://github.com/aws/aws-cdk/commit/799b541135d0fb9cea31ddf29a8dacc1a94cb0fc)), closes [#15671](https://github.com/aws/aws-cdk/issues/15671)
20+
* **ecs-patterns:** support NLB with TLS listener and target group ([#30611](https://github.com/aws/aws-cdk/issues/30611)) ([f4f8abc](https://github.com/aws/aws-cdk/commit/f4f8abcb2a6df6a26b289b49b7738efce78b2936)), closes [#8517](https://github.com/aws/aws-cdk/issues/8517)
21+
* **efs:** allow AccessPoint to set client token ([#31184](https://github.com/aws/aws-cdk/issues/31184)) ([8208774](https://github.com/aws/aws-cdk/commit/8208774fb9a5f9d58a5fea24e60aa6862e861aba))
22+
* **events:** dead letter queue for an Event Bus ([#30628](https://github.com/aws/aws-cdk/issues/30628)) ([318eae6](https://github.com/aws/aws-cdk/commit/318eae6c9eca456e0c34ed21855dad9d2bfa2a0f)), closes [#30531](https://github.com/aws/aws-cdk/issues/30531)
23+
* **fsx:** specify file system type version for the Lustre file system ([#31136](https://github.com/aws/aws-cdk/issues/31136)) ([252cca9](https://github.com/aws/aws-cdk/commit/252cca9351be0dc09c242107639dceee74b96898)), closes [#31130](https://github.com/aws/aws-cdk/issues/31130)
24+
* **fsx:** support HDD storage type for a Lustre file systems ([#30207](https://github.com/aws/aws-cdk/issues/30207)) ([2d9aefb](https://github.com/aws/aws-cdk/commit/2d9aefbb6c2c5323d3d2d17e5961fb2300c25fa3)), closes [#30206](https://github.com/aws/aws-cdk/issues/30206)
25+
* **iam:** allow creating service principal using custom name ([#31793](https://github.com/aws/aws-cdk/issues/31793)) ([3d650c3](https://github.com/aws/aws-cdk/commit/3d650c30a2e1a47584b3dacd632269bab2071348)), closes [#31767](https://github.com/aws/aws-cdk/issues/31767)
26+
* **kms:** allow `fromLookup` method to return dummy key if target key was not found ([#31676](https://github.com/aws/aws-cdk/issues/31676)) ([34bdeca](https://github.com/aws/aws-cdk/commit/34bdecad76ac93d7dc4f8321352e851cebc75e17)), closes [#31574](https://github.com/aws/aws-cdk/issues/31574) [/github.com/aws/aws-cdk/blob/v2.161.0/packages/aws-cdk-lib/aws-kms/lib/key.ts#L686](https://github.com/aws//github.com/aws/aws-cdk/blob/v2.161.0/packages/aws-cdk-lib/aws-kms/lib/key.ts/issues/L686) [/github.com/aws/aws-cdk/issues/31574#issuecomment-2399080697](https://github.com/aws//github.com/aws/aws-cdk/issues/31574/issues/issuecomment-2399080697)
27+
* **rds:** support local write forwarding for an aurora PostgreSQL cluster ([#31803](https://github.com/aws/aws-cdk/issues/31803)) ([a32436a](https://github.com/aws/aws-cdk/commit/a32436a5ea834b29faed19f37652fb4dae3fb1d7)), closes [#31802](https://github.com/aws/aws-cdk/issues/31802)
28+
* **s3:** support `transitionDefaultMinimumObjectSize` for life cycle ([#31778](https://github.com/aws/aws-cdk/issues/31778)) ([4aa117b](https://github.com/aws/aws-cdk/commit/4aa117b34c95555ea7d53dfa748a048196bf4044)), closes [#31777](https://github.com/aws/aws-cdk/issues/31777) [/docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfiguration.html#cfn-s3](https://github.com/aws//docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfiguration.html/issues/cfn-s3)
29+
* update L1 CloudFormation resource definitions ([#31752](https://github.com/aws/aws-cdk/issues/31752)) ([8067294](https://github.com/aws/aws-cdk/commit/8067294f6c378795538d7ed2a8e0741310bec0b9))
30+
* update L1 CloudFormation resource definitions ([#31800](https://github.com/aws/aws-cdk/issues/31800)) ([fccb006](https://github.com/aws/aws-cdk/commit/fccb0060759af997db1bf2b69a27d1c0d282e28c))
31+
* **rds:** support performance insights configuration at cluster level ([#31385](https://github.com/aws/aws-cdk/issues/31385)) ([7d6bf77](https://github.com/aws/aws-cdk/commit/7d6bf773d3a8f17d94c4aa5d5aa9025270c254aa)), closes [#31375](https://github.com/aws/aws-cdk/issues/31375)
32+
* disallow cross account asset publishing in some scenarios ([#31623](https://github.com/aws/aws-cdk/issues/31623)) ([edd031d](https://github.com/aws/aws-cdk/commit/edd031d3c76a870991bf8a5f021f8043d6a2b871))
33+
* **step-functions:** add bucketNamePath in item reader ([#31619](https://github.com/aws/aws-cdk/issues/31619)) ([97130d8](https://github.com/aws/aws-cdk/commit/97130d80824cbbef4323ed7ead00fcfdc61fe7fb)), closes [#29409](https://github.com/aws/aws-cdk/issues/29409)
34+
35+
36+
### Bug Fixes
37+
38+
* **cli:** `cdk import` errors with 'S3 error: Access Denied' ([#31727](https://github.com/aws/aws-cdk/issues/31727)) ([cd324d0](https://github.com/aws/aws-cdk/commit/cd324d028e03215e877f13a26992ebd5a2b4db03)), closes [#31597](https://github.com/aws/aws-cdk/issues/31597) [#31716](https://github.com/aws/aws-cdk/issues/31716)
39+
* **lambda:** filterRule.null() returns empty array ([#31701](https://github.com/aws/aws-cdk/issues/31701)) ([5830ee1](https://github.com/aws/aws-cdk/commit/5830ee1eb29fc025c3ebe1451647c79cef155ea1)), closes [#31458](https://github.com/aws/aws-cdk/issues/31458)
40+
* **s3:** add support for uppercase characters in legacy bucket names ([#31813](https://github.com/aws/aws-cdk/issues/31813)) ([7bebf40](https://github.com/aws/aws-cdk/commit/7bebf400a6e271c3f50402a5e72aff1f1b8be109)), closes [#31731](https://github.com/aws/aws-cdk/issues/31731)
41+
* **stepfunctions-tasks:** stateMachine construct doesn't generate a valid policy for default StateMachineRole ([#31801](https://github.com/aws/aws-cdk/issues/31801)) ([efbbddb](https://github.com/aws/aws-cdk/commit/efbbddbee370a9b4dba2fbea4c92b44ad39be973)), closes [#31714](https://github.com/aws/aws-cdk/issues/31714)
42+
543
## [2.162.1](https://github.com/aws/aws-cdk/compare/v2.162.0...v2.162.1) (2024-10-11)
644

745

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

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,30 @@ export interface CdkModernBootstrapCommandOptions extends CommonCdkBootstrapComm
331331
readonly usePreviousParameters?: boolean;
332332
}
333333

334+
export interface CdkGarbageCollectionCommandOptions {
335+
/**
336+
* The amount of days an asset should stay isolated before deletion, to
337+
* guard against some pipeline rollback scenarios
338+
*
339+
* @default 0
340+
*/
341+
readonly rollbackBufferDays?: number;
342+
343+
/**
344+
* The type of asset that is getting garbage collected.
345+
*
346+
* @default 'all'
347+
*/
348+
readonly type?: 'ecr' | 's3' | 'all';
349+
350+
/**
351+
* The name of the bootstrap stack
352+
*
353+
* @default 'CdkToolkit'
354+
*/
355+
readonly bootstrapStackName?: string;
356+
}
357+
334358
export class TestFixture extends ShellHelper {
335359
public readonly qualifier = this.randomString.slice(0, 10);
336360
private readonly bucketsToDelete = new Array<string>();
@@ -464,6 +488,26 @@ export class TestFixture extends ShellHelper {
464488
});
465489
}
466490

491+
public async cdkGarbageCollect(options: CdkGarbageCollectionCommandOptions): Promise<string> {
492+
const args = [
493+
'gc',
494+
'--unstable=gc', // TODO: remove when stabilizing
495+
'--confirm=false',
496+
'--created-buffer-days=0', // Otherwise all assets created during integ tests are too young
497+
];
498+
if (options.rollbackBufferDays) {
499+
args.push('--rollback-buffer-days', String(options.rollbackBufferDays));
500+
}
501+
if (options.type) {
502+
args.push('--type', options.type);
503+
}
504+
if (options.bootstrapStackName) {
505+
args.push('--bootstrapStackName', options.bootstrapStackName);
506+
}
507+
508+
return this.cdk(args);
509+
}
510+
467511
public async cdkMigrate(language: string, stackName: string, inputPath?: string, options?: CdkCliOptions) {
468512
return this.cdk([
469513
'migrate',
@@ -634,6 +678,7 @@ async function ensureBootstrapped(fixture: TestFixture) {
634678
CDK_NEW_BOOTSTRAP: '1',
635679
},
636680
});
681+
637682
ALREADY_BOOTSTRAPPED_IN_THIS_RUN.add(envSpecifier);
638683
}
639684

Lines changed: 202 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,202 @@
1+
import { GetObjectTaggingCommand, ListObjectsV2Command, PutObjectTaggingCommand } from '@aws-sdk/client-s3';
2+
import { integTest, randomString, withoutBootstrap } from '../../lib';
3+
4+
jest.setTimeout(2 * 60 * 60_000); // Includes the time to acquire locks, worst-case single-threaded runtime
5+
6+
integTest(
7+
'Garbage Collection deletes unused assets',
8+
withoutBootstrap(async (fixture) => {
9+
const toolkitStackName = fixture.bootstrapStackName;
10+
const bootstrapBucketName = `aws-cdk-garbage-collect-integ-test-bckt-${randomString()}`;
11+
fixture.rememberToDeleteBucket(bootstrapBucketName); // just in case
12+
13+
await fixture.cdkBootstrapModern({
14+
toolkitStackName,
15+
bootstrapBucketName,
16+
});
17+
18+
await fixture.cdkDeploy('lambda', {
19+
options: [
20+
'--context', `bootstrapBucket=${bootstrapBucketName}`,
21+
'--context', `@aws-cdk/core:bootstrapQualifier=${fixture.qualifier}`,
22+
'--toolkit-stack-name', toolkitStackName,
23+
'--force',
24+
],
25+
});
26+
fixture.log('Setup complete!');
27+
28+
await fixture.cdkDestroy('lambda', {
29+
options: [
30+
'--context', `bootstrapBucket=${bootstrapBucketName}`,
31+
'--context', `@aws-cdk/core:bootstrapQualifier=${fixture.qualifier}`,
32+
'--toolkit-stack-name', toolkitStackName,
33+
'--force',
34+
],
35+
});
36+
37+
await fixture.cdkGarbageCollect({
38+
rollbackBufferDays: 0,
39+
type: 's3',
40+
bootstrapStackName: toolkitStackName,
41+
});
42+
fixture.log('Garbage collection complete!');
43+
44+
// assert that the bootstrap bucket is empty
45+
await fixture.aws.s3.send(new ListObjectsV2Command({ Bucket: bootstrapBucketName }))
46+
.then((result) => {
47+
expect(result.Contents).toBeUndefined();
48+
});
49+
}),
50+
);
51+
52+
integTest(
53+
'Garbage Collection keeps in use assets',
54+
withoutBootstrap(async (fixture) => {
55+
const toolkitStackName = fixture.bootstrapStackName;
56+
const bootstrapBucketName = `aws-cdk-garbage-collect-integ-test-bckt-${randomString()}`;
57+
fixture.rememberToDeleteBucket(bootstrapBucketName); // just in case
58+
59+
await fixture.cdkBootstrapModern({
60+
toolkitStackName,
61+
bootstrapBucketName,
62+
});
63+
64+
await fixture.cdkDeploy('lambda', {
65+
options: [
66+
'--context', `bootstrapBucket=${bootstrapBucketName}`,
67+
'--context', `@aws-cdk/core:bootstrapQualifier=${fixture.qualifier}`,
68+
'--toolkit-stack-name', toolkitStackName,
69+
'--force',
70+
],
71+
});
72+
fixture.log('Setup complete!');
73+
74+
await fixture.cdkGarbageCollect({
75+
rollbackBufferDays: 0,
76+
type: 's3',
77+
bootstrapStackName: toolkitStackName,
78+
});
79+
fixture.log('Garbage collection complete!');
80+
81+
// assert that the bootstrap bucket has the object
82+
await fixture.aws.s3.send(new ListObjectsV2Command({ Bucket: bootstrapBucketName }))
83+
.then((result) => {
84+
expect(result.Contents).toHaveLength(1);
85+
});
86+
87+
await fixture.cdkDestroy('lambda', {
88+
options: [
89+
'--context', `bootstrapBucket=${bootstrapBucketName}`,
90+
'--context', `@aws-cdk/core:bootstrapQualifier=${fixture.qualifier}`,
91+
'--toolkit-stack-name', toolkitStackName,
92+
'--force',
93+
],
94+
});
95+
fixture.log('Teardown complete!');
96+
}),
97+
);
98+
99+
integTest(
100+
'Garbage Collection tags unused assets',
101+
withoutBootstrap(async (fixture) => {
102+
const toolkitStackName = fixture.bootstrapStackName;
103+
const bootstrapBucketName = `aws-cdk-garbage-collect-integ-test-bckt-${randomString()}`;
104+
fixture.rememberToDeleteBucket(bootstrapBucketName); // just in case
105+
106+
await fixture.cdkBootstrapModern({
107+
toolkitStackName,
108+
bootstrapBucketName,
109+
});
110+
111+
await fixture.cdkDeploy('lambda', {
112+
options: [
113+
'--context', `bootstrapBucket=${bootstrapBucketName}`,
114+
'--context', `@aws-cdk/core:bootstrapQualifier=${fixture.qualifier}`,
115+
'--toolkit-stack-name', toolkitStackName,
116+
'--force',
117+
],
118+
});
119+
fixture.log('Setup complete!');
120+
121+
await fixture.cdkDestroy('lambda', {
122+
options: [
123+
'--context', `bootstrapBucket=${bootstrapBucketName}`,
124+
'--context', `@aws-cdk/core:bootstrapQualifier=${fixture.qualifier}`,
125+
'--toolkit-stack-name', toolkitStackName,
126+
'--force',
127+
],
128+
});
129+
130+
await fixture.cdkGarbageCollect({
131+
rollbackBufferDays: 100, // this will ensure that we do not delete assets immediately (and just tag them)
132+
type: 's3',
133+
bootstrapStackName: toolkitStackName,
134+
});
135+
fixture.log('Garbage collection complete!');
136+
137+
// assert that the bootstrap bucket has the object and is tagged
138+
await fixture.aws.s3.send(new ListObjectsV2Command({ Bucket: bootstrapBucketName }))
139+
.then(async (result) => {
140+
expect(result.Contents).toHaveLength(2); // also the CFN template
141+
const key = result.Contents![0].Key;
142+
const tags = await fixture.aws.s3.send(new GetObjectTaggingCommand({ Bucket: bootstrapBucketName, Key: key }));
143+
expect(tags.TagSet).toHaveLength(1);
144+
});
145+
}),
146+
);
147+
148+
integTest(
149+
'Garbage Collection untags in-use assets',
150+
withoutBootstrap(async (fixture) => {
151+
const toolkitStackName = fixture.bootstrapStackName;
152+
const bootstrapBucketName = `aws-cdk-garbage-collect-integ-test-bckt-${randomString()}`;
153+
fixture.rememberToDeleteBucket(bootstrapBucketName); // just in case
154+
155+
await fixture.cdkBootstrapModern({
156+
toolkitStackName,
157+
bootstrapBucketName,
158+
});
159+
160+
await fixture.cdkDeploy('lambda', {
161+
options: [
162+
'--context', `bootstrapBucket=${bootstrapBucketName}`,
163+
'--context', `@aws-cdk/core:bootstrapQualifier=${fixture.qualifier}`,
164+
'--toolkit-stack-name', toolkitStackName,
165+
'--force',
166+
],
167+
});
168+
fixture.log('Setup complete!');
169+
170+
// Artificially add tagging to the asset in the bootstrap bucket
171+
const result = await fixture.aws.s3.send(new ListObjectsV2Command({ Bucket: bootstrapBucketName }));
172+
const key = result.Contents!.filter((c) => c.Key?.split('.')[1] == 'zip')[0].Key; // fancy footwork to make sure we have the asset key
173+
await fixture.aws.s3.send(new PutObjectTaggingCommand({
174+
Bucket: bootstrapBucketName,
175+
Key: key,
176+
Tagging: {
177+
TagSet: [{
178+
Key: 'aws-cdk:isolated',
179+
Value: '12345',
180+
}, {
181+
Key: 'bogus',
182+
Value: 'val',
183+
}],
184+
},
185+
}));
186+
187+
await fixture.cdkGarbageCollect({
188+
rollbackBufferDays: 100, // this will ensure that we do not delete assets immediately (and just tag them)
189+
type: 's3',
190+
bootstrapStackName: toolkitStackName,
191+
});
192+
fixture.log('Garbage collection complete!');
193+
194+
// assert that the isolated object tag is removed while the other tag remains
195+
const newTags = await fixture.aws.s3.send(new GetObjectTaggingCommand({ Bucket: bootstrapBucketName, Key: key }));
196+
197+
expect(newTags.TagSet).toEqual([{
198+
Key: 'bogus',
199+
Value: 'val',
200+
}]);
201+
}),
202+
);

packages/@aws-cdk-testing/framework-integ/test/aws-cognito/test/integ.user-pool-mfa-email.js.snapshot/cdk.out

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-cognito/test/integ.user-pool-mfa-email.js.snapshot/integ-user-email-mfa.assets.json

Lines changed: 19 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)