Skip to content

Commit c8d7dd3

Browse files
authored
2 parents 0a606c9 + 25d68f8 commit c8d7dd3

File tree

721 files changed

+248182
-232707
lines changed

Some content is hidden

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

721 files changed

+248182
-232707
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
persist-credentials: false
2020
- name: Find changed cli files
2121
id: changed-cli-files
22-
uses: tj-actions/changed-files@48d8f15b2aaa3d255ca5af3eba4870f807ce6b3c
22+
uses: tj-actions/changed-files@c3a1bb2c992d77180ae65be6ae6c166cf40f857c
2323
with:
2424
base_sha: ${{ github.event.pull_request.base.sha }}
2525
files_yaml: |

CHANGELOG.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -7484,10 +7484,10 @@ const bucket = new s3.Bucket(this, 'L2Bucket');
74847484
const bucketResource = bucket.findChild('Resource') as s3.cloudformation.BucketResource;
74857485

74867486
// strongly-typed overrides
7487-
bucketResource.propertyOverrides.bucketName = 'NewBucketName';
7487+
bucketResource.propertyOverrides.bucketName = 'amzn-s3-demo-bucket';
74887488

74897489
// weakly-typed overrides
7490-
bucketResource.addPropertyOverride('BucketName', 'NewerBucketName');
7490+
bucketResource.addPropertyOverride('BucketName', 'amzn-s3-demo-bucket1');
74917491
```
74927492

74937493
### Bug Fixes
@@ -8289,7 +8289,7 @@ new Pipeline(this, 'MyCoolPipeline', { artifactsBucket: bucket });
82898289
You can also import a bucket by just specifying its name:
82908290

82918291
```typescript
8292-
const bucket = Bucket.import({ bucketName: new BucketName('my-bucket') });
8292+
const bucket = Bucket.import({ bucketName: new BucketName('amzn-s3-demo-bucket') });
82938293
new Pipeline(this, 'MyCoolPipeline', { artifactsBucket: bucket });
82948294
```
82958295

CHANGELOG.v2.alpha.md

+22
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,28 @@
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.162.0-alpha.0](https://github.com/aws/aws-cdk/compare/v2.161.1-alpha.0...v2.162.0-alpha.0) (2024-10-10)
6+
7+
8+
### ⚠ BREAKING CHANGES TO EXPERIMENTAL FEATURES
9+
10+
* **kinesisfirehose-alpha:** replaced `destinations` property with `destination` (singular) and changed the type from array of Destinations to a single Destination. Old behaviour would only allow an array with a single Destination to be passed in anyway.
11+
12+
### Features
13+
14+
* **iot-alpha:** support for account audit configuration ([#31661](https://github.com/aws/aws-cdk/issues/31661)) ([fc19571](https://github.com/aws/aws-cdk/commit/fc19571c6392e905ff03998d0e8bc4e3b01399f4)), closes [#31663](https://github.com/aws/aws-cdk/issues/31663)
15+
* **pipes-targets:** add EventBridge ([#30654](https://github.com/aws/aws-cdk/issues/30654)) ([842f49a](https://github.com/aws/aws-cdk/commit/842f49a224ceadb1ef973dc3048ee3ac52d8f118))
16+
17+
18+
### Bug Fixes
19+
20+
* **cli-lib:** cannot bootstrap specific environment ([#31713](https://github.com/aws/aws-cdk/issues/31713)) ([fec4bb1](https://github.com/aws/aws-cdk/commit/fec4bb1c26db54bbb151bd05239e1fc1be5de657))
21+
22+
23+
### Miscellaneous Chores
24+
25+
* **kinesisfirehose-alpha:** replace`destinations` property with `destination` and change type from array to single IDestination ([#31630](https://github.com/aws/aws-cdk/issues/31630)) ([1e2cff1](https://github.com/aws/aws-cdk/commit/1e2cff19eec234e1d1f7f501230cba01b220a09b))
26+
527
## [2.161.1-alpha.0](https://github.com/aws/aws-cdk/compare/v2.161.0-alpha.0...v2.161.1-alpha.0) (2024-10-05)
628

729
## [2.161.0-alpha.0](https://github.com/aws/aws-cdk/compare/v2.160.0-alpha.0...v2.161.0-alpha.0) (2024-10-03)

CHANGELOG.v2.md

+24
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,30 @@
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.162.0](https://github.com/aws/aws-cdk/compare/v2.161.1...v2.162.0) (2024-10-10)
6+
7+
8+
### Features
9+
10+
* **appsync:** add `ownerContact` property to the `GraphqlApi` ([#31585](https://github.com/aws/aws-cdk/issues/31585)) ([a8b2f01](https://github.com/aws/aws-cdk/commit/a8b2f0120d90ac5ed9ed8e222a673d996ea057fa))
11+
* **cdk:** expose authorizer id and authorization type ([#31622](https://github.com/aws/aws-cdk/issues/31622)) ([daaf0aa](https://github.com/aws/aws-cdk/commit/daaf0aaa18e5f0120e58c9d7655605c5351e8671)), closes [#31605](https://github.com/aws/aws-cdk/issues/31605)
12+
* **cli:** cdk rollback ([#31684](https://github.com/aws/aws-cdk/issues/31684)) ([3e40edc](https://github.com/aws/aws-cdk/commit/3e40edce14080939baa8b5b3a3a100e991d965fd)), closes [#31407](https://github.com/aws/aws-cdk/issues/31407)
13+
* **ecs:** add fargate ephemeral storage encryption to cluster settings ([#30759](https://github.com/aws/aws-cdk/issues/30759)) ([642a944](https://github.com/aws/aws-cdk/commit/642a9444e9549b04949ae81656aba0d8525e75f4)), closes [#30721](https://github.com/aws/aws-cdk/issues/30721)
14+
* **eks:** support eks with k8s 1.31 ([#31707](https://github.com/aws/aws-cdk/issues/31707)) ([fc09bc1](https://github.com/aws/aws-cdk/commit/fc09bc19166b2e4b76de6b836505c7b421111449))
15+
* **elasticloadbalancingv2:** support TCP idle timeout for Network Load Balancer Listener ([#31584](https://github.com/aws/aws-cdk/issues/31584)) ([8d851a9](https://github.com/aws/aws-cdk/commit/8d851a96a4d59b6cf03ca44ed1eac0c65602e27f)), closes [#31310](https://github.com/aws/aws-cdk/issues/31310)
16+
* update L1 CloudFormation resource definitions ([#31688](https://github.com/aws/aws-cdk/issues/31688)) ([b211189](https://github.com/aws/aws-cdk/commit/b2111890d55f33f43c42f27d2da6ede7de702f25))
17+
* **rds:** enable `grantDataApiAccess` method for imported database cluster ([#31280](https://github.com/aws/aws-cdk/issues/31280)) ([3c92012](https://github.com/aws/aws-cdk/commit/3c9201296e16a790f9ceccc8862f10e6d23e9d7d)), closes [#31116](https://github.com/aws/aws-cdk/issues/31116) [/github.com/aws/aws-cdk/blob/main/packages/aws-cdk-lib/aws-rds/lib/cluster.ts#L983](https://github.com/aws//github.com/aws/aws-cdk/blob/main/packages/aws-cdk-lib/aws-rds/lib/cluster.ts/issues/L983) [/github.com/aws/aws-cdk/blob/main/packages/aws-cdk-lib/aws-rds/lib/cluster.ts#L523-L526](https://github.com/aws//github.com/aws/aws-cdk/blob/main/packages/aws-cdk-lib/aws-rds/lib/cluster.ts/issues/L523-L526)
18+
19+
20+
### Bug Fixes
21+
22+
* **core:** `cdk diff` on large templates fails when passing in `toolkitStackName` and `qualifier` ([#31636](https://github.com/aws/aws-cdk/issues/31636)) ([f603c97](https://github.com/aws/aws-cdk/commit/f603c97bc82172219d3715505fe228c1bb02f475)), closes [#29179](https://github.com/aws/aws-cdk/issues/29179)
23+
* **ecs:** ecs exec cannot be enabled for ECS Anywhere (ecs.ExternalService) ([#31374](https://github.com/aws/aws-cdk/issues/31374)) ([cff1fcd](https://github.com/aws/aws-cdk/commit/cff1fcd6961227f5ef8fd0c1fd3a6d108dc28e34)), closes [#31181](https://github.com/aws/aws-cdk/issues/31181)
24+
* **elasticloadbalancingv2:** `http2Enabled` with true is ignored in ApplicationLoadBalancer ([#31675](https://github.com/aws/aws-cdk/issues/31675)) ([c1b240e](https://github.com/aws/aws-cdk/commit/c1b240ee6fdba9a0ca1126c97c5e0173bae007ce)), closes [#31609](https://github.com/aws/aws-cdk/issues/31609)
25+
* **event-targets:** ecsTask uses invalid task definition arn in policy ([#31615](https://github.com/aws/aws-cdk/issues/31615)) ([4ada3ea](https://github.com/aws/aws-cdk/commit/4ada3ea4c06bb1f9155bbe2928f64babe4527d0d)), closes [#30390](https://github.com/aws/aws-cdk/issues/30390) [#30484](https://github.com/aws/aws-cdk/issues/30484)
26+
* **iam:** override Role.applyRemovalPolicy for customizeRoles ([#31652](https://github.com/aws/aws-cdk/issues/31652)) ([35ed5c6](https://github.com/aws/aws-cdk/commit/35ed5c64db787c74abc21ce75176eaa8d240689f)), closes [#31651](https://github.com/aws/aws-cdk/issues/31651)
27+
* **s3:** unable to update the s3 event notifications on an existing S3 bucket ([#31431](https://github.com/aws/aws-cdk/issues/31431)) ([0a56c0d](https://github.com/aws/aws-cdk/commit/0a56c0db7e9851af26e65a05521e0ec082a06c9c)), closes [#31303](https://github.com/aws/aws-cdk/issues/31303)
28+
529
## [2.161.1](https://github.com/aws/aws-cdk/compare/v2.161.0...v2.161.1) (2024-10-05)
630

731

CONTRIBUTING.md

+2
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,8 @@ The following tools need to be installed on your system prior to installing the
210210
- [Python >= 3.8.0, < 4.0](https://www.python.org/downloads/release/python-380/)
211211
- [Docker >= 19.03](https://docs.docker.com/get-docker/)
212212
- the Docker daemon must also be running
213+
- [git-lfs](https://docs.github.com/en/repositories/working-with-files/managing-large-files/installing-git-large-file-storage)
214+
- Without this, you'll get the message that the clone succeeded but the checkout failed when you initially clone the repo.
213215

214216
First fork the repository https://github.com/aws/aws-cdk/fork, and then run the following commands to clone the repository locally.
215217

lerna.json

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
"packages/@aws-cdk/*/lambda-packages/*",
1212
"tools/@aws-cdk/cdk-build-tools",
1313
"tools/@aws-cdk/cdk-release",
14-
"tools/@aws-cdk/eslint-plugin",
1514
"tools/@aws-cdk/node-bundle",
1615
"tools/@aws-cdk/pkglint",
1716
"tools/@aws-cdk/pkgtools",

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@
4141
"colors": "1.4.0",
4242
"markdown-it": "^12.3.2",
4343
"string-width": "^4.2.3",
44-
"@types/babel__traverse": "7.18.2"
44+
"@types/babel__traverse": "7.18.2",
45+
"@smithy/types": "3.5.0"
4546
},
4647
"repository": {
4748
"type": "git",
@@ -78,7 +79,6 @@
7879
"packages/@aws-cdk/*/lambda-packages/*",
7980
"tools/@aws-cdk/cdk-build-tools",
8081
"tools/@aws-cdk/cdk-release",
81-
"tools/@aws-cdk/eslint-plugin",
8282
"tools/@aws-cdk/node-bundle",
8383
"tools/@aws-cdk/pkglint",
8484
"tools/@aws-cdk/pkgtools",

packages/@aws-cdk-testing/cli-integ/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Test suites are written as a collection of Jest tests, and they are run using Je
3737

3838
### Setup
3939

40-
Building the @aws-cdk-testing package is not very different from building the rest of the CDK. However, If you are having issues with the tests, you can ensure your enviornment is built properly by following the steps below:
40+
Building the @aws-cdk-testing package is not very different from building the rest of the CDK. However, If you are having issues with the tests, you can ensure your environment is built properly by following the steps below:
4141

4242
```shell
4343
yarn install # Install dependencies

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

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {
33
DeleteStackCommand,
44
DescribeStacksCommand,
55
UpdateTerminationProtectionCommand,
6-
Stack,
6+
type Stack,
77
} from '@aws-sdk/client-cloudformation';
88
import { DeleteRepositoryCommand, ECRClient } from '@aws-sdk/client-ecr';
99
import { ECSClient } from '@aws-sdk/client-ecs';
@@ -13,14 +13,14 @@ import {
1313
S3Client,
1414
DeleteObjectsCommand,
1515
ListObjectVersionsCommand,
16-
ObjectIdentifier,
16+
type ObjectIdentifier,
1717
DeleteBucketCommand,
1818
} from '@aws-sdk/client-s3';
1919
import { SNSClient } from '@aws-sdk/client-sns';
2020
import { SSOClient } from '@aws-sdk/client-sso';
2121
import { STSClient, GetCallerIdentityCommand } from '@aws-sdk/client-sts';
2222
import { fromIni } from '@aws-sdk/credential-providers';
23-
import { AwsCredentialIdentityProvider } from '@smithy/types';
23+
import type { AwsCredentialIdentityProvider } from '@smithy/types';
2424
import { ConfiguredRetryStrategy } from '@smithy/util-retry';
2525
interface ClientConfig {
2626
readonly credentials?: AwsCredentialIdentityProvider;
@@ -75,7 +75,7 @@ export class AwsClients {
7575
maxAttempts: 2,
7676
});
7777

