AWS CloudFormation is the native Infrastructure as Code service in AWS. You describe resources such as VPCs, EC2 instances and databases in a JSON or YAML template, and CloudFormation creates, updates and deletes them together as a stack, so environments can be rebuilt the same way every time.

The posts here include an introduction to CloudFormation's use cases, features and architecture with a getting started tutorial for templates, and practical answers to template problems, such as launching several EC2 instances without an Auto Scaling group. Several step-by-step guides deploy Workload Discovery on AWS through a CloudFormation stack, including installation from a member account in AWS Organizations. For a wider view, there are comparisons of Infrastructure as Code tools covering Terraform, Bicep, Pulumi, Ansible and Chef, a practical IaC guide, and a look at Console-to-Code in Amazon Q Developer, which turns console actions into code.

These posts help DevOps and cloud engineers starting with templates, teams choosing between CloudFormation and other IaC tools, and candidates preparing for AWS interviews and the DevOps Professional certification, with hands-on assignments and multiple-choice questions on stacks and templates.

Start here

Latest AWS CloudFormation articles

Infrastructure as Code: A Practical Guide for DevOps Professionals

Introduction Managing infrastructure has undergone a massive transformation over the past decade. If you started your career in the era of physical data centers, you likely remember…

Read More

Complete Guide to AWS Certified DevOps Professional Training

In the early days of IT, we managed servers with screwdrivers and serial cables. As the industry shifted toward the cloud, the role of the engineer transformed…

Read More

Top 10 Infrastructure as Code (IaC) Tools: Features, Pros, Cons & Comparison

Introduction Infrastructure as Code (IaC) tools allow teams to define, provision, and manage infrastructure using code instead of manual processes. Instead of clicking through cloud consoles or…

Read More

AWS: Step-by-Step Guide to Install Workload Discovery on AWS

