AWS Security ChangesHomeSearch

AWS cdk documentation change

Service: cdk · 2025-05-10 · Documentation low

File: cdk/v2/guide/use-cfn-template.md

Summary

Updated documentation formatting, fixed typographical quotes, corrected code references (e.g., changed 'aws-s3.Bucket' to 'aws-s3.CfnBucket'), and removed redundant topic list. Added missing closing brace in code example.

Security assessment

Changes are primarily grammatical improvements, code example corrections, and structural cleanup. No explicit security vulnerabilities, mitigations, or security features are mentioned. The correction to 'CfnBucket' reference improves accuracy but doesn't address a security flaw.

Diff

diff --git a/cdk/v2/guide/use-cfn-template.md b/cdk/v2/guide/use-cfn-template.md
index 62fcaa5b0..cbb2df0fa 100644
--- a//cdk/v2/guide/use-cfn-template.md
+++ b//cdk/v2/guide/use-cfn-template.md
@@ -5 +5 @@
-Import a templateAccess imported resourcesReplace parametersImport other template elementsImport nested stacks
+Import an AWS CloudFormation templateAccess imported resourcesReplace parametersImport other template elementsImport nested stacks
@@ -21,15 +20,0 @@ AWS CDK v1 also included [`aws-cdk-lib.CfnInclude`](https://docs.aws.amazon.com/
-###### Topics
-
-  * Import an AWS CloudFormation template
-
-  * Access imported resources
-
-  * Replace parameters
-
-  * Import other template elements
-
-  * Import nested stacks
-
-
-
-
@@ -155 +139 @@ C#
-By default, importing a resource preserves the resource's original logical ID from the template. This behavior is suitable for importing an AWS CloudFormation template into the AWS CDK, where logical IDs must be retained. AWS CloudFormation needs this information to recognize these imported resources as the same resources from the AWS CloudFormation template.
+By default, importing a resource preserves the resource’s original logical ID from the template. This behavior is suitable for importing an AWS CloudFormation template into the AWS CDK, where logical IDs must be retained. AWS CloudFormation needs this information to recognize these imported resources as the same resources from the AWS CloudFormation template.
@@ -270 +252 @@ C#
-To verify that there won't be any unintended changes to the AWS resources in the stack, you can perform a diff. Use the AWS CDK CLI `cdk diff` command and omit any AWS CDK-specific metadata. The following is an example:
+To verify that there won’t be any unintended changes to the AWS resources in the stack, you can perform a diff. Use the AWS CDK CLI `cdk diff` command and omit any AWS CDK-specific metadata. The following is an example:
@@ -275 +257 @@ To verify that there won't be any unintended changes to the AWS resources in the
-After you import an AWS CloudFormation template, the AWS CDK app should become the source of truth for your imported resources. To make changes to your resources, modify them in your AWS CDK app and deploy with the AWS CDK CLI **cdk deploy** command.
+After you import an AWS CloudFormation template, the AWS CDK app should become the source of truth for your imported resources. To make changes to your resources, modify them in your AWS CDK app and deploy with the AWS CDK CLI `cdk deploy` command.
@@ -279 +261 @@ After you import an AWS CloudFormation template, the AWS CDK app should become t
-The name `template` in the example code represents the imported AWS CloudFormation template. To access a resource from it, use the object's [`getResource()`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.cloudformation_include.CfnInclude.html#getwbrresourcelogicalid) method. To access the returned resource as a specific kind of resource, cast the result to the desired type. This isn't necessary in Python or JavaScript. The following is an example:
+The name `template` in the example code represents the imported AWS CloudFormation template. To access a resource from it, use the object’s [`getResource()`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.cloudformation_include.CfnInclude.html#getwbrresourcelogicalid) method. To access the returned resource as a specific kind of resource, cast the result to the desired type. This isn’t necessary in Python or JavaScript. The following is an example:
@@ -313 +295 @@ From this example, `cfnBucket` is now an instance of the [`aws-s3.CfnBucket`](ht
-To wrap the L1 `CfnBucket` resource in an L2 [`aws-s3.Bucket`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_s3.Bucket.html) instance instead, use the static methods [`fromBucketArn()`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_s3.Bucket.html#static-fromwbrbucketwbrarnscope-id-bucketarn), [`fromBucketAttributes()`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_s3.Bucket.html#static-fromwbrbucketwbrattributesscope-id-attrs), or [`fromBucketName()`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_s3.Bucket.html#static-fromwbrbucketwbrnamescope-id-bucketname). Usually, the `fromBucketName()` method is most convenient. The following is an example:
+To wrap the L1 `CfnBucket` resource in an L2 [`aws-s3.CfnBucket`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_s3.Bucket.html) instance instead, use the static methods [`fromBucketArn()`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_s3.Bucket.html#static-fromwbrbucketwbrarnscope-id-bucketarn), [`fromBucketAttributes()`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_s3.Bucket.html#static-fromwbrbucketwbrattributesscope-id-attrs), or [`fromBucketName()`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_s3.Bucket.html#static-fromwbrbucketwbrnamescope-id-bucketname). Usually, the `fromBucketName()` method is most convenient. The following is an example:
@@ -347 +329 @@ Other L2 constructs have similar methods for creating the construct from an exis
-When you wrap an L1 construct in an L2 construct, it doesn't create a new resource. From our example, we are not creating a second S3; bucket. Instead, the new `Bucket` instance encapsulates the existing `CfnBucket`.
+When you wrap an L1 construct in an L2 construct, it doesn’t create a new resource. From our example, we are not creating a second S3; bucket. Instead, the new `Bucket` instance encapsulates the existing `CfnBucket`.
@@ -349 +331 @@ When you wrap an L1 construct in an L2 construct, it doesn't create a new resour
-From the example, the `bucket` is now an L2 `Bucket` construct that behaves like any other L2 construct. For example, you can grant an AWS Lambda function write access to the bucket by using the bucket's convenient [`grantWrite()`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_s3.Bucket.html#grantwbrwriteidentity-objectskeypattern) method. You don't have to define the necessary AWS Identity and Access Management (IAM) policy manually. The following is an example:
+From the example, the `bucket` is now an L2 `Bucket` construct that behaves like any other L2 construct. For example, you can grant an AWS Lambda function write access to the bucket by using the bucket’s convenient [`grantWrite()`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_s3.Bucket.html#grantwbrwriteidentity-objectskeypattern) method. You don’t have to define the necessary AWS Identity and Access Management (IAM) policy manually. The following is an example:
@@ -507,0 +490 @@ Given this resource definition in the main template, the following code shows ho
+    }
@@ -598 +581 @@ You can import multiple nested stacks with either methods. When importing the ma
-After importing a nested stack, you can access it using the main template's [`getNestedStack()`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.cloudformation_include.CfnInclude.html#getwbrnestedwbrstacklogicalid) method.
+After importing a nested stack, you can access it using the main template’s [`getNestedStack()`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.cloudformation_include.CfnInclude.html#getwbrnestedwbrstacklogicalid) method.