AWS CloudFormation in 5 Mins [Quick Start]
Published on

AWS CloudFormation in 5 Mins [Quick Start]

Learn How to Create a Simple AWS CloudFormation Template in 5 Minutes
Authors

I've been using Amazon Web Services (AWS) last 3 years from now on but I've not used Cloudformation directly. I prefer to use the AWS CDK, Pulumi or Terraform. I think these are making things definetly easier. I'll write a wider blog post about them in the near future.

Let's start with the definitions.

What's IaC? Infrastructure as Code?

"Infrastructure as Code (IaC) is the management of infrastructure (networks, virtual machines, load balancers, and connection topology) in a descriptive model, using the same versioning as DevOps team uses for source code." -Microsoft

What's AWS Cloudformation?

"AWS CloudFormation is a service that gives developers and businesses an easy way to create a collection of related AWS and third-party resources, and provision and manage them in an orderly and predictable fashion." -Microsoft

From my mind map

image

As you can see, AWS CloudFormation is a brach under AWS category. Even the other IaC tools are using CloudFormation under the hood. When you execute AWS CDK code, it generates CloudFormation in the background.

Hands-on LAB

  1. Open the AWS Console and go to the CloudFormation page.
  2. Create a new stack.

image

  1. Pick template is ready and upload the following json file.
{
  "Resources": {
    "catpics": {
      "Type": "AWS::S3::Bucket"
    }
  }
}

image

  1. Name your stack.

image

  1. Add a tag if you want and click on the create button.

image

  1. Wait for the stack to be created. You can see the stack in the AWS Console.

image

  1. Go to s3 bucket and check the list of buckets.

image

Tadaa! You have successfully created a new stack. You can update or delete it later. It was a super-fast hands-on lab. See you in the next hands-on lab.