tezvyn:

AWS CloudFormation: Your AWS Infrastructure as a Blueprint

AI-drafted, machine-checkedSource: Wikipedia: AWS CloudFormationbeginner

AWS CloudFormation is your infrastructure's blueprint. Declare AWS resources in a YAML/JSON file, and AWS builds it. This is perfect for creating repeatable, version-controlled environments.

WHY IT EXISTS: Manually configuring cloud infrastructure through a web console is slow, error-prone, and impossible to track. This leads to inconsistent environments and "snowflake" servers that can't be reliably reproduced, making it difficult to scale or recover from failure. CloudFormation was created to solve this by codifying infrastructure.

THE MENTAL MODEL: Think of a CloudFormation template as a detailed blueprint for a building. You hand this blueprint to the construction crew (AWS), and they build everything exactly as specified, from the foundation to the wiring. If you want to add a new room, you update the blueprint first, rather than telling workers to just start building. The template is the single source of truth for what your infrastructure should look like.

HOW IT WORKS: You define all your desired AWS resources—like EC2 instances, S3 buckets, or VPC networks—in a text file using either YAML or JSON syntax. This file is called a template. You submit this template to the CloudFormation service, which creates a "stack" from it. CloudFormation intelligently determines the correct order to provision resources based on their dependencies. To change your infrastructure, you modify the template and submit it again. CloudFormation generates a "change set" detailing the proposed updates, which you can review before applying.

WHEN TO USE IT: Use CloudFormation for any infrastructure that needs to be reliable and repeatable. It's ideal for managing production environments, creating identical copies for development and staging, and implementing disaster recovery plans. It's a core component of automated CI/CD pipelines, allowing you to deploy both application code and the underlying infrastructure in one go.

WHEN NOT TO USE IT: For quick, temporary experiments or prototypes, using the AWS console might be faster than writing a template. If your infrastructure spans multiple cloud providers (like AWS and Google Cloud), a platform-agnostic tool like Terraform is a better choice, as CloudFormation is AWS-specific.

ONE CANONICAL EXAMPLE: A common use case is deploying a simple web application. The CloudFormation template would define an EC2 instance to run the web server, a Security Group to open port 80 for web traffic, and an S3 bucket to store static assets. When you deploy this stack, CloudFormation provisions all these resources and connects them, giving you a fully functional application environment created from a single, version-controlled file.

Read the original → en.wikipedia.org

Get five bites like this every day.

Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.