Skip to content

Commit 7f30d44

Browse files
committed
Update: Improve 'getting started' workflow and add 'prerequisites' page
1 parent cba3d42 commit 7f30d44

File tree

8 files changed

+347
-216
lines changed

8 files changed

+347
-216
lines changed

v2/cli.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ The CDK CLI actually runs your app and synthesizes fresh templates before most o
326326

327327
See `cdk synth --help` for all available options\. A few of the most frequently used options are covered in the following section\.
328328

329-
### Specify context values<a name="w92aac65c33c11"></a>
329+
### Specify context values<a name="w92aac69c33c11"></a>
330330

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

@@ -345,15 +345,15 @@ When deploying multiple stacks, the specified context values are normally passed
345345
cdk synth --context Stack1:key=value Stack2:key=value Stack1 Stack2
346346
```
347347

348-
### Specify display format<a name="w92aac65c33c13"></a>
348+
### Specify display format<a name="w92aac69c33c13"></a>
349349

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

352352
```
353353
cdk synth --json MyStack
354354
```
355355

356-
### Specify the output directory<a name="w92aac65c33c15"></a>
356+
### Specify the output directory<a name="w92aac69c33c15"></a>
357357

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

@@ -429,7 +429,7 @@ Git\-style wildcards, both `*` and `**`, can be used in the `"watch"` and `"buil
429429
**Important**
430430
Watch mode is not recommended for production deployments\.
431431

432-
### Specify AWS CloudFormation parameters<a name="w92aac65c35c19"></a>
432+
### Specify AWS CloudFormation parameters<a name="w92aac69c35c19"></a>
433433

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

@@ -451,7 +451,7 @@ cdk deploy MyStack YourStack --parameters MyStack:uploadBucketName=UploadBucket
451451

452452
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\.
453453

454-
### Specify outputs file<a name="w92aac65c35c21"></a>
454+
### Specify outputs file<a name="w92aac69c35c21"></a>
455455

456456
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\.
457457

v2/getting_started.md

Lines changed: 23 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -1,92 +1,14 @@
11
# Getting started with the AWS CDK<a name="getting_started"></a>
22

3-
Get started with the AWS Cloud Development Kit \(AWS CDK\) by creating an AWS account, configuring the AWS CDK Command Line Interface \(AWS CDK CLI\) and creating your first CDK app\.
3+
Get started with the AWS Cloud Development Kit \(AWS CDK\) by installing and configuring the AWS CDK Command Line Interface \(AWS CDK CLI\)\. Then, use the CDK CLI to create your first CDK app, bootstrap your AWS environment, and deploy your application\.
44

55
## Prerequisites<a name="getting_started_prerequisites"></a>
66

7-
Before getting started with the AWS CDK, we recommend that you have a basic understanding of what the AWS CDK is\. For more information, see [What is the AWS CDK?](home.md) and [Learn AWS CDK core concepts](core_concepts.md)\.
7+
Before getting started with the AWS CDK, complete all prerequisites\. These prerequisites are required for those that are new to AWS or new to programming\. For instructions, see [AWS CDK prerequisites](prerequisites.md)\.
88

9-
## Step 1: Create an AWS account and administrative user<a name="getting_started_account"></a>
9+
We recommend that you have a basic understanding of what the AWS CDK is\. For more information, see [What is the AWS CDK?](home.md) and [Learn AWS CDK core concepts](core_concepts.md)\.
1010

