What is AWS CloudFormation? A plain-English explainer
AWS CloudFormation is AWS’s native infrastructure-as-code service: you describe the AWS resources you want — a server, a database, a network — in a JSON or YAML template, and CloudFormation provisions and configures them for you, in the same way, every time. Rather than clicking through the AWS console to build infrastructure by hand, you write it down once and let CloudFormation do the building. That template becomes the single source of truth for what exists in your AWS account, and AWS itself keeps track of what it has created and how those resources relate to one another. CloudFormation is one of the oldest infrastructure-as-code tools in the cloud, built into AWS with no separate account or tool to install, which is exactly why it shows up early in AWS certification study. Here is what it does, why teams reach for it, and how it compares to the tools that sit alongside it.
The idea behind infrastructure as code
Infrastructure as code means describing infrastructure — servers, networks, storage, permissions — as a text file rather than a sequence of manual clicks. That file can be reviewed, version-controlled and reused, the same way application code is. Our what-is-infrastructure-as-code explainer covers the concept in full; CloudFormation is AWS’s own implementation of it.
Before infrastructure as code, rebuilding an environment meant either remembering every console click that created it or writing it down in a document that drifted out of date the moment someone made a manual change. A CloudFormation template removes that guesswork: the template is what gets built, so it cannot fall out of sync with itself.
Templates, stacks, and what CloudFormation actually does
A CloudFormation template lists the AWS resources you want and how they connect — for example, a virtual server that should sit inside a particular network, with a database it is allowed to talk to. You submit that template to CloudFormation, and it creates everything described as a single unit called a stack.
From then on, the stack is what you manage, not the individual resources. Need to change something? Update the template and submit it again — CloudFormation works out the difference and applies only the changes needed. Need to remove the whole environment? Delete the stack, and CloudFormation tears down everything it created, in the right order, without you having to remember what depended on what.
Crucially, AWS manages the state — the record of what a stack currently contains and how it maps to the template. You never have to reconcile that record yourself; CloudFormation keeps it consistent because it is the only path resources go through in the first place.
Why repeatable infrastructure matters
The practical value of a CloudFormation template is that it turns infrastructure into something repeatable and reviewable. The same template can build an identical development, test and production environment, removing the classic “it worked on my machine” gap between them. Because the template lives in version control alongside application code, changes to infrastructure go through the same review process as changes to a codebase — a colleague can see exactly what is about to be added, changed or removed before it happens.
It also makes disaster recovery far less stressful. If an environment needs to be rebuilt from scratch, the template already describes how — there is no tribal knowledge to reconstruct under pressure.
CloudFormation versus Terraform
CloudFormation’s main alternative is Terraform, from HashiCorp, and the two are often compared directly. In short, CloudFormation is AWS-native and only provisions AWS resources, while Terraform is multi-cloud and can provision AWS, Azure, Google Cloud and many other providers from the same tool and language. Our terraform-vs-cloudformation explainer covers that comparison in depth, including how each tool tracks state and what that means in practice — worth reading before choosing between them rather than duplicating that detail here.
Neither tool is simply “better” — the right choice depends on whether an organisation is AWS-only or already managing infrastructure across multiple providers.
When you would reach for CloudFormation
CloudFormation suits teams already committed to AWS who want infrastructure managed through AWS’s own tooling, with no separate state backend or third-party account to configure. It is also the engine behind several higher-level AWS services — the AWS Cloud Development Kit (CDK), for instance, lets you write infrastructure in a general-purpose programming language and compiles it down to a CloudFormation template underneath.
CloudFormation follows AWS’s usual pricing model for the service itself: there is no separate charge for using CloudFormation to create a stack — you simply pay for the underlying AWS resources the template creates, the same as if you had built them by hand.
Where CloudFormation appears in certification study
CloudFormation is core syllabus content across AWS’s architecture and operations certifications. AWS Certified Solutions Architect – Associate expects you to recognise when infrastructure as code is the right approach and understand stacks conceptually. AWS Certified CloudOps Engineer – Associate goes further into managing and troubleshooting stacks operationally. AWS Certified Developer – Associate covers using CloudFormation (and CDK) to deploy application infrastructure as part of a development workflow.
This article covers what CloudFormation is and why it exists — template syntax, intrinsic functions and stack operations belong in the syllabus itself, which our /revision study library breaks down lesson by lesson.
Original practice questions, timed mock exams and revision notes. No card, nothing to pay.