Skip to content

Latest commit

 

History

History
102 lines (49 loc) · 5.99 KB

cdk-introduction.md

File metadata and controls

102 lines (49 loc) · 5.99 KB

CDK Introduction

CDK 정의

AWS CDK(Cloud Development Kit)는 프로그래밍 언어를 사용하여 클라우드 인프라를 코드로 정의하고, AWS CloudFormation을 통해 배포하는 오픈 소스 소프트웨어 개발 프레임워크입니다. Typescript, Node.JS, Python, Go와 같은 다양한 언어를 지원하므로 인프라를 쉽게 개발할 수 있습니다.

CDK는 2018년 8월에 AWS CDK Developer Preview에 처음 릴리즈 되었고, CDK v2는 AWS Cloud Development Kit (AWS CDK) v2 is now generally available와 같이 2021년 11월에 정식 릴리즈 되었습니다.

기본적으로 CDK는 CloudFormation Template을 생성하기 위한 툴이므로, AWS에서 새로운 feature를 개발하였을때, 새로운 feature가 CloudFormation으로 개발된 후 다시 CDK 새버전이 배포될때까지 기다려야 할 수 있습니다. 또한, CDK for Teraform과 같이 CloudFormation이외에도 사용될 수 있도록 확장되고 있습니다.

CDK Initiate

Typescript로 cdk를 설정시 아래와 같이 합니다.

$ cdk init app --language typescript

$ cdk bootstrap aws://123456789012/ap-northeast-2

여기서 '123456789012'은 Account Number를 의미합니다.

-- Upgrade

$ npm install -g aws-cdk-lib

AWS CDK Benefits

  1. Easier cloud onboarding — AWS CDK accelerates your onboarding to AWS because there are few new things to learn. CDK enables you to use your existing skills and tools, and apply those to the task of building cloud infrastructure. It also provides high-level components that preconfigure cloud resources with proven defaults, helping you build on AWS without needing to be an expert.

  2. Customisable and shareable — With AWS CDK you can design your own reusable components that meet your organisation’s security, compliance, and governance requirements. Just like with any other software library, you can easily share components around your organisation enabling you to rapidly bootstrap new projects with best practices by default.

  3. Faster development process — AWS CDK gives you the expressive power of programming languages for defining infrastructure. Familiar features such as objects, loops, and conditions accelerate your development process. You can also use AWS CDK with your integrated development environment (IDE) to take advantage of existing productivity tools and testing frameworks.

  4. No context switching — AWS CDK enables you to build your cloud application without leaving your IDE. You can write your runtime code and define your AWS resources with the same programming language. You can visualise your CDK application stacks and resources with the AWS Toolkit for VS Code.

지원언어

. TypeScript, JavaScript, Python, Java, Go, C#/NET

image (Reference #1)

CDK v1/v2 차이

image

image

image

CDK와 CloudFormation의 차이

image

CDK for Teraform

HashiCorp Configuration Language (HCL)을 CDK를 이용해 구현합니다.

지원언어: TypeScript, Python, Java, C#, and Go (experimental).

image

설치 및 데모

CDK for Kubernetes (cdk8s)

cdk8s is a Cloud Native Computing Foundation Sandbox Project

cdk8s is an open-source software development framework for defining Kubernetes applications and reusable abstractions using familiar programming languages and rich object-oriented APIs. cdk8s apps synthesize into standard Kubernetes manifests which can be applied to any Kubernetes cluster.

AWS Serverless Application Model 및 AWS CDK는 모두 AWS 인프라를 코드로 추상화하므로 클라우드 인프라를 더 쉽게 정의할 수 있습니다. AWS SAM은 서버리스 사용 사례와 아키텍처에 초점을 맞추고 있으며 인프라를 간결한 선언형 JSON/YAML 템플릿으로 정의할 수 있습니다. AWS CDK는 모든 AWS 서비스에 걸쳐 광범위한 지원을 제공하며 클라우드 인프라를 TypeScript, Python, C# 및 Java와 같은 현대적 프로그래밍 언어로 정의할 수 있습니다. AWS SAM 및 AWS CDK 모두 CloudFormation을 인프라 스택의 프로비저닝 엔진으로 활용합니다.

간결한 선언형 템플릿으로 서버리스 인프라를 정의하는 것을 선호한다면 SAM이 더 적합합니다. AWS 인프라를 익숙한 프로그래밍 언어로 정의하려는 경우에는 AWS CDK를 사용하는 것이 좋습니다. 두 경우 모두 CloudFormation을 통해 반복 가능하고 안전한 인프라 배포를 활용할 수 있습니다.

Reference

  1. What is the AWS CDK?

  2. AWS CDK Benefits

  3. CDK for Terraform

  4. CDK for Kubernetes

  5. AWS Cloud Development Kit FAQ

  6. [AWS Builders] AWS Cloud Development Kit을 이용한 Code 기반의 인프라 구축

  7. AWS CDK Developer Preview