AWS CloudFormation
by Amazon • • Infrastructure as Code (IaC) Tools
AWS CloudFormation is Amazon Web Services' infrastructure as code service, provisioning AWS and third-party resources from templates for teams on AWS.
AWS CloudFormation creates, updates and deletes cloud resources from a template, and treats everything one template describes as a single unit called a stack. Amazon Web Services, a unit of Amazon.com, Inc., operates the engine itself, so there is nothing to install or host. A stack can hold AWS resources alongside third-party resources registered as extensions. Teams describe an environment once and let the service build it the same way every time. Before an update runs, change sets list what each proposed change will do to running resources. Executing a change set is a separate step, so the review happens first. Drift detection compares a stack with its template and reports the drift status of each resource, with drift-aware change sets alongside. Resource import and the IaC generator bring resources created elsewhere under a stack without recreating them. Git sync watches a repository branch, deploys from its commits and can comment on pull requests with the changes it will make. CloudFormation Hooks inspect resources, stacks and change sets before provisioning and can stop the operation, while CloudFormation Guard checks templates against policy rules. It suits teams whose infrastructure runs mainly on AWS and who would rather not maintain a provisioning tool of their own. Developers who would rather write TypeScript, Python, Java, C# or Go than a template use AWS CDK, an open-source framework from AWS that deploys through CloudFormation. Security staff gain a checkpoint in Hooks, and IAM policies can name a single stack, so a production stack can be closed to updates and deletion. Teams that already review code through pull requests bring infrastructure changes into the same review with Git sync. Platform teams publish private extensions and modules to the CloudFormation registry in their account for others to reuse. A common job is standing up a new environment from a template, then changing it through a change set that someone reads before it runs. Another is adopting resources first built by hand in the AWS console, either by importing them or by generating a template with the IaC generator. Stacks pass values to each other through output exports, Fn::ImportValue and, across accounts and Regions, Fn::GetStackOutput. Amazon EventBridge receives an event when a stack's drift status changes, so a drift finding can start other work. Every stack in the estate can then be traced back to the template that defines it.
Pricing
View plans-
AWS and Alexa resource providers
Free
- No CloudFormation charge for resource providers in the AWS::* and Alexa::* namespaces
- You pay for the AWS resources a stack creates
- No minimum fees and no upfront commitments
-
Third-party extensions and custom Hooks
Custom pricing
- $0.0009 per handler operation (create, update, delete, read or list), metered by usage
- Plus $0.00008 per second when an operation runs longer than 30 seconds
- First 30 seconds of each operation at no charge
- First 1,000 handler operations a month per account at no charge, hooks and third-party providers included
- Applies to resource providers outside the AWS::* and Alexa::* namespaces
- Custom Hooks outside the AWS::* namespace at the same rates
- 15,000 operations in a month with no overage come to $12.60
- 6,000 operations with 14,400 seconds over the threshold come to $5.65
- 4,500 hook operations in a month come to $3.15
Features
- Not included: Providers for AWS, Azure and Google Cloud
- Included: Execution plan preview before apply
- Not included: Remote state with locking
- Included: Drift detection against deployed cloud state
- Included: Private module registry
- Included: Infrastructure in general-purpose languages
- Included: Policy-as-code checks at plan time
- Included: Pull-request plans from version control
- Not included: Cost estimate on each plan
- Included: Import of existing cloud resources
- Not included: Encrypted workspace variables
- Included: Per-workspace access control
- Included: Approval required before apply
- Not included: Auto-destroy of temporary environments
- Included: Cross-stack output references
- Not included: Self-hosted agents for private networks
- Not included: Open source IaC engine
Additional Features
- Change sets that preview stack updates
- Drift detection per stack and resource
- Drift-aware change sets
- Resource import without recreation
- IaC generator for existing resources
- Git sync deployments from a repository branch
- Git sync comments on pull requests
- CloudFormation Hooks on resources, stacks and change sets
Best for
- Teams whose infrastructure runs mainly on AWS
- Platform teams that want the provisioning engine run by AWS
- Developers who prefer TypeScript or Python through AWS CDK
- Teams that review infrastructure changes in Git pull requests
- Security teams enforcing rules before resources are provisioned
- Teams bringing console-built resources under code
Use cases
- Provisioning a whole environment from one template
- Reviewing a change set before an update runs
- Checking a stack for drift from its template
- Importing existing resources into a stack
- Generating a template from resources already running
- Deploying stacks from commits to a Git branch
- Blocking non-compliant resources with Hooks
- Sharing one stack's outputs with another
- Publishing private modules for reuse across teams
- Defining infrastructure in Python or TypeScript with AWS CDK
- Managing third-party resources through registry extensions
Screenshots & Videos
Explore AWS CloudFormation in action
User Reviews
Compare with Similar Software
Click to compare side by side with AWS CloudFormation