-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(cli): directly deploy stacks in nested assemblies (#14379)
This change allows users to address stacks located in nested assemblies, which is the common use case when dealing with pipelines. For example, suppose we have only two stacks, `stack1` and `stack1/foo/bar`, and the second one is in a sub-assembly. The table below shows the behavior of the CLI before and after: | **Subcommand** | **Pattern** | **Matched stacks (before)** | **Matched stacks (after)** | |------------------------------|----------------|-----------------------------|----------------------------| | deploy, destroy, diff, synth | ε | stack1 | stack1 | | list | ε | stack1 | stack1, stack1/foo/bar | | metadata | ε | ∅ | ∅ | | _any_ | *, --all | stack1 | stack1 | | _any_ | ** | stack1 | stack1, stack1/foo/bar | | _any_ | stack1/** | ∅ | stack1/foo/bar | | _any_ | stack1 | stack1 | stack1 | | _any_ | stack1/foo/bar | ∅ | stack1/foo/bar | where: ε = empty string (no parameters) ∅ = empty results/error ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
- Loading branch information
1 parent
80d2324
commit 5a6fa7f
Showing
21 changed files
with
316 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/@aws-cdk/cloud-assembly-schema/schema/cloud-assembly.version.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"version":"9.0.0"} | ||
{"version":"10.0.0"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
packages/@aws-cdk/cx-api/test/fixtures/nested-assemblies/manifest.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"version": "0.0.0", | ||
"artifacts": { | ||
"subassembly": { | ||
"type": "cdk:cloud-assembly", | ||
"properties": { | ||
"directoryName": "subassembly", | ||
"displayName": "subassembly" | ||
} | ||
}, | ||
"topLevelStack": { | ||
"type": "aws:cloudformation:stack", | ||
"environment": "aws://111111111111/us-east-1", | ||
"properties": { | ||
"templateFile": "topLevelStack.template.json", | ||
"stackName": "topLevelStack" | ||
}, | ||
"displayName": "topLevelStack" | ||
} | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
packages/@aws-cdk/cx-api/test/fixtures/nested-assemblies/subassembly/manifest.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"version": "0.0.0", | ||
"artifacts": { | ||
"subsubassembly": { | ||
"type": "cdk:cloud-assembly", | ||
"properties": { | ||
"directoryName": "subsubassembly", | ||
"displayName": "subsubassembly" | ||
} | ||
}, | ||
"stack1": { | ||
"type": "aws:cloudformation:stack", | ||
"environment": "aws://37736633/us-region-1", | ||
"properties": { | ||
"templateFile": "template.json", | ||
"stackName": "first-stack" | ||
} | ||
} | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
.../@aws-cdk/cx-api/test/fixtures/nested-assemblies/subassembly/subsubassembly/manifest.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"version": "0.0.0", | ||
"artifacts": { | ||
"stack2": { | ||
"type": "aws:cloudformation:stack", | ||
"environment": "aws://37736633/us-region-1", | ||
"properties": { | ||
"templateFile": "template.2.json", | ||
"stackName": "second-stack" | ||
} | ||
} | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
...aws-cdk/cx-api/test/fixtures/nested-assemblies/subassembly/subsubassembly/template.2.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"Resources": { | ||
"MyBucket": { | ||
"Type": "AWS::S3::Bucket" | ||
} | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
packages/@aws-cdk/cx-api/test/fixtures/nested-assemblies/subassembly/template.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"Resources": { | ||
"MyBucket": { | ||
"Type": "AWS::S3::Bucket" | ||
} | ||
} | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.