AWS cdk documentation change
Summary
Formatting changes including URL corrections, typo fixes (straight quotes to curly quotes), and code syntax fixes (added missing closing parenthesis in Java example).
Security assessment
The changes are purely documentation formatting and typo corrections. No security-related content was added or modified. The mention of KMS encryption in the bucket example was pre-existing and not part of the diff changes.
Diff
diff --git a/cdk/v2/guide/constructs.md b/cdk/v2/guide/constructs.md index 3f1ae2228..d37cedf8a 100644 --- a//cdk/v2/guide/constructs.md +++ b//cdk/v2/guide/constructs.md @@ -32 +32 @@ L1 constructs are great to use when you are familiar with AWS CloudFormation and -In the AWS Construct Library, L1 constructs are named starting with `Cfn`, followed by an identifier for the AWS CloudFormation resource that it represents. For example, the `[CfnBucket](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_s3.CfnBucket.html)` construct is an L1 construct that represents an `[AWS::S3::Bucket](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-s3-bucket.html)` AWS CloudFormation resource. +In the AWS Construct Library, L1 constructs are named starting with `Cfn`, followed by an identifier for the AWS CloudFormation resource that it represents. For example, the [`CfnBucket`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_s3.CfnBucket.html) construct is an L1 construct that represents an [` AWS::S3::Bucket`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_s3.Bucket.html) AWS CloudFormation resource. @@ -34 +34 @@ In the AWS Construct Library, L1 constructs are named starting with `Cfn`, follo -L1 constructs are generated from the [AWS CloudFormation resource specification](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-resource-specification.html). If a resource exists in AWS CloudFormation, it'll be available in the AWS CDK as an L1 construct. New resources or properties may take up to a week to become available in the AWS Construct Library. For more information, see [AWS resource and property types reference](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html) in the _AWS CloudFormation User Guide_. +L1 constructs are generated from the [AWS CloudFormation resource specification](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-resource-specification.html). If a resource exists in AWS CloudFormation, it’ll be available in the AWS CDK as an L1 construct. New resources or properties may take up to a week to become available in the AWS Construct Library. For more information, see [AWS resource and property types reference](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html) in the _AWS CloudFormation User Guide_. @@ -43 +43 @@ L2 constructs also provide helper methods for most resources that make it simple -The `[s3.Bucket](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_s3.Bucket.html)` class is an example of an L2 construct for an Amazon Simple Storage Service (Amazon S3) bucket resource. +The [`s3.Bucket`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_s3.Bucket.html) class is an example of an L2 construct for an Amazon Simple Storage Service (Amazon S3) bucket resource. @@ -54 +54 @@ To provide complete system designs, or substantial parts of a larger system, L3 -The `[ecsPatterns.ApplicationLoadBalancedFargateService](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ecs_patterns.ApplicationLoadBalancedFargateService.html)` class is an example of an L3 construct that represents an AWS Fargate service running on an Amazon Elastic Container Service (Amazon ECS) cluster and fronted by an application load balancer. +The [`ecsPatterns.ApplicationLoadBalancedFargateService`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ecs_patterns.ApplicationLoadBalancedFargateService.html) class is an example of an L3 construct that represents an AWS Fargate service running on an Amazon Elastic Container Service (Amazon ECS) cluster and fronted by an application load balancer. @@ -72 +72 @@ Constructs are implemented in classes that extend the [`Construct`](https://docs - * **scope** – The construct's parent or owner. This can either be a stack or another construct. Scope determines the construct's place in the [construct tree](./apps.html#apps-tree). You should usually pass `this` (`self` in Python), which represents the current object, for the scope. + * **scope** – The construct’s parent or owner. This can either be a stack or another construct. Scope determines the construct’s place in the [construct tree](./apps.html#apps-tree). You should usually pass `this` (`self` in Python), which represents the current object, for the scope. @@ -85 +85 @@ Identifiers need only be unique within a scope. This lets you instantiate and re -Most constructs accept `props` as their third argument (or in Python, keyword arguments), a name/value collection that defines the construct's configuration. The following example defines a bucket with AWS Key Management Service (AWS KMS) encryption and static website hosting enabled. Since it does not explicitly specify an encryption key, the `Bucket` construct defines a new `kms.Key` and associates it with the bucket. +Most constructs accept `props` as their third argument (or in Python, keyword arguments), a name/value collection that defines the construct’s configuration. The following example defines a bucket with AWS Key Management Service (AWS KMS) encryption and static website hosting enabled. Since it does not explicitly specify an encryption key, the `Bucket` construct defines a new `kms.Key` and associates it with the bucket. @@ -144 +143 @@ Constructs are classes that extend the base [Construct](https://docs.aws.amazon. -The AWS CDK framework doesn't put any restrictions on the APIs of constructs. Authors can define any API they want. However, the AWS constructs that are included with the AWS Construct Library, such as `s3.Bucket`, follow guidelines and common patterns. This provides a consistent experience across all AWS resources. +The AWS CDK framework doesn’t put any restrictions on the APIs of constructs. Authors can define any API they want. However, the AWS constructs that are included with the AWS Construct Library, such as `s3.Bucket`, follow guidelines and common patterns. This provides a consistent experience across all AWS resources. @@ -196 +195 @@ Go -Another common pattern is for AWS constructs to set one of the resource's attributes from data supplied elsewhere. Attributes can include Amazon Resource Names (ARNs), names, or URLs. +Another common pattern is for AWS constructs to set one of the resource’s attributes from data supplied elsewhere. Attributes can include Amazon Resource Names (ARNs), names, or URLs. @@ -198 +197 @@ Another common pattern is for AWS constructs to set one of the resource's attrib -The following code defines an AWS Lambda function and associates it with an Amazon Simple Queue Service (Amazon SQS) queue through the queue's URL in an environment variable. +The following code defines an AWS Lambda function and associates it with an Amazon Simple Queue Service (Amazon SQS) queue through the queue’s URL in an environment variable. @@ -251 +250 @@ Java - "QUEUE_URL", jobsQueue.getQueueUrl()) + "QUEUE_URL", jobsQueue.getQueueUrl())) @@ -287 +286 @@ For information about the most common API patterns in the AWS Construct Library, -The `[App](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.App.html)` and `[Stack](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.Stack.html)` classes from the AWS Construct Library are unique constructs. Compared to other constructs, they don't configure AWS resources on their own. Instead, they are used to provide context for your other constructs. All constructs that represent AWS resources must be defined, directly or indirectly, within the scope of a `Stack` construct. `Stack` constructs are defined within the scope of an `App` construct. +The [`App`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.App.html) and [`Stack`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.Stack.html) classes from the AWS Construct Library are unique constructs. Compared to other constructs, they don’t configure AWS resources on their own. Instead, they are used to provide context for your other constructs. All constructs that represent AWS resources must be defined, directly or indirectly, within the scope of a `Stack` construct. `Stack` constructs are defined within the scope of an `App` construct. @@ -442 +441 @@ Go -L1 constructs map directly to individual AWS CloudFormation resources. You must provide the resource's required configuration. +L1 constructs map directly to individual AWS CloudFormation resources. You must provide the resource’s required configuration. @@ -491 +490 @@ Go -Construct properties that aren't simple Booleans, strings, numbers, or containers are handled differently in the supported languages. +Construct properties that aren’t simple Booleans, strings, numbers, or containers are handled differently in the supported languages. @@ -594 +592 @@ In Go, these types are named using the name of the L1 construct, an underscore, -You can't use L2 property types with L1 constructs, or vice versa. When working with L1 constructs, always use the types defined for the L1 construct you're using. Do not use types from other L1 constructs (some may have the same name, but they are not the same type). +You can’t use L2 property types with L1 constructs, or vice versa. When working with L1 constructs, always use the types defined for the L1 construct you’re using. Do not use types from other L1 constructs (some may have the same name, but they are not the same type). @@ -596 +594 @@ You can't use L2 property types with L1 constructs, or vice versa. When working -Some of our language-specific API references currently have errors in the paths to L1 property types, or don't document these classes at all. We hope to fix this soon. In the meantime, remember that such types are always inner classes of the L1 construct they are used with. +Some of our language-specific API references currently have errors in the paths to L1 property types, or don’t document these classes at all. We hope to fix this soon. In the meantime, remember that such types are always inner classes of the L1 construct they are used with. @@ -676 +674 @@ Go - })> + }) @@ -686 +684 @@ Go -In addition to using existing constructs, you can also write your own constructs and let anyone use them in their apps. All constructs are equal in the AWS CDK. Constructs from the AWS Construct Library are treated the same as a construct from a third-party library published via NPM, Maven, or PyPI. Constructs published to your company's internal package repository are also treated in the same way. +In addition to using existing constructs, you can also write your own constructs and let anyone use them in their apps. All constructs are equal in the AWS CDK. Constructs from the AWS Construct Library are treated the same as a construct from a third-party library published via NPM, Maven, or PyPI. Constructs published to your company’s internal package repository are also treated in the same way. @@ -903 +900 @@ Go -Typically, you would also want to expose some properties or methods on your constructs. It's not very useful to have a topic hidden behind your construct, because users of your construct aren't able to subscribe to it. Adding a `topic` property lets consumers access the inner topic, as shown in the following example: +Typically, you would also want to expose some properties or methods on your constructs. It’s not very useful to have a topic hidden behind your construct, because users of your construct aren’t able to subscribe to it. Adding a `topic` property lets consumers access the inner topic, as shown in the following example: @@ -1002 +999 @@ Go -To do this in Go, we'll need a little extra plumbing. Our original `NewNotifyingBucket` function returned an `awss3.Bucket`. We'll need to extend `Bucket` to include a `topic` member by creating a `NotifyingBucket` struct. Our function will then return this type. +To do this in Go, we’ll need a little extra plumbing. Our original `NewNotifyingBucket` function returned an `awss3.Bucket`. We’ll need to extend `Bucket` to include a `topic` member by creating a `NotifyingBucket` struct. Our function will then return this type.