Skip to content

Commit 006c940

Browse files
committed
Update: Add documentation for 'cdk rollback' command
1 parent 1172a7c commit 006c940

13 files changed

+86
-26
lines changed

v2/bootstrapping-env.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ This section contains a list of the changes made in each version\.
260260
| 20 | 2\.119\.0 | Add ssm:GetParameters action to the AWS CloudFormation deploy IAM role\. For more information, see [\#28336](https://github.com/aws/aws-cdk/pull/28336/files#diff-4fdac38426c4747aa17d515b01af4994d3d2f12c34f7b6655f24328259beb7bf)\. |
261261
| 21 | 2\.149\.0 | Add condition to the file publishing role\. |
262262
| 22 | 2\.160\.0 | Add sts:TagSession permissions to the trust policy of bootstrap IAM roles\. |
263-
| 23 | 2\.161\.0 | Add cloudformation:RollbackStack and cloudformation:ContinueUpdateRollback permissions to the trust policy of the deploy IAM role\. |
263+
| 23 | 2\.161\.0 | Add cloudformation:RollbackStack and cloudformation:ContinueUpdateRollback permissions to the trust policy of the deploy IAM role\. This provides permissions for the cdk rollback command\. |
264264

265265
## Upgrade from legacy to modern bootstrap template<a name="bootstrapping-template"></a>
266266

v2/hello_world.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -891,7 +891,7 @@ func NewHelloCdkStack(scope constructs.Construct, id string, props *HelloCdkStac
891891

892892
Let's take a closer look at the `Function` construct\. Like all constructs, the `Function` class takes three parameters:
893893
+ **scope** – Defines your `Stack` instance as the parent of the `Function` construct\. All constructs that define AWS resources are created within the scope of a stack\. You can define constructs inside of constructs, creating a hierarchy \(tree\)\. Here, and in most cases, the scope is `this` \(`self` in Python\)\.
894-
+ **Id** – The logical ID of the `Function` within your AWS CDK app\. This ID, plus a hash based on the function's location within the stack, uniquely identifies the function during deployment\. The AWS CDK also references this ID when you update the construct in your app and re\-deploy to update the deployed resource\. Here, your logical ID is `HelloWorldFunction`\. Functions can also have a name, specified with the `functionName` property\. This is different from the logical ID\.
894+
+ **Id** – The construct ID of the `Function` within your AWS CDK app\. This ID, plus a hash based on the function's location within the stack, uniquely identifies the function during deployment\. The AWS CDK also references this ID when you update the construct in your app and re\-deploy to update the deployed resource\. Here, your construct ID is `HelloWorldFunction`\. Functions can also have a name, specified with the `functionName` property\. This is different from the construct ID\.
895895
+ **props** – A bundle of values that define properties of the function\. Here you define the `runtime`, `handler`, and `code` properties\.
896896

897897
Props are represented differently in the languages supported by the AWS CDK\.

v2/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ sponsored by Amazon.
8989
+ [cdk metadata](ref-cli-cmd-metadata.md)
9090
+ [cdk migrate](ref-cli-cdk-migrate.md)
9191
+ [cdk notices](ref-cli-cmd-notices.md)
92+
+ [cdk rollback](ref-cli-cmd-rollback.md)
9293
+ [cdk synthesize](ref-cli-cmd-synth.md)
9394
+ [cdk watch](ref-cli-cmd-watch.md)
9495
+ [AWS CDK reference](reference.md)

v2/ref-cli-cmd-bootstrap.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ To learn more about termination protection, see [Protecting a stack from being d
110110
`--toolkit-stack-name STRING` <a name="ref-cli-cmd-bootstrap-options-toolkit-stack-name"></a>
111111
The name of the bootstrap stack to create\.
112112
By default, `cdk bootstrap` deploys a stack named `CDKToolkit` into the specified AWS environment\. Use this option to provide a different name for your bootstrap stack\.
113+
The CDK CLI uses this value to verify your bootstrap stack version\.
113114
*Default value*: `CDKToolkit`
114115
*Required*: Yes
115116

v2/ref-cli-cmd-deploy.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ $ cdk deploy <arguments> <options>
1414

1515
## Arguments<a name="ref-cli-cmd-deploy-args"></a>
1616

17-
**CDK stack logical ID** <a name="ref-cli-cmd-deploy-args-stack-name"></a>
18-
The logical ID of the CDK stack from your app to deploy\.
17+
**CDK stack ID** <a name="ref-cli-cmd-deploy-args-stack-name"></a>
18+
The construct ID of the CDK stack from your app to deploy\.
1919
*Type*: String
2020
*Required*: No
2121

@@ -163,16 +163,17 @@ Specify what security\-sensitive changes require manual approval\.
163163
*Valid values*: `any-change`, `broadening`, `never`
164164
*Default value*: `broadening`
165165

166-
`--rollback BOOLEAN` <a name="ref-cli-cmd-deploy-options-rollback"></a>
166+
`--rollback` \| `--no-rollback`, `-R` <a name="ref-cli-cmd-deploy-options-rollback"></a>
167167
During deployment, if a resource fails to be created or updated, the deployment will roll back to the latest stable state before the CDK CLI returns\. All changes made up to that point will be undone\. Resources that were created will be deleted and updates that were made will be rolled back\.
168-
Specify `false` to deactivate this behavior\. If a resource fails to be created or updated, the CDK CLI will leave changes made up to that point in place and return\. This may be helpful in development environments where you are iterating quickly\.
169-
For `--rollback=false`, you can use `--no-rollback` or `-R`\.
170-
When `false`, deployments that cause resource replacements will always fail\. You can only use this option value for deployments that update or create new resources\.
171-
*Default value*: `true`
168+
Specify `--no-rollback` to turn off this behavior\. If a resource fails to be created or updated, the CDK CLI will leave changes made up to that point in place and return\. This will leave your deployment in a failed, paused state\. From here, you can update your code and try the deployment again\. This may be helpful in development environments where you are iterating quickly\.
169+
If a deployment performed with `--no-rollback` fails, and you decide that you want to rollback the deployment, you can use the `cdk rollback` command\. For more information, see [cdk rollback](ref-cli-cmd-rollback.md)\.
170+
With `--no-rollback`, deployments that cause resource replacements will always fail\. You can only use this option value for deployments that update or create new resources\.
171+
*Default value*: `--rollback`
172172

173173
`--toolkit-stack-name STRING` <a name="ref-cli-cmd-deploy-options-toolkit-stack-name"></a>
174174
The name of the existing CDK Toolkit stack\.
175-
This option is only used for CDK apps using legacy synthesis\.
175+
By default, `cdk bootstrap` deploys a stack named `CDKToolkit` into the specified AWS environment\. Use this option to provide a different name for your bootstrap stack\.
176+
The CDK CLI uses this value to verify your bootstrap stack version\.
176177

177178
`--watch BOOLEAN` <a name="ref-cli-cmd-deploy-options-watch"></a>
178179
Continuously observe CDK project files, and deploy the specified stacks automatically when changes are detected\.

v2/ref-cli-cmd-destroy.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ $ cdk destroy <arguments> <options>
1414

1515
## Arguments<a name="ref-cli-cmd-destroy-args"></a>
1616

17-
**CDK stack logical ID** <a name="ref-cli-cmd-destroy-args-stack-name"></a>
18-
The logical ID of the CDK stack from your app to delete\.
17+
**CDK stack ID** <a name="ref-cli-cmd-destroy-args-stack-name"></a>
18+
The construct ID of the CDK stack from your app to delete\.
1919
*Type*: String
2020
*Required*: No
2121

v2/ref-cli-cmd-diff.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ $ cdk diff <arguments> <options>
1212

1313
## Arguments<a name="ref-cli-cmd-diff-args"></a>
1414

15-
**CDK stack logical ID** <a name="ref-cli-cmd-diff-args-stack-name"></a>
16-
The logical ID of the CDK stack from your app to perform a diff\.
15+
**CDK stack ID** <a name="ref-cli-cmd-diff-args-stack-name"></a>
16+
The construct ID of the CDK stack from your app to perform a diff\.
1717
*Type*: String
1818
*Required*: No
1919

v2/ref-cli-cmd-import.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ $ cdk import <arguments> <options>
3838

3939
## Arguments<a name="ref-cli-cmd-import-args"></a>
4040

41-
**CDK stack logical ID** <a name="ref-cli-cmd-import-args-stack-name"></a>
42-
The logical ID of the CDK stack from your app to import resources to\. This argument can be provided multiple times in a single command\.
41+
**CDK stack ID** <a name="ref-cli-cmd-import-args-stack-name"></a>
42+
The construct ID of the CDK stack from your app to import resources to\. This argument can be provided multiple times in a single command\.
4343
*Type*: String
4444
*Required*: No
4545

@@ -74,4 +74,6 @@ Specify `false` to iterate more rapidly\. Deployments containing resource replac
7474
*Default value*: `true`
7575

7676
`--toolkit-stack-name STRING` <a name="ref-cli-cmd-import-options-toolkit-stack-name"></a>
77-
The name of the CDK Toolkit stack to create
77+
The name of the CDK Toolkit stack to create\.
78+
By default, `cdk bootstrap` deploys a stack named `CDKToolkit` into the specified AWS environment\. Use this option to provide a different name for your bootstrap stack\.
79+
The CDK CLI uses this value to verify your bootstrap stack version\.

v2/ref-cli-cmd-list.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ $ cdk list <arguments> <options>
1010

1111
## Arguments<a name="ref-cli-cmd-list-args"></a>
1212

13-
**CDK stack logical ID** <a name="ref-cli-cmd-list-args-stack-name"></a>
14-
The logical ID of the CDK stack from your app to perform this command against\.
13+
**CDK stack ID** <a name="ref-cli-cmd-list-args-stack-name"></a>
14+
The construct ID of the CDK stack from your app to perform this command against\.
1515
*Type*: String
1616
*Required*: No
1717

v2/ref-cli-cmd-metadata.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ $ cdk metadata <arguments> <options>
1010

1111
## Arguments<a name="ref-cli-cmd-metadata-args"></a>
1212

13-
**CDK stack logical ID** <a name="ref-cli-cmd-metadata-args-stack-name"></a>
14-
The logical ID of the CDK stack from your app to display metadata for\.
13+
**CDK stack ID** <a name="ref-cli-cmd-metadata-args-stack-name"></a>
14+
The construct ID of the CDK stack from your app to display metadata for\.
1515
*Type*: String
1616
*Required*: No
1717

0 commit comments

Comments
 (0)