Skip to content

Commit

Permalink
Merge branch 'main' into huijbers/cdk-rollback-2
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored Oct 7, 2024
2 parents 7bc575f + e8dc7bb commit 9b52116
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/request-cli-integ-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
persist-credentials: false
- name: Find changed cli files
id: changed-cli-files
uses: tj-actions/changed-files@48d8f15b2aaa3d255ca5af3eba4870f807ce6b3c
uses: tj-actions/changed-files@c3a1bb2c992d77180ae65be6ae6c166cf40f857c
with:
base_sha: ${{ github.event.pull_request.base.sha }}
files_yaml: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ if (process.env.PACKAGE_LAYOUT_VERSION === '1') {
}

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

const stackPrefix = process.env.STACK_NAME_PREFIX;
if (!stackPrefix) {
Expand Down Expand Up @@ -176,7 +176,7 @@ class DependentStack extends Stack {
super(scope, id);

const innerDependentStack = new InnerDependentStack(this, 'InnerDependentStack');

this.addDependency(innerDependentStack);
}
}
Expand Down Expand Up @@ -204,7 +204,7 @@ class MigrateStack extends cdk.Stack {
new cdk.CfnOutput(this, 'QueueUrl', {
value: queue.queueUrl,
});

new cdk.CfnOutput(this, 'QueueLogicalId', {
value: queue.node.defaultChild.logicalId,
});
Expand Down Expand Up @@ -258,7 +258,7 @@ class ImportableStack extends cdk.Stack {
new cdk.CfnOutput(this, 'QueueUrl', {
value: queue.queueUrl,
});

new cdk.CfnOutput(this, 'QueueLogicalId', {
value: queue.node.defaultChild.logicalId,
});
Expand Down Expand Up @@ -844,6 +844,7 @@ switch (stackSet) {

new StackWithNestedStack(app, `${stackPrefix}-with-nested-stack`);
new StackWithNestedStackUsingParameters(app, `${stackPrefix}-with-nested-stack-using-parameters`);
new StackWithDoublyNestedStack(app, `${stackPrefix}-with-doubly-nested-stack`);
new ListStack(app, `${stackPrefix}-list-stacks`)
new ListMultipleDependentStack(app, `${stackPrefix}-list-multiple-dependent-stacks`);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,21 @@ class MyNestedStack extends cfn.NestedStack {
}
}

class DoublyNestedStack extends cfn.NestedStack {
constructor(scope, id) {
super(scope, id);

new MyNestedStack(this, 'Nestor');
}
}

class StackWithDoublyNestedStack extends Stack {
constructor(scope, id) {
super(scope, id);
new DoublyNestedStack(this, 'DoubleDouble');
}
}

class StackWithNestedStackUsingParameters extends Stack {
constructor(scope, id) {
super(scope, id);
Expand All @@ -47,3 +62,4 @@ class MyNestedStackUsingParameters extends cfn.NestedStack {

exports.StackWithNestedStack = StackWithNestedStack;
exports.StackWithNestedStackUsingParameters = StackWithNestedStackUsingParameters;
exports.StackWithDoublyNestedStack = StackWithDoublyNestedStack;
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,13 @@ integTest(
}),
);

integTest('doubly nested stack',
withDefaultFixture(async (fixture) => {
await fixture.cdkDeploy('with-doubly-nested-stack', {
captureStderr: false,
});
}));

integTest(
'nested stack with parameters',
withDefaultFixture(async (fixture) => {
Expand Down

0 comments on commit 9b52116

Please sign in to comment.