AWS CloudFormation: Stacks, Templates, Parameters
メニューを表示するにはスワイプしてください
Let's talk about Infrastructure as Code, or IaC.
Imagine you want to create a Lambda function, set up permissions, connect it to API Gateway, and deploy it. You could do all of that through the AWS Console. But what happens if you need to do it again, recreate it in another region, or automate it in a CI/CD pipeline?
Infrastructure as Code lets you define your cloud resources in code so you can version, reuse, and automate them just like you would with application code. Deploying the same infrastructure over and over again manually is tedious and error-prone.
Why IaC Matters
Without infrastructure as code, infrastructure becomes fragile. Teams click around in the console, forgetting what they did, which leads to loss of reproducibility between production and staging environments.
With infrastructure as code, you can:
- Track infrastructure changes in Git;
- Deploy automatically;
- Reduce human error.
IaC is one of the most powerful concepts in modern DevOps, and AWS supports it with several tools.
Declarative vs Programmatic IaC
There are two main styles of infrastructure as code:
- Declarative: You describe what you want, and AWS figures out how to make it happen.
- Tools: CloudFormation, AWS SAM.
- Programmatic: You write code that builds your infrastructure.
- Tool: AWS Cloud Development Kit (CDK).
Declarative tools use configuration files (YAML or JSON), while programmatic tools use real programming languages (like Python or JavaScript) that allow for logic, loops, and reuse.
IaC Tools in AWS
As a developer, you'll often choose based on familiarity:
- CloudFormation: declarative. Uses YAML or JSON;
- AWS SAM (Serverless Application Model): declarative. Built on CloudFormation, adds a CLI;
- AWS CDK (Cloud Development Kit): programmatic. Uses languages like Python, JavaScript, or TypeScript.
All three allow you to define and deploy AWS infrastructure using repeatable, versioned methods.
フィードバックありがとうございます!
AIに質問する
AIに質問する
何でも質問するか、提案された質問の1つを試してチャットを始めてください