78-
return (await stsClient.send(new GetCallerIdentityCommand())).Account!;
78+
return (await stsClient.send(new GetCallerIdentityCommand({}))).Account!;
7979
}
8080

8181
public async deleteStacks(...stackNames: string[]) {

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

+27-3
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ export const EXTENDED_TEST_TIMEOUT_S = 30 * 60;
2424
* For backwards compatibility with existing tests (so we don't have to change
2525
* too much) the inner block is expected to take a `TestFixture` object.
2626
*/
27-
export function withCdkApp(
27+
export function withSpecificCdkApp(
28+
appName: string,
2829
block: (context: TestFixture) => Promise<void>,
2930
): (context: TestContext & AwsContext & DisableBootstrapContext) => Promise<void> {
3031
return async (context: TestContext & AwsContext & DisableBootstrapContext) => {
@@ -36,7 +37,7 @@ export function withCdkApp(
3637
context.output.write(` Test directory: ${integTestDir}\n`);
3738
context.output.write(` Region: ${context.aws.region}\n`);
3839

39-
await cloneDirectory(path.join(RESOURCES_DIR, 'cdk-apps', 'app'), integTestDir, context.output);
40+
await cloneDirectory(path.join(RESOURCES_DIR, 'cdk-apps', appName), integTestDir, context.output);
4041
const fixture = new TestFixture(
4142
integTestDir,
4243
stackNamePrefix,
@@ -87,6 +88,16 @@ export function withCdkApp(
8788
};
8889
}
8990

91+
/**
92+
* Like `withSpecificCdkApp`, but uses the default integration testing app with a million stacks in it
93+
*/
94+
export function withCdkApp(
95+
block: (context: TestFixture) => Promise<void>,
96+
): (context: TestContext & AwsContext & DisableBootstrapContext) => Promise<void> {
97+
// 'app' is the name of the default integration app in the `cdk-apps` directory
98+
return withSpecificCdkApp('app', block);
99+
}
100+
90101
export function withCdkMigrateApp<A extends TestContext>(language: string, block: (context: TestFixture) => Promise<void>) {
91102
return async (context: A) => {
92103
const stackName = `cdk-migrate-${language}-integ-${context.randomString}`;
@@ -188,6 +199,10 @@ export function withDefaultFixture(block: (context: TestFixture) => Promise<void
188199
return withAws(withTimeout(DEFAULT_TEST_TIMEOUT_S, withCdkApp(block)));
189200
}
190201

202+
export function withSpecificFixture(appName: string, block: (context: TestFixture) => Promise<void>) {
203+
return withAws(withTimeout(DEFAULT_TEST_TIMEOUT_S, withSpecificCdkApp(appName, block)));
204+
}
205+
191206
export function withExtendedTimeoutFixture(block: (context: TestFixture) => Promise<void>) {
192207
return withAws(withTimeout(EXTENDED_TEST_TIMEOUT_S, withCdkApp(block)));
193208
}
@@ -258,6 +273,11 @@ interface CommonCdkBootstrapCommandOptions {
258273
* @default - none
259274
*/
260275
readonly tags?: string;
276+
277+
/**
278+
* @default - the default CDK qualifier
279+
*/
280+
readonly qualifier?: string;
261281
}
262282

263283
export interface CdkLegacyBootstrapCommandOptions extends CommonCdkBootstrapCommandOptions {
@@ -408,7 +428,7 @@ export class TestFixture extends ShellHelper {
408428
if (options.bootstrapBucketName) {
409429
args.push('--bootstrap-bucket-name', options.bootstrapBucketName);
410430
}
411-
args.push('--qualifier', this.qualifier);
431+
args.push('--qualifier', options.qualifier ?? this.qualifier);
412432
if (options.cfnExecutionPolicy) {
413433
args.push('--cloudformation-execution-policies', options.cfnExecutionPolicy);
414434
}
@@ -514,12 +534,16 @@ export class TestFixture extends ShellHelper {
514534

515535
// Bootstrap stacks have buckets that need to be cleaned
516536
const bucketNames = stacksToDelete.map(stack => outputFromStack('BucketName', stack)).filter(defined);
537+
// Parallelism will be reasonable
538+
// eslint-disable-next-line @cdklabs/promiseall-no-unbounded-parallelism
517539
await Promise.all(bucketNames.map(b => this.aws.emptyBucket(b)));
518540
// The bootstrap bucket has a removal policy of RETAIN by default, so add it to the buckets to be cleaned up.
519541
this.bucketsToDelete.push(...bucketNames);
520542

521543
// Bootstrap stacks have ECR repositories with images which should be deleted
522544
const imageRepositoryNames = stacksToDelete.map(stack => outputFromStack('ImageRepositoryName', stack)).filter(defined);
545+
// Parallelism will be reasonable
546+
// eslint-disable-next-line @cdklabs/promiseall-no-unbounded-parallelism
523547
await Promise.all(imageRepositoryNames.map(r => this.aws.deleteImageRepository(r)));
524548

525549
await this.aws.deleteStacks(

packages/@aws-cdk-testing/cli-integ/package.json

+13-13
Original file line numberDiff line numberDiff line change
@@ -39,19 +39,19 @@
3939
},
4040
"dependencies": {
4141
"@octokit/rest": "^18.12.0",
42-
"@aws-sdk/client-codeartifact": "3.637.0",
43-
"@aws-sdk/client-cloudformation": "3.637.0",
44-
"@aws-sdk/client-ecr": "3.637.0",
45-
"@aws-sdk/client-ecs": "3.637.0",
46-
"@aws-sdk/client-iam": "3.637.0",
47-
"@aws-sdk/client-lambda": "3.637.0",
48-
"@aws-sdk/client-s3": "3.637.0",
49-
"@aws-sdk/client-sns": "3.637.0",
50-
"@aws-sdk/client-sso": "3.637.0",
51-
"@aws-sdk/client-sts": "3.637.0",
52-
"@aws-sdk/credential-providers": "3.637.0",
53-
"@smithy/util-retry": "3.0.4",
54-
"@smithy/types": "3.4.0",
42+
"@aws-sdk/client-codeartifact": "3.632.0",
43+
"@aws-sdk/client-cloudformation": "3.632.0",
44+
"@aws-sdk/client-ecr": "3.632.0",
45+
"@aws-sdk/client-ecs": "3.632.0",
46+
"@aws-sdk/client-iam": "3.632.0",
47+
"@aws-sdk/client-lambda": "3.632.0",
48+
"@aws-sdk/client-s3": "3.632.0",
49+
"@aws-sdk/client-sns": "3.632.0",
50+
"@aws-sdk/client-sso": "3.632.0",
51+
"@aws-sdk/client-sts": "3.632.0",
52+
"@aws-sdk/credential-providers": "3.632.0",
53+
"@smithy/util-retry": "3.0.7",
54+
"@smithy/types": "3.5.0",
5555
"axios": "^1.7.7",
5656
"chalk": "^4",
5757
"fs-extra": "^9.1.0",

packages/@aws-cdk-testing/cli-integ/resources/cdk-apps/app/app.js

+15-5
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ if (process.env.PACKAGE_LAYOUT_VERSION === '1') {
3535
}
3636

3737
const { Annotations } = cdk;
38-
const { StackWithNestedStack, StackWithNestedStackUsingParameters } = require('./nested-stack');
38+
const { StackWithNestedStack, StackWithDoublyNestedStack, StackWithNestedStackUsingParameters } = require('./nested-stack');
3939

4040
const stackPrefix = process.env.STACK_NAME_PREFIX;
4141
if (!stackPrefix) {
@@ -176,7 +176,7 @@ class DependentStack extends Stack {
176176
super(scope, id);
177177

178178
const innerDependentStack = new InnerDependentStack(this, 'InnerDependentStack');
179-
179+
180180
this.addDependency(innerDependentStack);
181181
}
182182
}
@@ -204,7 +204,7 @@ class MigrateStack extends cdk.Stack {
204204
new cdk.CfnOutput(this, 'QueueUrl', {
205205
value: queue.queueUrl,
206206
});
207-
207+
208208
new cdk.CfnOutput(this, 'QueueLogicalId', {
209209
value: queue.node.defaultChild.logicalId,
210210
});
@@ -258,7 +258,7 @@ class ImportableStack extends cdk.Stack {
258258
new cdk.CfnOutput(this, 'QueueUrl', {
259259
value: queue.queueUrl,
260260
});
261-
261+
262262
new cdk.CfnOutput(this, 'QueueLogicalId', {
263263
value: queue.node.defaultChild.logicalId,
264264
});
@@ -438,9 +438,17 @@ class IamRolesStack extends cdk.Stack {
438438
// Environment variabile is used to create a bunch of roles to test
439439
// that large diff templates are uploaded to S3 to create the changeset.
440440
for(let i = 1; i <= Number(process.env.NUMBER_OF_ROLES) ; i++) {
441-
new iam.Role(this, `Role${i}`, {
441+
const role = new iam.Role(this, `Role${i}`, {
442442
assumedBy: new iam.ServicePrincipal('lambda.amazonaws.com'),
443443
});
444+
const cfnRole = role.node.defaultChild;
445+
446+
// For any extra IAM roles created, add a ton of metadata so that the template size is > 50 KiB.
447+
if (i > 1) {
448+
for(let i = 1; i <= 30 ; i++) {
449+
cfnRole.addMetadata('a'.repeat(1000), 'v');
450+
}
451+
}
444452
}
445453
}
446454
}
@@ -792,6 +800,7 @@ switch (stackSet) {
792800

793801
new LambdaStack(app, `${stackPrefix}-lambda`);
794802

803+
// This stack is used to test diff with large templates by creating a role with a ton of metadata
795804
new IamRolesStack(app, `${stackPrefix}-iam-roles`);
796805

797806
if (process.env.ENABLE_VPC_TESTING == 'IMPORT') {
@@ -835,6 +844,7 @@ switch (stackSet) {
835844

836845
new StackWithNestedStack(app, `${stackPrefix}-with-nested-stack`);
837846
new StackWithNestedStackUsingParameters(app, `${stackPrefix}-with-nested-stack-using-parameters`);
847+
new StackWithDoublyNestedStack(app, `${stackPrefix}-with-doubly-nested-stack`);
838848
new ListStack(app, `${stackPrefix}-list-stacks`)
839849
new ListMultipleDependentStack(app, `${stackPrefix}-list-multiple-dependent-stacks`);
840850

packages/@aws-cdk-testing/cli-integ/resources/cdk-apps/app/nested-stack.js

+16
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,21 @@ class MyNestedStack extends cfn.NestedStack {
2525
}
2626
}
2727

28+
class DoublyNestedStack extends cfn.NestedStack {
29+
constructor(scope, id) {
30+
super(scope, id);
31+
32+
new MyNestedStack(this, 'Nestor');
33+
}
34+
}
35+
36+
class StackWithDoublyNestedStack extends Stack {
37+
constructor(scope, id) {
38+
super(scope, id);
39+
new DoublyNestedStack(this, 'DoubleDouble');
40+
}
41+
}
42+
2843
class StackWithNestedStackUsingParameters extends Stack {
2944
constructor(scope, id) {
3045
super(scope, id);
@@ -47,3 +62,4 @@ class MyNestedStackUsingParameters extends cfn.NestedStack {
4762

4863
exports.StackWithNestedStack = StackWithNestedStack;
4964
exports.StackWithNestedStackUsingParameters = StackWithNestedStackUsingParameters;
65+
exports.StackWithDoublyNestedStack = StackWithDoublyNestedStack;

0 commit comments

Comments
 (0)