Let’s begin with AWS CloudFormation

2021.07.08

Why AWS CloudFormation?

Complex applications on AWS can contain many resources, and managing all these resources can be a routine task.

What is AWS CloudFormation?

AWS CloudFormation is a service that helps you model and set up your AWS resources, so you can spend less time managing these resources and more time focusing on the applications that run on AWS .

Get started with AWS CloudFormation

Use a json script to create a template in AWS CloudFormation

JSON is an open standard format that uses human-readable text to send a data object consisting of attribute-value pairs.

Structure of JSON and YAML document

AWS template format version

Description

Metadata

parameter

mapping

condition

output

resource*

Sample JSON

This is what the JSON code looks like with just the resource parameters.


{

  "Resources":{

 "Name of your bucket":{

     "type":"resource type"

     }

 }

}

Demo

Create a simple S3 bucket from CloudFormation

Step 1: Click on Create stack.

Step 2: You can choose a pre-built template or design a new template for this demo Design a template Step 3: You need to drag and drop the services you need for this demo Add an s3 bucket You can edit the name and properties of the JSON or YAML file. 

Step 4: After designing, you need to click the Create Stack icon in the upper left. The template is added to S3 and the URL is added to the Amazon S3 URL field. Step 5: Write the stack name. Step 6:Configure stack options ,Recommended to add tags,it can help you manage, identify, organize, search for, and filter resources. You can create tags to categorize resources by purpose, owner, environment, or other criteria. CloudFormation by default add some tag.Step 7: Create  stack. Step 8: All resources are deployed and you can check their status. Step 9: It's very convenient because you can delete all the resources you created just by deleting the stack.

Summary

AWS CloudFormation will help you to deploy and manage resources very easily , can help us to save time and save us from doing mistakes .

HAPPY LEARNING!