AWS Cloud Development Kit: Difference between revisions

Content deleted Content added
Launching CDK: Disambiguating link
See also: rm dupe link in main article
 
(8 intermediate revisions by 6 users not shown)
Line 18:
 
== Overview ==
AWS CDK<ref>{{Cite web |last=Steenman |first=Danny |date=2022-07-23 |title=What is the AWS CDK? (A beginners guide) |url=https://towardsthecloud.com/aws-cdk |access-date=2023-09-23 |website=Towards the Cloud |language=en-US}}</ref> allows developers to model and provision cloud infrastructure resources using programming languages such as [[TypeScript]], [[JavaScript]], [[Python (programming language)|Python]], [[Java (programming language)|Java]], [[Go (programming language)|Go]], and [[C Sharp (programming language)|C#]].<ref>{{Cite web |title=AWS Cloud Development Kit (CDK) FAQs |url=https://aws.amazon.com/cdk/faqs/ |access-date=2023-03-19 |publisher=Amazon Web Services, Inc.}}</ref><ref>{{Cite news |last=Ramel |first=David |orig-date=12 March 2019 |title=AWS Adds .NET, Java Support in Cloud Development Kit |url=https://awsinsider.net/articles/2019/12/03/cdk-net-java.aspx}}</ref> Developers can define their infrastructure using the same programming languages and tools they use for their application code, enabling better integration between application and infrastructure development processes.<ref>{{Cite web |title=What's so Cool About AWS CDK? |url=https://www.beyondjava.net/cdk-primer |access-date=2023-03-19 |website=www.beyondjava.net}}</ref>
 
AWS CDK includes a library of constructs,<ref>{{Cite web |date=2022-03-10 |title=An Introduction To AWS Cloud Development Kit (CDK) |url=https://www.smashingmagazine.com/2022/03/introduction-aws-cloud-development-kit/ |access-date=2023-03-19 |website=Smashing Magazine |language=en}}</ref> which are pre-built components that encapsulate one or more AWS resources and their configurations.<ref>{{Cite web |title=Working with Constructs |url=https://docs.aws.amazon.com/cdk/latest/guide/constructs.html |access-date=2023-03-19 |publisher=Amazon Web Services, Inc.}}</ref> Constructs can be used to build higher-level abstractions known as patterns, which simplify common cloud infrastructure patterns and best practices. The AWS Construct Library provides a collection of constructs for various AWS services, such as [[Amazon S3]], [[Amazon EC2]], and [[AWS Lambda]].<ref>{{Cite web |title=AWS Construct Library |url=https://docs.aws.amazon.com/cdk/latest/guide/aws_construct_lib.html |access-date=2023-03-19 |publisher=Amazon Web Services, Inc.}}</ref>
Line 24:
== Key features ==
 
* '''Familiar programming languages''': AWS CDK supports TypeScript, JavaScript, Python, Java, Go, and C#, allowing developers to use their preferred programming languages for defining cloud infrastructure.
* '''Reusable constructs''': AWS CDK includes a library of constructs that encapsulate AWS resources, their configurations, and best practices, promoting reusability and reducing boilerplate code.
* '''Higher-level abstractions''': Developers can use constructs<ref>{{Cite web |last=Steenman |first=Danny |date=2022-05-03 |title=How to create an AWS CDK Construct |url=https://towardsthecloud.com/aws-cdk-construct |access-date=2023-09-23 |website=Towards the Cloud |language=en-US}}</ref> to create custom, higher-level abstractions, known as patterns, to simplify complex infrastructure patterns and improve maintainability.
* '''Integration with AWS CloudFormation''': AWS CDK applications are compiled into AWS CloudFormation templates, ensuring compatibility with existing AWS CloudFormation features and tools.<ref>{{Cite web |title=AWS Cloud Development Kit (CDK) FAQs |url=https://aws.amazon.com/cdk/faqs/ |access-date=2023-03-19 |publisher=Amazon Web Services, Inc.}}</ref>
* '''Modularity and extensibility''': AWS CDK promotes modularity and extensibility by allowing developers to create and share custom constructs and patterns.
Line 41:
 
== Example code ==
The following is AWS CDK code written in TypeScript that creates an Amazon S3 bucket with public read access. This code imports the necessary AWS CDK libraries to create a new CloudFormation stack with a single Amazon S3 bucket resource. The Bucket constructor is used to create the bucket with the specified properties, including encryption, block public access, public read access, and versioning. The removalPolicyremoval policy property specifies that the bucket should be destroyed when the stack is deleted.
 
<syntaxhighlight lang="typescript">
<pre>
import { Construct, Stack, StackProps } from 'aws-cdk-lib';
import { Bucket } from 'aws-cdk-lib/aws-s3';
Line 62:
}
}
</syntaxhighlight>
</pre>
 
== See also ==
 
* [[AWS CloudFormation]]
* [[Terraform (software)|Terraform]]
* [[Amazon Web Services]]
* [[Infrastructure as Code]]
 
Line 84 ⟶ 82:
 
[[Category:Amazon Web Services]]
[[Category:Software using the Apache license]]