Skip to content

Commit

Permalink
experimental libraries in CDKv2
Browse files Browse the repository at this point in the history
  • Loading branch information
Jerry Kindall committed Oct 28, 2021
1 parent 73c43dd commit adbec31
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 58 deletions.
30 changes: 15 additions & 15 deletions doc_source/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ The CDK Toolkit actually runs your app and synthesizes fresh templates before mo

See `cdk synth --help` for all available options\. A few of the most\-frequently\-used options are covered below\.

### Specifying context values<a name="w304aac27b7c31c11"></a>
### Specifying context values<a name="w364aac27b7c31c11"></a>

Use the `--context` or `-c` option to pass [runtime context](context.md) values to your CDK app\.

Expand All @@ -355,15 +355,15 @@ When deploying multiple stacks, the specified context values are normally passed
cdk synth --context Stack1:key=value Stack2:key=value Stack1 Stack2
```

### Specifying display format<a name="w304aac27b7c31c13"></a>
### Specifying display format<a name="w364aac27b7c31c13"></a>

By default, the synthesized template is displayed in YAML format\. Add the `--json` flag to display it in JSON format instead\.

```
cdk synth --json MyStack
```

### Specifying output directory<a name="w304aac27b7c31c15"></a>
### Specifying output directory<a name="w364aac27b7c31c15"></a>

Add the `--output` \(`-o`\) option to write the synthesized templates to a directory other than `cdk.out`\.

Expand All @@ -387,15 +387,15 @@ The CDK Toolkit runs your app and synthesizes fresh AWS CloudFormation templates

See `cdk deploy --help` for all available options\. A few of the most\-frequently\-used options are covered below\.

### Disabling rollback<a name="w304aac27b7c33c11"></a>
### Disabling rollback<a name="w364aac27b7c33c11"></a>

One of AWS CloudFormation's marquee features is its ability to roll back changes so that deployments are atomic—they either succeed or fail as a whole\. The AWS CDK inherits this capability because it synthesizes and deploys AWS CloudFormation templates\.

Rollback makes sure your resources are in a consistent state at all times, which is vital for production stacks\. However, while you're still developing your infrastructure, some failures are inevitable, and rolling back failed deployments just slows you down\.

For this reason, the CDK Toolkit; allows you to disable rollback by adding ``--no-rollback` to your `cdk deploy` command\. With this flag, failed deployments are not rolled back\. Instead, resources deployed before the failed resource remain in place, and the next deployment starts with the failed resource\. You'll spend a lot less time waiting for deployments and a lot more time developing your infrastructure\.

### Hot swapping<a name="w304aac27b7c33c13"></a>
### Hot swapping<a name="w364aac27b7c33c13"></a>

Use the `--hotswap` flag with `cdk deploy` to attempt to update your AWS resources directly instead of generating a AWS CloudFormation changeset and deploying it\. Deployment falls back to AWS CloudFormation deployment if hot swapping is not possible\.

Expand All @@ -404,7 +404,7 @@ Currently hot swapping supports only Lambda functions\. The `--hotswap` flag als
**Important**
Hot swapping is not recommended for production environments\.

### Specifying AWS CloudFormation parameters<a name="w304aac27b7c33c15"></a>
### Specifying AWS CloudFormation parameters<a name="w364aac27b7c33c15"></a>

The AWS CDK Toolkit supports specifying AWS CloudFormation [parameters](parameters.md) at deployment\. You may provide these on the command line following the `--parameters` flag\.

Expand All @@ -426,7 +426,7 @@ cdk deploy MyStack YourStack --parameters MyStack:uploadBucketName=UploadBucket

By default, the AWS CDK retains values of parameters from previous deployments and uses them in later deployments if they are not specified explicitly\. Use the `--no-previous-parameters` flag to require all parameters to be specified\.

### Specifying outputs file<a name="w304aac27b7c33c17"></a>
### Specifying outputs file<a name="w364aac27b7c33c17"></a>

