← Zurück zu Team für Electron und React
Entdecke, wie der Skill hilft
Infrastruktur als Code
Macht Infrastrukturänderungen durch konkrete Pläne, geschützten gemeinsamen Zustand und umgebungsspezifische Eingaben überprüfbar.
infrastructure-as-code
Teammitglieder mit diesem Skill
Wann ist der Skill hilfreich?
Nutze dies gegen unbeabsichtigten Ersatz zustandsbehafteter Ressourcen bei Bereitstellungsänderungen.
Wobei hilft er dir?
- Verwendet gesperrten gemeinsamen Zustand und prüft geplante Ressourcenänderungen.
- Schützt Datenbanken und andere Zustandsträger vor versehentlicher Löschung.
- Verwendet Konfiguration wieder, ohne relevante Umgebungsunterschiede zu verstecken.
Das könntest du fragen
Prüfe einen Plan mit Datenbankersatz und schlage vor Anwendung eine datenerhaltende Alternative vor. Zeige die ersetzungsbedingende Eigenschaft und betroffene Daten. Liefere einen datenbankerhaltenden Plan; unvermeidbarer Ersatz benötigt eine separate Entscheidung.
Ausführliche Dokumentation
Hier findest du die ursprüngliche Anleitung, Beispiele und Prüfschritte des Skills in ihrer Originalsprache.
Weniger anzeigen
Infrastructure as Code
Manage infrastructure changes through versioned, reviewable declarations with remote state locking, mandatory plan review before apply, and strict separation between stateful data stores and stateless compute.
Plan-Before-Apply Workflow & State Discipline
- Remote state with locking:
- Store Terraform / OpenTofu / Pulumi state in encrypted remote backends with state locking enabled (e.g., S3 + DynamoDB / native S3 lockfile, GCS, or Terraform Cloud) and never commit
.tfstateor.tfstate.backupfiles (which contain plaintext secrets) to version control.
- Store Terraform / OpenTofu / Pulumi state in encrypted remote backends with state locking enabled (e.g., S3 + DynamoDB / native S3 lockfile, GCS, or Terraform Cloud) and never commit
- Generate and inspect the execution plan on every change:
- Run
plan(terraform plan -out=tfplan,cdk diff,kubectl diff) on pull requests and review the exact resource diff (create,update in-place,destroy/replace) before anyapplyruns. - Treat any unplanned
forces replacement(-/+) on a stateful resource (RDS/Cloud SQL database, persistent volume, S3 bucket, DNS zone, KMS key) as a critical blocker.
- Run
- Protect stateful resources against accidental deletion:
- Set
deletion_protection = true,lifecycle { prevent_destroy = true }, orRemovalPolicy.RETAINon production databases, storage buckets, KMS encryption keys, and stateful volumes. - Isolate stateful foundational infrastructure (VPC, databases, KMS, DNS) in a separate state/stack from high-churn application deployment configs so a routine app config update cannot touch database state.
- Set
Environment Parity Without Copy-Paste Drift
- Reuse parameterized modules or shared templates across
stagingandproduction:- Differentiate environments via small, explicit input variable files (
envs/staging.tfvars,envs/prod.tfvars)—sizing, replica counts, and domain names—rather than maintaining diverging copy-pasted resource definitions.
- Differentiate environments via small, explicit input variable files (
- Pin provider and module versions:
- Commit
.terraform.lock.hcland pin provider/module versions (version = "~> 5.0") so an automated pipeline run never pulls a breaking major provider upgrade unexpectedly.
- Commit
- Detect and reconcile ClickOps drift:
- Run scheduled or pre-release drift checks (
plan -detailed-exitcode). When out-of-band manual changes are discovered in a live environment, import or codify them into IaC rather than overwriting them blindly.
- Run scheduled or pre-release drift checks (
Enthaltene Dateien 1
SKILL.md
