Infrastructure as Code mit CloudFormation
Lernen Sie, Ihre AWS-Infrastruktur mit AWS-CloudFormation-Templates und -Stacks deklarativ zu definieren, bereitzustellen und zu versionieren.
Infrastructure as Code mit CloudFormation ist eine kostenlose AWS for Backend Developers (EC2, S3, RDS, Lambda)-Lektion auf CoddyKit. Dies ist Lektion 4 von 4. Du kannst die komplette Lektion unten kostenlos lesen – dann übst du sie direkt im Browser mit einem integrierten Code-Editor und einem KI-Tutor rund um die Uhr. Sie ist Teil des AWS for Backend Developers (EC2, S3, RDS, Lambda)-Lernpfads, und dein Fortschritt wird über Web und CoddyKit-App synchronisiert. Der AWS for Backend Developers (EC2, S3, RDS, Lambda)-Kurs umfasst insgesamt 4 Lektionen.
Teile dieser Lektion wurden noch nicht übersetzt und werden auf Englisch angezeigt.
Why Infrastructure as Code?
Clicking through the console to create resources is slow, error-prone, and impossible to reproduce reliably.
Infrastructure as Code (IaC) defines your infrastructure in files you can version, review, and deploy repeatedly.
What Is CloudFormation?
AWS CloudFormation provisions AWS resources from a declarative template. You describe the desired end state and CloudFormation figures out how to create it.
Templates and Stacks
Key terms:
- A template is a YAML or JSON file describing resources
- A stack is a deployed instance of a template
- Updating the template updates the stack
A Minimal Template
This template creates a single S3 bucket.
AWSTemplateFormatVersion: '2010-09-09'
Resources:
MyBucket:
Type: AWS::S3::Bucket
Properties:
BucketName: my-iac-bucketParameters
Parameters make templates reusable by accepting input at deploy time, like an environment name or instance size.
Parameters:
EnvName:
Type: String
Default: devOutputs
Outputs export useful values from a stack, such as a bucket name or endpoint URL, so other stacks or operators can reference them.
Outputs:
BucketName:
Value: !Ref MyBucketDeploying a Stack
Create or update a stack from the CLI.
aws cloudformation deploy \
--template-file template.yaml \
--stack-name my-appChange Sets
A change set previews exactly what an update will add, modify, or delete before you apply it — a safety net against accidental data loss.
Automatic Rollback
If a stack update fails partway, CloudFormation rolls back to the last known good state, so you are never left with half-broken infrastructure.
Drift Detection
Drift detection tells you when someone changed a resource manually outside CloudFormation, so you can bring reality back in line with the template.
CloudFormation in CI/CD
In a pipeline, CodePipeline can deploy CloudFormation stacks automatically on every commit, making infrastructure changes follow the same review-and-deploy flow as your application code.
Quick Check
Test your IaC knowledge.
Recap
You learned Infrastructure as Code:
- Templates declare resources; stacks deploy them
- Parameters and outputs make templates reusable
- Change sets preview updates safely
- Drift detection and rollback keep infrastructure consistent
IaC makes your infrastructure repeatable, reviewable, and version-controlled.
Häufig gestellte Fragen
Ist die Lektion „Infrastructure as Code mit CloudFormation“ kostenlos?
Ja — der vollständige Text von „Infrastructure as Code mit CloudFormation“ ist hier im Web kostenlos zu lesen. Um sie interaktiv zu üben (integrierter Code-Editor und 24/7 KI-Tutor) und den Rest des AWS for Backend Developers (EC2, S3, RDS, Lambda)-Kurses freizuschalten, upgrade auf CoddyKit PRO. Der AWS for Backend Developers (EC2, S3, RDS, Lambda)-Kurs umfasst insgesamt 4 Lektionen.
Was lerne ich in „Infrastructure as Code mit CloudFormation“?
Lernen Sie, Ihre AWS-Infrastruktur mit AWS-CloudFormation-Templates und -Stacks deklarativ zu definieren, bereitzustellen und zu versionieren. Du übst AWS for Backend Developers (EC2, S3, RDS, Lambda) mit praktischem Code, den du direkt im Browser ausführst, und ein 24/7 KI-Tutor beantwortet deine Fragen während du die Lektion bearbeitest.
Brauche ich Erfahrung, um AWS for Backend Developers (EC2, S3, RDS, Lambda) zu starten?
Keine Vorkenntnisse erforderlich. AWS for Backend Developers (EC2, S3, RDS, Lambda) auf CoddyKit ist für Anfänger bis fortgeschrittene Lernende strukturiert, sodass du hier starten oder von Anfang an beginnen und in deinem eigenen Tempo voranschreiten kannst. Dies ist Lektion 4 von 4.
Wie lange dauert die Lektion „Infrastructure as Code mit CloudFormation“?
Die meisten CoddyKit-Lektionen dauern etwa 5–10 Minuten. Jede ist kompakt und interaktiv, sodass du stetig Fortschritte machst und genau dort weitermachst, wo du aufgehört hast – im Web und in der App.
Kann ich in dieser AWS for Backend Developers (EC2, S3, RDS, Lambda)-Lektion Code schreiben und ausführen?
Ja. Jede AWS for Backend Developers (EC2, S3, RDS, Lambda)-Lektion enthält einen integrierten Code-Editor, sodass du echten Code direkt in deinem Browser schreibst und ausführst und sofort KI-Feedback erhältst — ohne lokale Einrichtung erforderlich.
Alle Lektionen in diesem Kurs
- Grundlagen von CodeCommit und CodeBuild
- CodeDeploy für EC2/Lambda
- Serverless Application Model (SAM)
- Infrastructure as Code mit CloudFormation