Skip to content

Commit

Permalink
Add "Working with the CDK in Go" and other Go changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Jerry Kindall committed Apr 22, 2021
1 parent 234fd66 commit 10ae74e
Show file tree
Hide file tree
Showing 11 changed files with 153 additions and 19 deletions.
26 changes: 13 additions & 13 deletions doc_source/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,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="w344aac23b7c31c11"></a>
### Specifying context values<a name="w346aac23b7c31c11"></a>

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

Expand All @@ -313,15 +313,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="w344aac23b7c31c13"></a>
### Specifying display format<a name="w346aac23b7c31c13"></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="w344aac23b7c31c15"></a>
### Specifying output directory<a name="w346aac23b7c31c15"></a>

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

Expand All @@ -345,7 +345,7 @@ 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\.

### Specifying AWS CloudFormation parameters<a name="w344aac23b7c33c11"></a>
### Specifying AWS CloudFormation parameters<a name="w346aac23b7c33c11"></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 @@ -367,7 +367,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="w344aac23b7c33c13"></a>
### Specifying outputs file<a name="w346aac23b7c33c13"></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 @@ -584,7 +584,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="w344aac23b7c39b7b1"></a>
### `cdk list` \(`ls`\)<a name="w346aac23b7c39b7b1"></a>

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

### `cdk synthesize` \(`synth`\)<a name="w344aac23b7c39b7b3"></a>
### `cdk synthesize` \(`synth`\)<a name="w346aac23b7c39b7b3"></a>

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

### `cdk bootstrap`<a name="w344aac23b7c39b7b5"></a>
### `cdk bootstrap`<a name="w346aac23b7c39b7b5"></a>

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

### `cdk deploy`<a name="w344aac23b7c39b7b7"></a>
### `cdk deploy`<a name="w346aac23b7c39b7b7"></a>

```
cdk deploy [STACKS..]
Expand Down Expand Up @@ -735,7 +735,7 @@ Options:
[string] [choices: "bar", "events"]
```

### `cdk destroy`<a name="w344aac23b7c39b7b9"></a>
### `cdk destroy`<a name="w346aac23b7c39b7b9"></a>

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

### `cdk diff`<a name="w344aac23b7c39b7c11"></a>
### `cdk diff`<a name="w346aac23b7c39b7c11"></a>

```
cdk diff [STACKS..]
Expand All @@ -774,7 +774,7 @@ Options:
with [string]
```

### `cdk init`<a name="w344aac23b7c39b7c13"></a>
### `cdk init`<a name="w346aac23b7c39b7c13"></a>

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

### `cdk context`<a name="w344aac23b7c39b7c15"></a>
### `cdk context`<a name="w346aac23b7c39b7c15"></a>