11-
If you or your organization are new to AWS, you must sign up for an AWS account and create an administrative user\. For instructions, see [Getting set up with IAM](https://docs.aws.amazon.com/IAM/latest/UserGuide/getting-set-up.html) in the *IAM User Guide*\.
12-
13-
You can manage IAM using different methods, such as through the AWS console, the AWS Command Line Interface \(AWS CLI\), or through application interfaces \(APIs\) in the associated SDKs\. When using IAM with the AWS CDK CLI, you will primarily use the AWS CLI to configure and manage security credentials\. To learn more, see [AWS Command Line Interface \(CLI\) and Software Development Kits \(SDKs\)](https://docs.aws.amazon.com/IAM/latest/UserGuide/management_methods.html#management-method-cli-sdk) in the *IAM User Guide*\.
14-
15-
Once you’ve created an administrative user, you can start using the AWS CDK by installing the CDK CLI\. However, we recommend that you first determine your method of managing users, adhering to the IAM best practice of [applying least\-privilege permissions](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#grant-least-privilege)\. Rather than using your administrative user for everything, you create IAM users and grant only the permissions required to perform a task\.
16-
17-
## Step 2: Determine your method of managing users<a name="getting_started_users"></a>
18-
19-
Once you’ve created your AWS account and administrative user, you’ll want to determine your method of managing users\. To learn about the different methods of managing users, see [Overview of AWS identity management: Users](https://docs.aws.amazon.com/IAM/latest/UserGuide/introduction_identity-management.html) in the *IAM User Guide*\.
20-
21-
If your organization has a method of managing users, follow their guidance\. Otherwise, we recommend using AWS IAM Identity Center to create and manage users\. With IAM Identity Center, you can manage AWS accounts, users, and permissions from a centrally managed service\. You can also use an identity provider to authenticate users and provide temporary credentials for use with the CDK CLI\. This is an [IAM security best practice](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#bp-users-federation-idp)\. For an introduction to IAM Identity Center, see [What is IAM Identity Center?](https://docs.aws.amazon.com/singlesignon/latest/userguide/what-is.html) in the *AWS IAM Identity Center User Guide*\.
22-
23-
As a user, you need to configure security credentials in your local development environment for the CDK CLI\. We recommend that you use install and use the AWS Command Line Interface \(AWS CLI\) to accomplish this\.
24-
25-
## Step 3: Install the AWS CLI<a name="getting_started_cli"></a>
26-
27-
As a user, you use the AWS CLI to create and manage configuration and credential files on your local machine\. These files are used to store, manage, and generate security credentials for use with the CDK CLI\.
28-
29-
To install the AWS CLI, see [Install or update to the latest version of the AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html) in the *AWS Command Line Interface User Guide*\.
30-
31-
To learn more about these files, see [Configuration and credential file settings](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html) in the *AWS Command Line Interface User Guide*\.
32-
33-
After installing the AWS CLI, you will configure security credentials in a later step\.
34-
35-
## Step 4: Install Node\.js and programming language prerequisites<a name="getting_started_node"></a>
36-
37-
All AWS CDK developers, regardless of the supported programming language that you will use, require [https://nodejs.org/en/download/](https://nodejs.org/en/download/) 14\.15\.0 or later\. All supported programming languages use the same backend, which runs on Node\.js\. We recommend a version in [active long\-term support](https://nodejs.org/en/about/releases/)\. If your organization has a different recommendation, follow their guidance\.
38-
39-
**Important**
40-
Node\.js versions 13\.0\.0 through 13\.6\.0 are not compatible with the AWS CDK due to compatibility issues with its dependencies\.
41-
42-
Other programming language prerequisites depend on the language that you will use to develop AWS CDK applications:
43-
44-
------
45-
#### [ TypeScript ]
46-
+ TypeScript 3\.8 or later \(`npm -g install typescript`\)
47-
48-
------
49-
#### [ JavaScript ]
50-
51-
No additional requirements
52-
53-
------
54-
#### [ Python ]
55-
+ Python 3\.7 or later including `pip` and `virtualenv`
56-
57-
------
58-
#### [ Java ]
59-
+ Java Development Kit \(JDK\) 8 \(a\.k\.a\. 1\.8\) or later
60-
+ Apache Maven 3\.5 or later
61-
62-
Java IDE recommended \(we use Eclipse in some examples in this guide\)\. IDE must be able to import Maven projects\. Check to make sure that your project is set to use Java 1\.8\. Set the JAVA\_HOME environment variable to the path where you have installed the JDK\.
63-
64-
------
65-
#### [ C\# ]
66-
67-
\.NET Core 3\.1 or later, or \.NET 6\.0 or later\.
68-
69-
Visual Studio 2019 \(any edition\) or Visual Studio Code recommended\.
70-
71-
------
72-
#### [ Go ]
73-
74-
Go 1\.1\.8 or later\.
75-
76-
------
77-
78-
For more detailed information, see the *Prerequisites* section for your language:
79-
+ [Working with the AWS CDK in TypeScript](work-with-cdk-typescript.md)
80-
+ [Working with the AWS CDK in JavaScript](work-with-cdk-javascript.md)
81-
+ [Working with the AWS CDK in Python](work-with-cdk-python.md)
82-
+ [Working with the AWS CDK in Java](work-with-cdk-java.md)
83-
+ [Working with the AWS CDK in C\#](work-with-cdk-csharp.md)
84-
+ [Working with the AWS CDK in Go](work-with-cdk-go.md)
85-
86-
**Third\-party language deprecation**
87-
Each language version is only supported until it is EOL \(End Of Life\) and is subject to change with prior notice\.
88-
89-
## Step 5: Install the AWS CDK CLI<a name="getting_started_install"></a>
11+
## Install the AWS CDK CLI<a name="getting_started_install"></a>
9012

9113
Use the Node Package Manager to install the CDK CLI\. We recommend that you install it globally using the following command:
9214

@@ -102,41 +24,46 @@ $ npm install -g aws-cdk@X.YY.Z
10224

10325
If you want to use multiple versions of the AWS CDK, consider installing a matching version of the CDK CLI in individual CDK projects\. To do this, remove the `-g` option from the `npm install` command\. Then, use `npx aws-cdk` to invoke the CDK CLI\. This will run a local version if it exists\. Otherwise, the globally installed version will be used\.
10426

105-
**Note**
106-
If you get a permission error, and have administrator access on your system, try `sudo npm install -g aws-cdk`\.
27+
### Troubleshoot a CDK CLI installation<a name="getting_started_install_troubleshoot"></a>
10728

108-
Run the following command to verify a successful installation\. The AWS CDK CLI should output the version number:
29+
If you get a permission error, and have administrator access on your system, run the following:
10930

11031
```
111-
$ cdk --version
32+
$ sudo npm install -g aws-cdk
11233
```
11334

114-
If you receive an error message, try uninstalling the AWS CDK CLI by running the following:
35+
If you receive an error message, try uninstalling the CDK CLI by running the following:
11536

11637
```
11738
$ npm uninstall -g aws-cdk
11839
```
11940

120-
Then, repeat steps to reinstall the AWS CDK CLI\.
41+
Then, repeat steps to reinstall the CDK CLI\.
12142

122-
## Step 6: Configure security credentials for the CDK CLI<a name="getting_started_creds"></a>
43+
### Verify a successful CDK CLI installation<a name="getting_started_install_verify"></a>
44+
45+
Run the following command to verify a successful installation\. The AWS CDK CLI should output the version number:
46+
47+
```
48+
$ cdk --version
49+
```
12350

124-
When you develop with the AWS CDK in your local environment, you will primarily use the CDK CLI to interact with AWS\. These interactions include deploying CDK stacks, performing stack diffs, importing resources into the CDK, and more\.
51+
## Configure the AWS CDK CLI<a name="getting_started_configure"></a>
12552

126-
To perform these actions, you must configure security credentials for the CDK CLI on your local machine\. This lets AWS know who you are and what permissions you have\. For guidance, see [Configure security credentials for the AWS CDK CLI](configure-access.md)\.
53+
After installing the CDK CLI, you can start using it to develop applications on your local machine\. To interact with AWS, such as deploying applications, you must have security credentials configured on your local machine with permissions to perform any actions that you initiate\.
12754

128-
## Step 7: Bootstrap your AWS environment<a name="getting_started_bootstrap"></a>
55+
To configure security credentials on your local machine, you use the AWS CLI\. How you configure security credentials depends on how you manage users\. For instructions, see [Authentication and access credentials](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-authentication.html) in the *AWS Command Line Interface User Guide*\.
12956

130-
CDK stacks are deployed into AWS [environments](environments.md)\. Before you can deploy a CDK stack into an environment, the environment must first be [bootstrapped](bootstrapping.md)\.
57+
The CDK CLI will automatically use the security credentials that you configure with the AWS CLI\. For example, if you are an IAM Identity Center user, you can use the `aws configure sso` command to configure security credentials\. If you are an IAM user, you can use the `aws configure` command\. The AWS CLI will guide you through configuring security credentials on your local machine and save the necessary information in your `config` and `credentials` files\. Then, when you use the CDK CLI, such as deploying an application with `cdk deploy`, the CDK CLI will use your configured security credentials\.
13158

132-
To bootstrap your environment, use the CDK CLI `cdk bootstrap` command\. For instructions, see [How to bootstrap your environment](bootstrapping-env.md#bootstrapping-howto)\.
59+
Just like the AWS CLI, the CDK CLI will use your `default` profile by default\. You can specify a profile using the CDK CLI `\-\-profile` option\. For more information on using security credentials with the CDK CLI, see [Configure security credentials for the AWS CDK CLI](configure-access.md)\.
13360

134-
## Step 8: \(Optional\) Install additional AWS CDK tools<a name="getting_started_tools"></a>
61+
## \(Optional\) Install additional AWS CDK tools<a name="getting_started_tools"></a>
13562

13663
The [AWS Toolkit for Visual Studio Code](https://aws.amazon.com/visualstudiocode/) is an open source plug\-in for Visual Studio Code that helps you create, debug, and deploy applications on AWS\. The toolkit provides an integrated experience for developing AWS CDK applications\. It includes the AWS CDK Explorer feature to list your AWS CDK projects and browse the various components of the CDK application\. For instructions, see the following:
13764
+ [Installing the AWS Toolkit for Visual Studio Code](https://docs.aws.amazon.com/toolkit-for-vscode/latest/userguide/setup-toolkit.html)\.
13865
+ [AWS CDK for VS Code](https://docs.aws.amazon.com/toolkit-for-vscode/latest/userguide/cdk-explorer.html)\.
13966

140-
## Step 9: Create your first CDK app<a name="getting_started_app"></a>
67+
## Create your first CDK app<a name="getting_started_app"></a>
14168

14269
You're now ready to get started with using the AWS CDK by creating your first CDK app\. For instructions, see [Tutorial: Create your first AWS CDK app](hello_world.md)\.

0 commit comments

Comments
 (0)