Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Apprendre AWS CloudFormation: Stacks, Templates, Parameters | Section
AWS Foundations & Developer Toolkit

AWS CloudFormation: Stacks, Templates, Parameters

Glissez pour afficher le menu

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.

Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 1. Chapitre 11

Demandez à l'IA

expand

Demandez à l'IA

ChatGPT

Posez n'importe quelle question ou essayez l'une des questions suggérées pour commencer notre discussion

Section 1. Chapitre 11
some-alt