Given: This guide covers best practices for organizational (Org-level) deployments, ensuring correct visibility and permissions. Given your specific AWS Organizations setup (Organization ID: o-5jsrv4oeem, Management account: 66666666666666666, Target…

Read More

AWS: Step-by-Step Guide to Deploy Workload Discovery on AWS

Here’s a detailed step-by-step guide to deploy Workload Discovery on AWS using CloudFormation: 1. Prepare for Deployment 2. Access the AWS CloudFormation Console 3. Launch the CloudFormation…

Read More

AWS Tutorials: What is Console-to-Code?

Amazon Q Developer’s Console-to-Code feature enables you to automate AWS services by recording your actions in the AWS Management Console and generating corresponding code snippets in various…

Read More

AWS Tutorials: How to visualize AWS Cloud resources – Workload Discovery

Workload Discovery on AWS is a solution provided by Amazon that allows users to visualize, manage, and understand their AWS cloud resources and architecture. It is particularly…

Read More

What is CloudFormation and use cases of CloudFormation?

What is CloudFormation? AWS CloudFormation is an Infrastructure as Code (IaC) service provided by Amazon Web Services (AWS). It enables users to define and provision AWS infrastructure…

Read More

Infrastructure as Code (IaC) tools in 2024

Some of the most popular and effective Infrastructure as Code (IaC) tools in 2024: 1. Terraform: 2. Pulumi: 3. AWS CloudFormation: 4. Azure Resource Manager (ARM): 5….

Read More

Dynatrace Tutorials: Dynatrace Managed Cluster on the AWS Cloud

This Quick Start sets up a highly available, secure AWS environment, and automatically launches a Dynatrace Managed cluster into a new or existing Virtual Private Cloud (VPC)….

Read More

AWS SAM CLI Getting started guide

AWS SAM CLI (Serverless Application Model Command Line Interface) is an open-source command-line tool that makes it easy to build, test, and deploy serverless applications on AWS….

Read More

AWS Assignment

Part – 1: General AWS Assignment: Computing AWS Lab & Exercise: VPC – Virtual Private Cloud Assignment AWS Cloudformation Lab and Assignment AWS Storage Write an answer…

Read More

Comparison Between Terraform, AWS CloudFormation & Azure ARM

Rajesh KumarI’m Rajesh Kumar, a DevOps, SRE, DevSecOps, Cloud, and Platform Engineering expert passionate about sharing practical knowledge, real-world experiences, and industry best practices. I have worked…

Read More

AWS Certified SysOps Administrator – Chapter – 6

Review Questions Your company user Chef for its automation. What AWS service can run Chef recipes? AWS Elastic Beanstalk AWS OpsWorks AWS CodeDeploy AWS CodeCommit Your company…

Read More

AWS Interview Questions and Answer Part – 20

Which of the following options describes Infrastructure in Code? Script containing all needed steps to transform current state into target state. Checklist containing all steps needed to…

Read More

AWS Certified DevOps Engineer – Professional Explained

The AWS Certified DevOps Engineer Professional exam validates a candidate’s technical expertise in managing, provisioning and operating distributed applications on AWS. This is a difficult exam and…

Read More

AWS Interview Questions and Answer Part – 4

Describe the advantages/disadvantages of using CloudFormation to manage your resources Would you use CloudFormation to create a RDS database? Describe EC2 spot instances and which use cases…

Read More

How to create multiple AWS CloudFormation resources such as ec2 without AutoScaling group?

Some of the similar questions such as … How to do conditioning in AWS CloudFormation? How to do looking in AWS CloudFormation? No it is not possible…

Read More

Cloudformation WordPress Mappings EC2 UserData DBInstance SecurityGroup Outputs Examle Program

Rajesh KumarI’m Rajesh Kumar, a DevOps, SRE, DevSecOps, Cloud, and Platform Engineering expert passionate about sharing practical knowledge, real-world experiences, and industry best practices. I have worked…

Read More

CloudFormation EC2 Parameters Mapping AllowedValues ElasticIP SecurityGroup Outputs Example Program

Rajesh KumarI’m Rajesh Kumar, a DevOps, SRE, DevSecOps, Cloud, and Platform Engineering expert passionate about sharing practical knowledge, real-world experiences, and industry best practices. I have worked…

Read More

Cloudformation EC2 VPC Complete Outputs WebServersetup Example Program

Rajesh KumarI’m Rajesh Kumar, a DevOps, SRE, DevSecOps, Cloud, and Platform Engineering expert passionate about sharing practical knowledge, real-world experiences, and industry best practices. I have worked…

Read More

CloudFormation EC2 Mapping Parameters AllowedValues Example Program

Rajesh KumarI’m Rajesh Kumar, a DevOps, SRE, DevSecOps, Cloud, and Platform Engineering expert passionate about sharing practical knowledge, real-world experiences, and industry best practices. I have worked…

Read More

AWS Cloudformation Lab and Assignment – 1

Task 1: Using Cloudformation temmplate json, Create a EC2 Instance and output Public IP and Private IPs. Task 2:Using Cloudformation temmplate json, Create a EC2 Instance/ElasticIP/SecurityGroup and…

Read More

CloudFormation EC2 Volume ebs elasticip Example Program

Creating a security group Creating an EC2 instance Increased root volume on the EC2 instance Attaching an externally created EBS volume Attached Elastic IP to the instance…

Read More

CloudFormation EC2 Sample Example Program

Rajesh KumarI’m Rajesh Kumar, a DevOps, SRE, DevSecOps, Cloud, and Platform Engineering expert passionate about sharing practical knowledge, real-world experiences, and industry best practices. I have worked…

Read More

AWS CloudFormation: frequently asked questions

What is the difference between a CloudFormation template and a stack?

A template is the JSON or YAML file that describes the resources you want. A stack is the deployed set of resources CloudFormation creates from that template and manages as one unit.

Should I use CloudFormation or Terraform?

CloudFormation is AWS-native, manages state for you and is a natural fit for AWS-only environments. Terraform works across many cloud and SaaS providers but requires you to manage its state file.

Does CloudFormation support loops?

Standard templates have no loop construct, which is why repeated resources are often declared one by one or generated by tools. The AWS::LanguageExtensions transform adds Fn::ForEach to repeat resources from a list.

Does CloudFormation cost anything?

There is no additional charge for using CloudFormation with AWS resource types; you pay for the resources it creates. Charges can apply when you use third-party resource providers.