<aside> 🔥 Trending on r/aws on 05/19/2021

</aside>

May 19, 2021 Rahul Sharma

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/3bf7ca41-d228-46eb-affe-b475cce9bef6/iac.png

Infrastructure-as-code

IaC has become the preferred way of deploying, scaling, and managing cloud infrastructure. In this article, we will compare four options of writing IaC on AWS by creating the same app in four different ways (CDK, SAM, CloudFormation, and Terraform).

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/28a9cd46-fe1e-414e-a65b-a2918b4c081c/abstraction.png


What we are going to build

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/8a46ddf5-b5fe-429a-974f-4d8c3fe32089/Untitled.png

We are going to build a REST API using API Gateway, Lambda, and DynamoDB. The API will have three endpoints as listed below.

# Fetch all books
GET /books

# Fetch a single book by id
GET /books/{id}

# Create a new book
POST /books
# Book schema

Book {
	id: string
	name: string
}

I. AWS CDK

  1. AWS Cloud Development Kit (CDK) is a development framework where you write infrastructure in regular object-oriented way, similar to building any other application.