This page is under regular updates. Please check back later for more content.
Management & Governance
Amazon Cloudformation

CloudFormation

Objective

  • Learn cloud formation master all its concepts
  • Go through hands on examples to practice what we learned
  • Learn how to use YAML to write the CF templates
  • Learn how to write your infrastructure as code
  • Launch several templates
  • Advanced concept overview

What is CloudFormation?

CloudFormation is a declarative way of outlining your AWS Infrastructure, for any resources (most of them are supported). It is proprietry based IaC method to manage our AWS Infrastructure.

For example, within a CloudFormation template, you say:

  • I want a security group
  • I want two EC2 machines using this security group
  • I want two Elastic IPs for these EC2 machines
  • I want an S3 bucket
  • I want a load balancer (ELB) in front of these machines

Then CloudFormation creates those for you, in the right order, with the exact configuration that you specify.

Benefits

Infrastructure as code

  • No resources are manually created, which is excellent for control
  • The code can be version controlled for example using git
  • Changes to the infrastructure are reviewed through code

Cost

  • Each resources within the stack is stagged with an identifier so you can easily see how much a stack costs you
  • You can estimate the costs of your resources using the CloudFormation template
  • Savings strategy: In Dev, you could automation deletion of templates at 5 PM and recreated at 8 AM, safely

Productivity

  • Ability to destroy and re-create an infrastructure on the cloud on the fly
  • Automated generation of Diagram for your templates!
  • Declarative programming (no need to figure out ordering and orchestration)

Separation of concern

Create many stacks for many apps, and many layers. Ex:

  • VPC stacks
  • Network stacks
  • App stacks

Don't re-invent the wheel

  • Leverage existing templates on the web!
  • Leverage the documentation

Cost Estimation

  • You can estimate the cost of a stack very easily
  • For this, you just upload the stack on the AWS Console, enter a few parameters, then click on "Cost"

Quick Demo!

CloudFormation versus Ansible and Terraform

  • CloudFormation is AWS native, and will always contain the latest features and options for AWS Services
  • CloudFormation is state based, and AWS figures out how to reach that state
  • Ansible and Terraform are instruction based, and it can be difficult to fully orchestrate your stacks
  • Ansible and Terraform have to be updated every time a new Services or API option comes from AWS, which can take a long time