If your stack declares AWS CloudFormation outputs, these are normally displayed on the screen at the conclusion of deployment\. To write them to a file in JSON format, use the `--outputs-file` flag\.

Expand Down Expand Up @@ -640,7 +640,7 @@ If one of cdk.json or ~/.cdk.json exists, options specified there will be used
as defaults. Settings in cdk.json take precedence.
```

### `cdk list` \(`ls`\)<a name="w304aac27b7c37b7b1"></a>
### `cdk list` \(`ls`\)<a name="w364aac27b7c37b7b1"></a>

```
cdk list [STACKS..]
Expand All @@ -653,7 +653,7 @@ Options:
[boolean] [default: false]
```

### `cdk synthesize` \(`synth`\)<a name="w304aac27b7c37b7b3"></a>
### `cdk synthesize` \(`synth`\)<a name="w364aac27b7c37b7b3"></a>

```
cdk synthesize [STACKS..]
Expand All @@ -674,7 +674,7 @@ Options:
[boolean] [default: false]
```

### `cdk bootstrap`<a name="w304aac27b7c37b7b5"></a>
### `cdk bootstrap`<a name="w364aac27b7c37b7b5"></a>

```
cdk bootstrap [ENVIRONMENTS..]
Expand Down Expand Up @@ -749,7 +749,7 @@ Options:
example) [string]
```

### `cdk deploy`<a name="w304aac27b7c37b7b7"></a>
### `cdk deploy`<a name="w364aac27b7c37b7b7"></a>

```
cdk deploy [STACKS..]
Expand Down Expand Up @@ -806,7 +806,7 @@ Options:
[boolean] [default: true]
```

### `cdk destroy`<a name="w304aac27b7c37b7b9"></a>
### `cdk destroy`<a name="w364aac27b7c37b7b9"></a>

```
cdk destroy [STACKS..]
Expand All @@ -825,7 +825,7 @@ Options:
stacks [boolean]
```

### `cdk diff`<a name="w304aac27b7c37b7c11"></a>
### `cdk diff`<a name="w364aac27b7c37b7c11"></a>

```
cdk diff [STACKS..]
Expand All @@ -851,7 +851,7 @@ Options:
[boolean] [default: false]
```

### `cdk init`<a name="w304aac27b7c37b7c13"></a>
### `cdk init`<a name="w364aac27b7c37b7c13"></a>

```
cdk init [TEMPLATE]
Expand All @@ -873,7 +873,7 @@ Options:
project [boolean] [default: false]
```

### `cdk context`<a name="w304aac27b7c37b7c15"></a>
### `cdk context`<a name="w364aac27b7c37b7c15"></a>

```
cdk context
Expand Down
2 changes: 1 addition & 1 deletion doc_source/tagging.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ Tags.Of(myConstruct).Remove("key");

------

## Tag priorities<a name="w304aac17c23c21"></a>
## Tag priorities<a name="w364aac17c23c21"></a>

The AWS CDK applies and removes tags recursively\. If there are conflicts, the tagging operation with the highest priority wins\. \(Priorities are set using the optional `priority` property\.\) If the priorities of two operations are the same, the tagging operation closest to the bottom of the construct tree wins\. By default, applying a tag has a priority of 100 \(except for tags added directly to an AWS CloudFormation resource, which has a priority of 50\) and removing a tag has a priority of 200\.

Expand Down
2 changes: 1 addition & 1 deletion doc_source/use_cfn_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ dotnet add package Amazon.CDK.CloudFormation.Include

------

## Importing an AWS CloudFormation template<a name="w304aac25b9c11"></a>
## Importing an AWS CloudFormation template<a name="w364aac25b9c11"></a>

Here is a simple AWS CloudFormation template we'll use for the examples in this topic\. Save it as `my-template.json`\. After you've tried these examples with the provided template, you might explore further using a template for an actual stack you've already deployed, which you can obtain from the AWS CloudFormation console\.

Expand Down
Loading

0 comments on commit adbec31

Please sign in to comment.