```
cdk context
Expand Down
1 change: 1 addition & 0 deletions doc_source/doc-history.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ The table below represents significant documentation milestones\. We fix errors

| Change | Description | Date |
| --- |--- |--- |
| [Go developer preview](#doc-history) | Add information about Go language support \(in developer preview\) including a "Working with the CDK in Go" topic\. | April 19, 2021 |
| [Import or migrate AWS CloudFormation template](#doc-history) | Add description of the new `cloudformation-include.CfnInclude` class, a powerful way to import and migrate AWS CloudFormation templates, or to vend them as AWS CDK constructs\. | October 15, 2020 |
| [Add construct tree section](#doc-history) | Information about the construct tree and its relation to the constructs you define in your AWS CDK app\. | October 5, 2020 |
| [Add Bootstrapping topic](#doc-history) | A complete explanation of why and how to bootstrap AWS environments for the CDK, including a comprehensive discussion of how to customize the process\. | September 8, 2020 |
Expand Down
3 changes: 3 additions & 0 deletions doc_source/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ The AWS CDK is designed around a handful of important concepts\. We will introdu

An AWS CDK [app](apps.md) is an application written in TypeScript, JavaScript, Python, Java, or C\# that uses the AWS CDK to define AWS infrastructure\. An app defines one or more [stacks](stacks.md)\. Stacks \(equivalent to AWS CloudFormation stacks\) contain [constructs](constructs.md), each of which defines one or more concrete AWS resources, such as Amazon S3 buckets, Lambda functions, Amazon DynamoDB tables, and so on\.

**Note**
The AWS CDK also supports Go in a developer preview\. This Guide does not include instructions or code examples for Go aside from [Working with the AWS CDK in Go](work-with-cdk-go.md)\.

Constructs \(as well as stacks and apps\) are represented as types in your programming language of choice\. You instantiate constructs within a stack to declare them to AWS, and connect them to each other using well\-defined interfaces\.

The AWS CDK includes the AWS CDK Toolkit \(also called the CLI\), a command\-line tool for working with your AWS CDK apps and stacks\. Among other functions, the Toolkit provides the ability to convert one or more AWS CDK stacks to AWS CloudFormation templates and related assets \(a process called *synthesis*\) and to deploy your stacks to an AWS account\.
Expand Down
3 changes: 3 additions & 0 deletions doc_source/hello_world.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

You've read [Getting started with the AWS CDK](getting_started.md) and set up your development environment for writing AWS CDK apps? Great\! Now let's see how it feels to work with the AWS CDK by building the simplest possible AWS CDK app\.

**Note**
The AWS CDK supports Go in a developer preview\. This tutorial does not include instructions or code examples for Go\.

In this tutorial, you'll learn about the structure of a AWS CDK project, how to use the AWS Construct Library to define AWS resources using code, and how to synthesize, diff, and deploy collections of resources using the AWS CDK Toolkit command\-line tool\.

The standard AWS CDK development workflow is similar to the workflow you're already familiar with as a developer, just with a few extra steps\.
Expand Down
2 changes: 1 addition & 1 deletion doc_source/home.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ AWS CloudFormation enables you to:
+ Build highly reliable, highly scalable, cost\-effective applications in the cloud without worrying about creating and configuring the underlying AWS infrastructure\.
+ Use a template file to create and delete a collection of resources together as a single unit \(a stack\)\.

Use the AWS CDK to define your cloud resources in a familiar programming language\. The AWS CDK supports TypeScript, JavaScript, Python, Java, and C\#/\.Net\.
Use the AWS CDK to define your cloud resources in a familiar programming language\. The AWS CDK supports TypeScript, JavaScript, Python, Java, C\#/\.Net, and \(in developer preview\) Go\.

Developers can use one of the supported programming languages to define reusable cloud components known as [Constructs](constructs.md)\. You compose these together into [Stacks](stacks.md) and [Apps](apps.md)\.

Expand Down
1 change: 1 addition & 0 deletions doc_source/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Amazon's trademarks and trade dress may not be used in
+ [Working with the AWS CDK in Python](work-with-cdk-python.md)
+ [Working with the AWS CDK in Java](work-with-cdk-java.md)
+ [Working with the AWS CDK in C#](work-with-cdk-csharp.md)
+ [Working with the AWS CDK in Go](work-with-cdk-go.md)
+ [Translating TypeScript AWS CDK code to other languages](multiple_languages.md)
+ [Concepts](core_concepts.md)
+ [Constructs](constructs.md)
Expand Down
3 changes: 2 additions & 1 deletion doc_source/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,5 @@ From time to time, we may add support to the AWS CDK for additional programming
| JavaScript | Stable |
| Python | Stable |
| Java | Stable |
| C\#/\.NET | Stable |
| C\#/\.NET | Stable |
| Go | Experimental |
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="w344aac15c23c21"></a>
## Tag priorities<a name="w346aac15c23c21"></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 @@ -4,7 +4,7 @@ The [https://docs.aws.amazon.com/cdk/api/latest/docs/cloudformation-include-read

This construct essentially adds an AWS CDK API wrapper to any resource in the template\. You can use this capability to migrate your existing AWS CloudFormation templates to the AWS CDK a piece at a time in order to take advantage of the AWS CDK's convenient higher\-level abstractions, or just to vend your AWS CloudFormation templates to AWS CDK developers by providing an AWS CDK construct API\.\.

## Importing an AWS CloudFormation template<a name="w344aac21b9b7"></a>
## Importing an AWS CloudFormation template<a name="w346aac21b9b7"></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 10ae74e

Please sign in to comment.