AWS cdk documentation change
Summary
Formatting updates for code elements, syntax corrections, and tutorial step restructuring
Security assessment
Changes include code formatting improvements (backticks), path corrections, and tutorial flow adjustments. No security-related content added or modified - focuses on documentation clarity rather than security features or vulnerabilities.
Diff
diff --git a/cdk/v2/guide/serverless-example.md b/cdk/v2/guide/serverless-example.md index 967768e60..ec5631e53 100644 --- a//cdk/v2/guide/serverless-example.md +++ b//cdk/v2/guide/serverless-example.md @@ -11 +11 @@ This is the AWS CDK v2 Developer Guide. The older CDK v1 entered maintenance on -In this tutorial, you use the AWS Cloud Development Kit (AWS CDK) to create a simple serverless Hello World application that implements a basic API backend consisting of the following: +In this tutorial, you use the AWS Cloud Development Kit (AWS CDK) to create a simple serverless `Hello World` application that implements a basic API backend consisting of the following: @@ -41,23 +40,0 @@ For this tutorial, you will create and interact with your application in the fol -###### Topics - - * Prerequisites - - * Step 1: Create a CDK project - - * Step 2: Create your Lambda function - - * Step 3: Define your constructs - - * Step 4: Prepare your application for deployment - - * Step 5: Deploy your application - - * Step 6: Interact with your application - - * Step 7: Delete your application - - * Troubleshooting - - - - @@ -70 +47 @@ Before starting this tutorial, complete the following: - * Install Node.js and npm. + * Install Node.js and `npm`. @@ -92 +69,2 @@ In this step, you create a new CDK project using the AWS CDK CLI `cdk init` comm -###### To create a CDK project +**To create a CDK project** + @@ -320 +298 @@ Java -Located in `src/main/java/.../CdkHelloWorldApp.java`: +Located in `src/main/java/…/CdkHelloWorldApp.java`: @@ -582 +560 @@ Java -Located in `src/main/java/.../CdkHelloWorldStack.java`: +Located in `src/main/java/…/CdkHelloWorldStack.java`: @@ -754 +731 @@ Python -We import the `aws_lambda` module as `_lambda` because `lambda` is a build-in identifier in Python. +We import the `aws_lambda` module as `\_lambda` because `lambda` is a build-in identifier in Python. @@ -1118 +1095 @@ If you receive an error like the following, verify that you are in the `cdk-hell -If successful, the AWS CDK CLI will output the AWS CloudFormation template in YAML format at the command prompt. A JSON formatted template is also saved in the `cdk.out` directory. +If successful, the AWS CDK CLI will output the AWS CloudFormation template in `YAML` format at the command prompt. A `JSON` formatted template is also saved in the `cdk.out` directory. @@ -1412 +1389 @@ From the root of your project, run the following. Confirm changes if prompted: - Do you wish to deploy these changes (y/n)? y + Do you wish to deploy these changes (y/n)? <y> @@ -1455 +1432 @@ To delete your application, run `cdk destroy`. When prompted, confirm your reque -### Error: {“message”: “Internal server error”}% +### Error: {"message": "Internal server error"}% @@ -1459 +1436,2 @@ When invoking the deployed Lambda function, you receive this error. This error c -###### To troubleshoot further +**To troubleshoot further** + @@ -1480,0 +1459,2 @@ Use the AWS CLI to invoke your Lambda function. + } + } @@ -1502,0 +1483 @@ Use the AWS CLI to invoke your Lambda function. +**Possible cause: API Gateway resource is defined incorrectly in your stack file** @@ -1504,0 +1486 @@ Use the AWS CLI to invoke your Lambda function. +If `output.txt` shows a successful Lambda function response, the issue could be with how you defined your API Gateway REST API. The AWS CLI invokes your Lambda directly, not through your endpoint. Check your code to ensure it matches this tutorial. Then, deploy again. @@ -1506 +1488 @@ Use the AWS CLI to invoke your Lambda function. -**Possible cause: API Gateway resource is defined incorrectly in your stack file.** +**Possible cause: Lambda resource is defined incorrectly in your stack file** @@ -1509 +1491 @@ Use the AWS CLI to invoke your Lambda function. -If `output.txt` shows a successful Lambda function response, the issue could be with how you defined your API Gateway REST API. The AWS CLI invokes your Lambda directly, not through your endpoint. Check your code to ensure it matches this tutorial. Then, deploy again. +If `output.txt` returns an error, the issue could be with how you defined your Lambda function. Check your code to ensure it matches this tutorial. Then deploy again. @@ -1511 +1492,0 @@ If `output.txt` shows a successful Lambda function response, the issue could be -**Possible cause: Lambda resource is defined incorrectly in your stack file.** @@ -1514 +1494,0 @@ If `output.txt` shows a successful Lambda function response, the issue could be -If `output.txt` returns an error, the issue could be with how you defined your Lambda function. Check your code to ensure it matches this tutorial. Then deploy again.