29 Aralık 2022 Perşembe

AWS CDK - Cloud Development Kit

Giriş
Açıklaması şöyle
The AWS CDK is an open-source software development framework to model and provision cloud application resources through AWS CloudFormation, programmatically with languages like Typescript, Javascript, Go, Python, C#, and Java.
Aslında bu AWS CDK ile altta Java kodu ile CloudFormation Template formatında yaml dosyası oluşturuluyor.

Kavramlar
Açıklaması şöyle
L1 Construct
Represent all resources available in AWS CloudFormation. These constructs start with the prefix Cfn. For example, CfnDBInstance represents the AWS::RDS::DBInstance

L2 Construct
Also, represent all resources available in AWS CloudFormation, but at a high level. Offer convenients defaults and reduce the need to know all details about the AWS resource. For example, Topic.Builder.create represent the creation of topic in AWS.

L3 Construct
These constructs are to help you to complete tasks that involve multiple resources in AWS. For example, The LambdaRestApi construct represents an Amazon API Gateway API that’s backed by an AWS Lambda function.

Stacks
Is the unit of deployment. All AWS resources are defined within a stack.

We can define a lot of stack numbers in we AWS CDK app.

Apps
An app is a container for one o more stacks, its serve as stack’s scope.
Bir örnek burada

Maven
Şu satırı dahil ederiz
<properties>
  <cdk.version>2.51.1</cdk.version>
  <constructs.version>[10.0.0,11.0.0)</constructs.version>
  <aws.java.sdk.version>2.16.1</aws.java.sdk.version>
</properties>

<dependencies>
  <dependency>
    <groupId>software.amazon.awssdk</groupId>
    <artifactId>aws-sdk-java</artifactId>
    <version>${aws.java.sdk.version}</version>
  </dependency>

  <!-- AWS Cloud Development Kit -->
  <dependency>
    <groupId>software.amazon.awscdk</groupId>
    <artifactId>aws-cdk-lib</artifactId>
    <version>${cdk.version}</version>
 </dependency>

 <dependency>
   <groupId>software.constructs</groupId>
   <artifactId>constructs</artifactId>
   <version>${constructs.version}</version>
 </dependency>

</dependencies>

















Hiç yorum yok:

Yorum Gönder