Found 8451 bookmarks
Newest
The AWS CDK, Or Why I Stopped Being a CDK Skeptic
The AWS CDK, Or Why I Stopped Being a CDK Skeptic

"Level 1, or L1, are low-level Constructs that correspond directly to the CloudFormation resources. Their names are prefixed with Cfn, like CfnBucket or CfnFunction. With them, you work with exactly the same structures as in raw CloudFormation, with the same parameters and behavior. Nothing more, nothing less.

L2 Constructs, on the other hand, are smarter and provide higher-level API. They come with sensible defaults and reduce the required boilerplate code to the minimum. They also provide helper functions, for example, to set the IAM permissions.

L2 Constructs are the core of the CDK. Using them, you apply many best practices for setting up individual resources, like protecting access to the S3 Buckets. And since their API is an abstraction over the CloudFormation properties, it’s a lot more concise and readable.

...

L3 Constructs, also called patterns, are even more abstract building blocks that include multiple resources. For example, with a single L3 Construct, you can create a Fargate service running on an ECS cluster behind an Application Load Balancer. Don’t make me count how many CloudFormation resources you need to define to set it up yourself…"

Level 1, or L1, are low-level Constructs that correspond directly to the CloudFormation resources. Their names are prefixed with Cfn, like CfnBucket or CfnFunction. With them, you work with exactly the same structures as in raw CloudFormation, with the same parameters and behavior. Nothing more, nothing less. L2 Constructs, on the other hand, are smarter and provide higher-level API. They come with sensible defaults and reduce the required boilerplate code to the minimum. They also provide helper functions, for example, to set the IAM permissions. L2 Constructs are the core of the CDK. Using them, you apply many best practices for setting up individual resources, like protecting access to the S3 Buckets. And since their API is an abstraction over the CloudFormation properties, it’s a lot more concise and readable. This snippet creates a secured S3 Bucket and a Lambda function with an IAM Role granting read access to it, which translates to about 80 lines of L1 Constructs code or raw CloudFormation YAML:
·betterdev.blog·
The AWS CDK, Or Why I Stopped Being a CDK Skeptic