AWS cdk documentation change
Summary
Formatting changes including markdown syntax improvements, typo fixes (straight quotes to curly quotes), documentation example path corrections, and placeholder standardization in code samples
Security assessment
Changes are purely cosmetic/documentation improvements with no mention of security vulnerabilities, mitigations, or security feature enhancements. Updates like changing 'unique-identifier' to '<unique-identifier>' in examples improve clarity but don't address security.
Diff
diff --git a/cdk/v2/guide/hello-world.md b/cdk/v2/guide/hello-world.md index 850d34f28..9872fdb87 100644 --- a//cdk/v2/guide/hello-world.md +++ b//cdk/v2/guide/hello-world.md @@ -48 +48,2 @@ In this step, you create a new CDK project. A CDK project should be in its own d -###### To create a CDK project +**To create a CDK project** + @@ -75 +76 @@ Python -After the app has been created, also enter the following two commands. These activate the app's Python virtual environment and installs the AWS CDK core dependencies. +After the app has been created, also enter the following two commands. These activate the app’s Python virtual environment and installs the AWS CDK core dependencies. @@ -110 +111 @@ If you have Git installed, each project you create using `cdk init` is also init -During project initialization, the CDK CLI creates a CDK app containing a single CDK stack. The CDK app instance is created using the `[App](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.App.html)` construct. The following is a portion of this code from your CDK application file: +During project initialization, the CDK CLI creates a CDK app containing a single CDK stack. The CDK app instance is created using the [`App`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.App.html) construct. The following is a portion of this code from your CDK application file: @@ -164 +164 @@ Java -Located in `src/main/java/.../HelloCdkApp.java`: +Located in `src/main/java/…/HelloCdkApp.java`: @@ -243 +243 @@ Located in `hello-cdk.go`: -The CDK stack is created using the `[Stack](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.Stack.html)` construct. The following is a portion of this code from your CDK stack file: +The CDK stack is created using the [`Stack`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.Stack.html) construct. The following is a portion of this code from your CDK stack file: @@ -303 +303 @@ Java -Located in `src/main/java/.../HelloCdkStack.java`: +Located in `src/main/java/…/HelloCdkStack.java`: @@ -382 +382,2 @@ When you use the AWS CLI to configure security credentials on your local machine -###### To use the AWS CLI to obtain your AWS account ID +**To use the AWS CLI to obtain your AWS account ID** + @@ -395 +396,2 @@ When you use the AWS CLI to configure security credentials on your local machine -###### To use the AWS CLI to obtain your AWS Region +**To use the AWS CLI to obtain your AWS Region** + @@ -410 +412,2 @@ Next, you will configure the AWS environment for your CDK stack by modifying the -###### To configure the environment for your CDK stack +**To configure the environment for your CDK stack** + @@ -412 +415 @@ Next, you will configure the AWS environment for your CDK stack by modifying the - * In your _application file_ , use the `env` property of the `Stack` construct to configure your environment. The following is an example: + 1. In your _application file_ , use the `env` property of the `Stack` construct to configure your environment. The following is an example: @@ -467 +469 @@ Java -Located in `src/main/java/.../HelloCdkApp.java`: +Located in `src/main/java/…/HelloCdkApp.java`: @@ -571 +573 @@ To bootstrap your environment, run the following from the root of your CDK proje -By bootstrapping from the root of your CDK project, you don't have to provide any additional information. The CDK CLI obtains environment information from your project. When you bootstrap outside of a CDK project, you must provide environment information with the `cdk bootstrap` command. For more information, see [Bootstrap your environment for use with the AWS CDK](./bootstrapping-env.html). +By bootstrapping from the root of your CDK project, you don’t have to provide any additional information. The CDK CLI obtains environment information from your project. When you bootstrap outside of a CDK project, you must provide environment information with the `cdk bootstrap` command. For more information, see [Bootstrap your environment for use with the AWS CDK](./bootstrapping-env.html). @@ -575 +577 @@ By bootstrapping from the root of your CDK project, you don't have to provide an -In most programming environments, you build or compile code after making changes. This isn't necessary with the AWS CDK since the CDK CLI will automatically perform this step. However, you can still build manually when you want to catch syntax and type errors. The following is an example: +In most programming environments, you build or compile code after making changes. This isn’t necessary with the AWS CDK since the CDK CLI will automatically perform this step. However, you can still build manually when you want to catch syntax and type errors. The following is an example: @@ -626 +628 @@ At this point, you should have a CDK app containing a single CDK stack. To verif -If you don't see this output, verify that you are in the correct working directory of your project and try again. If you still don't see your stack, repeat Step 1: Create your CDK project and try again. +If you don’t see this output, verify that you are in the correct working directory of your project and try again. If you still don’t see your stack, repeat Step 1: Create your CDK project and try again. @@ -630 +632 @@ If you don't see this output, verify that you are in the correct working directo -In this step, you import the `[aws_lambda](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_lambda-readme.html)` module from the AWS Construct Library and use the `[Function](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.Function.html)` L2 construct. +In this step, you import the [`aws_lambda`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_lambda-readme.html) module from the AWS Construct Library and use the [`Function`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.Function.html) L2 construct. @@ -735 +737 @@ Java -Located in `src/main/java/.../HelloCdkStack.java`: +Located in `src/main/java/…/HelloCdkStack.java`: @@ -775 +777 @@ C# -Located in `src/main/java/.../HelloCdkStack.java`: +Located in `src/main/java/…/HelloCdkStack.java`: @@ -853 +855 @@ Located in `hello-cdk.go`: -Let's take a closer look at the `Function` construct. Like all constructs, the `Function` class takes three parameters: +Let’s take a closer look at the `Function` construct. Like all constructs, the `Function` class takes three parameters: @@ -857 +859 @@ Let's take a closer look at the `Function` construct. Like all constructs, the ` - * **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. + * **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. @@ -871 +873 @@ Props are represented differently in the languages supported by the AWS CDK. -If a construct's props are optional, you can omit the `props` parameter entirely. +If a construct’s props are optional, you can omit the `props` parameter entirely. @@ -876 +878 @@ If a construct's props are optional, you can omit the `props` parameter entirely -All constructs take these same three arguments, so it's easy to stay oriented as you learn about new ones. And as you might expect, you can subclass any construct to extend it to suit your needs, or if you want to change its defaults. +All constructs take these same three arguments, so it’s easy to stay oriented as you learn about new ones. And as you might expect, you can subclass any construct to extend it to suit your needs, or if you want to change its defaults. @@ -880 +882 @@ All constructs take these same three arguments, so it's easy to stay oriented as -In this step, you use the `addFunctionUrl` helper method of the `Function` construct to define a Lambda function URL. To output the value of this URL at deployment, you will create an AWS CloudFormation output using the `[CfnOutput](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.CfnOutput.html)` construct. +In this step, you use the `addFunctionUrl` helper method of the `Function` construct to define a Lambda function URL. To output the value of this URL at deployment, you will create an AWS CloudFormation output using the [`CfnOutput`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.CfnOutput.html) construct. @@ -973 +975 @@ Java -Located in `src/main/java/.../HelloCdkStack.java`: +Located in `src/main/java/…/HelloCdkStack.java`: @@ -1012 +1014 @@ C# -Located in `src/main/java/.../HelloCdkStack.java`: +Located in `src/main/java/…/HelloCdkStack.java`: @@ -1084 +1086 @@ If your app contains more than one stack, you must specify which stacks to synth -If you don't synthesize a template, the CDK CLI will automatically perform this step when you deploy. However, we recommend that you run this step before each deployment to check for synthesis errors. +If you don’t synthesize a template, the CDK CLI will automatically perform this step when you deploy. However, we recommend that you run this step before each deployment to check for synthesis errors. @@ -1100 +1102 @@ If you receive an error like the following, verify that you are in the `hello-cd -If successful, the CDK CLI will output a YAML–formatted CloudFormation template to `stdout` and save a JSON–formatted template in the `cdk.out` directory of your project. +If successful, the CDK CLI will output a `YAML`–formatted CloudFormation template to `stdout` and save a `JSON`–formatted template in the `cdk.out` directory of your project. @@ -1106 +1108 @@ The following is an example output of the CloudFormation template: - HelloWorldFunctionServiceRoleunique-identifier: + HelloWorldFunctionServiceRole<unique-identifier>: @@ -1124 +1126 @@ The following is an example output of the CloudFormation template: - HelloWorldFunctionunique-identifier: + HelloWorldFunction<unique-identifier>: @@ -1146 +1148 @@ The following is an example output of the CloudFormation template: - - HelloWorldFunctionServiceRoleunique-identifier + - HelloWorldFunctionServiceRole<unique-identifier> @@ -1150 +1152 @@ The following is an example output of the CloudFormation template: - - HelloWorldFunctionServiceRoleunique-identifier + - HelloWorldFunctionServiceRole<unique-identifier> @@ -1153 +1155 @@ The following is an example output of the CloudFormation template: - HelloWorldFunctionFunctionUrlunique-identifier: + HelloWorldFunctionFunctionUrl<unique-identifier>: @@ -1159 +1161 @@ The following is an example output of the CloudFormation template: - - HelloWorldFunctionunique-identifier + - HelloWorldFunction<unique-identifier> @@ -1163 +1165 @@ The following is an example output of the CloudFormation template: - HelloWorldFunctioninvokefunctionurlunique-identifier: + HelloWorldFunctioninvokefunctionurl<unique-identifier>: @@ -1169 +1171 @@ The following is an example output of the CloudFormation template: - - HelloWorldFunctionunique-identifier + - HelloWorldFunction<unique-identifier> @@ -1178 +1180 @@ The following is an example output of the CloudFormation template: - Analytics: v2:deflate64:unique-identifier + Analytics: v2:deflate64:<unique-identifier> @@ -1186 +1188 @@ The following is an example output of the CloudFormation template: - - HelloWorldFunctionFunctionUrlunique-identifier + - HelloWorldFunctionFunctionUrl<unique-identifier> @@ -1191 +1193 @@ The following is an example output of the CloudFormation template: - Default: /cdk-bootstrap/unique-identifier/version + Default: /cdk-bootstrap/<unique-identifier>/version @@ -1224,4 +1226,4 @@ From the root of your project, run the following. Confirm changes if prompted: - HelloCdkStack: start: Building unique-identifier:current_account-current_region - HelloCdkStack: success: Built unique-identifier:current_account-current_region - HelloCdkStack: start: Publishing unique-identifier:current_account-current_region - HelloCdkStack: success: Published unique-identifier:current_account-current_region + HelloCdkStack: start: Building <unique-identifier>:current_account-current_region + HelloCdkStack: success: Built <unique-identifier>:current_account-current_region + HelloCdkStack: start: Publishing <unique-identifier>:current_account-current_region + HelloCdkStack: success: Published <unique-identifier>:current_account-current_region @@ -1249 +1251 @@ From the root of your project, run the following. Confirm changes if prompted: -Similar to `cdk synth`, you don't have to specify the AWS CDK stack since the app contains a single stack. +Similar to `cdk synth`, you don’t have to specify the AWS CDK stack since the app contains a single stack. @@ -1267 +1269 @@ When deployment completes, the CDK CLI will output your endpoint URL. Copy this - arn:aws:cloudformation:Region:account-id:stack/HelloCdkStack/unique-identifier + arn:aws:cloudformation:<Region:account-id>:stack/HelloCdkStack/<unique-identifier> @@ -1313,0 +1316,2 @@ Located in `lib/hello-cdk-stack.ts`: + } + } @@ -1383 +1387 @@ Java -Located in `src/main/java/.../HelloCdkStack.java`: +Located in `src/main/java/…/HelloCdkStack.java`: @@ -1477,0 +1482,2 @@ Go + } + @@ -1487 +1493 @@ To preview your changes, run the `cdk diff` command. The following is an example - [~] AWS::Lambda::Function HelloWorldFunction HelloWorldFunctionunique-identifier + [~] AWS::Lambda::Function HelloWorldFunction HelloWorldFunction<unique-identifier> @@ -1518,4 +1524,4 @@ To implement your changes, run the `cdk deploy` command. The following is an exa - HelloCdkStack: start: Building unique-identifier:current_account-current_region - HelloCdkStack: success: Built unique-identifier:current_account-current_region - HelloCdkStack: start: Publishing unique-identifier:current_account-current_region - HelloCdkStack: success: Published unique-identifier:current_account-current_region + HelloCdkStack: start: Building <unique-identifier>:current_account-current_region + HelloCdkStack: success: Built <unique-identifier>:current_account-current_region + HelloCdkStack: start: Publishing <unique-identifier>:current_account-current_region + HelloCdkStack: success: Published <unique-identifier>:current_account-current_region @@ -1530 +1536 @@ To implement your changes, run the `cdk deploy` command. The following is an exa - HelloCdkStack.myFunctionUrlOutput = https://unique-identifier.lambda-url.<Region>.on.aws/ + HelloCdkStack.myFunctionUrlOutput = https://<unique-identifier>.lambda-url.<Region>.on.aws/ @@ -1532 +1538 @@ To implement your changes, run the `cdk deploy` command. The following is an exa - arn:aws:cloudformation:Region:account-id:stack/HelloCdkStack/unique-identifier + arn:aws:cloudformation:<Region:account-id>:stack/HelloCdkStack/<unique-identifier> @@ -1557 +1563 @@ To delete your application, run the `cdk destroy` command and confirm your reque -Congratulations! You've completed this tutorial and have used the AWS CDK to successfully create, modify, and delete resources in the AWS Cloud. You're now ready to begin using the AWS CDK. +Congratulations! You’ve completed this tutorial and have used the AWS CDK to successfully create, modify, and delete resources in the AWS Cloud. You’re now ready to begin using the AWS CDK.