DevOpsLesson
DevOpsLesson

Free, comprehensive DevOps tutorials and learning roadmaps. Master Docker, Kubernetes, CI/CD, and more.

Stay Updated

Get notified about new tutorials and features.

Tutorials

  • What is DevOps?
  • Docker Tutorial
  • Terraform Tutorial
  • CI/CD Pipeline
  • All Tutorials

Roadmaps

  • DevOps Engineer
  • Cloud Engineer
  • SRE Path
  • All Roadmaps

Company

  • About Us
  • Blog
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 DevOpsLesson. All rights reserved.

DOCKERKUBERNETESTERRAFORMAWSCI/CDLINUXGITDEVOPS ROADMAPCLOUD ROADMAPSRE ROADMAPGIT CHEATSHEETDOCKER CHEATSHEETK8S CHEATSHEETTF CHEATSHEETLINUX CHEATSHEETDOCKERFILE LINTERYAML VALIDATORCRON PARSERREGEX TESTER

Aws Tutorial

Introduction to AWS
AWS Global Infrastructure
Setting Up AWS
AWS IAM
AWS EC2
AWS VPC
AWS S3
AWS RDS
AWS Lambda
AWS ECS and EKS
AWS CloudWatch
AWS CodePipeline
AWS Cost Optimization
AWS Elastic Load Balancing
AWS Auto Scaling
AWS CloudFront
AWS Route 53
AWS DynamoDB
AWS ElastiCache
AWS SQS
AWS SNS
AWS EventBridge
AWS Step Functions
AWS API Gateway
AWS ECR
AWS EKS
AWS CloudFormation
AWS Elastic Beanstalk
AWS KMS
AWS Secrets Manager
AWS WAF and Shield
AWS CloudTrail
AWS Config
AWS Systems Manager
AWS Organizations
AWS EFS
AWS EBS Deep Dive
AWS Kinesis
AWS Athena
AWS CodeDeploy
AWS CodeCommit
AWS CDK
AWS SAM

AWS CloudFormation

PreviousPrev
Next

Learn how AWS CloudFormation defines infrastructure declaratively with stacks, templates, and change sets for repeatable deployments.

AWS CloudFormation is AWS's native declarative infrastructure as code service and turns resource definitions into managed stacks. For DevOps teams, it matters because it helps teams review, version, and reproduce infrastructure instead of building resources manually in the console. Instead of relying on one fragile manual configuration, you can design a repeatable service boundary that stays stable while the workload behind it changes.

CloudFormation: Stack Deployment Flow

Template (YAML / JSON)
.template file or S3 URL
create-stack / update-stack
Change Set
preview what will change
execute-change-set
CloudFormation Stack
logical resource map
provisions
VPC
EC2
RDS
IAM Role

On failure CloudFormation automatically rolls back to the last known good state

Core ideas

The main ideas to understand are templates describe resources, parameters, outputs, and dependencies in JSON or YAML; stacks are the deployed instances of those templates and maintain state about what has been created; change sets show what CloudFormation plans to add, modify, or replace before you execute an update; and CloudFormation is tightly integrated with AWS while Terraform may provide broader multi-cloud support and a different workflow style. These details shape architecture decisions, but they also shape day-to-day operations. When a team chooses defaults without understanding how the service behaves under failure, scale, or security review, the platform often becomes harder to debug than the application itself.

AspectCloudFormationTerraform
Provider scopeAWS nativeMulti-cloud and ecosystem wide
State handlingManaged by the stack serviceExternal state file or backend
IntegrationDeep AWS alignmentBroad provider flexibility

From an operations perspective, the goal is to make infrastructure changes reviewable and predictable so environment drift becomes an exception instead of the default state. The comparison below highlights the choices that usually matter first. It is often better to start with a simpler design and add sophistication only after metrics, incidents, or delivery requirements prove the change is necessary.

Practical commands

AWSTemplateFormatVersion: '2010-09-09'
Description: Simple S3 bucket
Resources:
  AppBucket:
    Type: AWS::S3::Bucket
    Properties:
      BucketName: my-demo-app-bucket

Practical CLI checks make the service easier to support in real environments. Use the commands below to inspect the current state and confirm that automation matches intent. Before you promote a change, verify change set output, replacement risk, and stack policy expectations before approving production updates. A safe default is small reusable stacks with clear outputs so dependent systems consume interfaces instead of hidden resource names. That discipline makes later troubleshooting, scaling, and security reviews far less painful.

Exercise

CloudFormation purpose

What is CloudFormation used for?

Exercise

Change sets

Why would you create a change set before updating a stack?

PreviousPrev
Next

Continue Learning

AWS EKS

Learn how Amazon EKS runs managed Kubernetes on AWS with a managed control plane, worker nodes, and IAM Roles for Service Accounts.

20 min·Advanced

AWS EKS Cluster Setup

Understand how to create an EKS cluster with eksctl, satisfy VPC and subnet requirements, and configure kubeconfig access.

15 min·Advanced

AWS EKS Node Groups

Learn how EKS managed node groups, self-managed nodes, and Fargate profiles handle pod capacity and cluster upgrades.

12 min·Advanced

Explore Related Topics

Te

Terraform Tutorials

Manage AWS infrastructure as code

Li

Linux Tutorials

Essential Linux skills for working with EC2

On This Page

Core ideasPractical commands