infrastructure-as-code
Manage infrastructure with version-controlled, reviewed, and tested IaC
Works with
--- name: infrastructure-as-code description: Manage infrastructure with version-controlled, reviewed, and tested IaC license: MIT --- ## Overview Infrastructure defined by hand is infrastructure that drifts, that can't be reviewed, and that can't be reproduced. This skill enforces that all infrastructure is version-controlled code with the same discipline as application code: specs, reviews, tests, and staged deployment. ## When to Use - Before provisioning any cloud resource - Before modifying production infrastructure - When investigating a drift between expected and actual infrastructure state ## Process ### Step 1: Define the desired state first Write the IaC code that represents the desired state before applying it. Terraform plan / Pulumi preview / CloudFormation change set must be reviewed before apply. ### Step 2: Review the plan output The plan is the diff for infrastructure changes. Review it as carefully as a code diff: - Are only expected resources being created/modified/destroyed? - Are any resources being replaced (destroy + create) that should only be modified? - Are sensitive values being exposed in the plan output? ### Step 3: Blast radius analysis Before applying: - What is the maximum impact if this change fails? - Does this change affect production traffic? - Does this change touch the database, auth system, or network layer? - Is the rollback procedure documented? High blast radius changes require explicit approval from a second engineer. ### Step 4: State management - Use remote state with locking (never local state for team environments) - Never manually modify state files - Version state file changes - Test: can you destroy and recreate from scratch? ### Step 5: Drift detection Run drift detection on a schedule. If the actual state diverges from the IaC state, investigate and resolve — don't let drift accumulate. ### Step 6: Secrets management - No secrets in IaC code or state files - Use: Vault, AWS Secrets Manager, GCP Secret Manager, or similar - Rotate secrets via IaC, not manually ### Step 7: Test the IaC - Unit tests for modules (Terratest, Pulumi testing) - Integration tests: deploy to a non-prod environment and verify - Destroy test: can you tear it down and recreate it? ### Step 8: Staged apply Apply to: development → staging → production. Wait for validation at each stage before proceeding. ## Anti-Rationalizations **"It's a small change — I'll do it in the console"** Console changes become invisible drift. IaC is the only source of truth. No exceptions. **"We don't need to test infrastructure"** Untested IaC fails at the worst moment: during an incident when you need to provision fast. ## Verification Requirements - [ ] Plan/preview reviewed before apply - [ ] Blast radius analyzed - [ ] Rollback procedure documented - [ ] State stored remotely with locking - [ ] No secrets in code or state - [ ] Applied to non-prod first - [ ] Drift detection in place
More DevOps & Infrastructure skills
azure-ai
microsoft/azure-skills
Use for Azure AI: Search, Speech, OpenAI, Document Intelligence. Helps with search, vector/hybrid search, speech-to-text, text-to-speech, transcription, OCR. WHEN: AI Search, query search, vector search, hybrid search, semantic search, speech-to-text, text-to-speech, transcribe, OCR, convert text to speech.
appinsights-instrumentation
microsoft/azure-skills
Guidance for instrumenting webapps with Azure Application Insights. Provides telemetry patterns, SDK setup, and configuration references. WHEN: how to instrument app, App Insights SDK, telemetry patterns, what is App Insights, Application Insights guidance, instrumentation examples, APM best practices.
azure-storage
microsoft/azure-skills
Azure Storage Services including Blob Storage, File Shares, Queue Storage, Table Storage, and Data Lake. Answers questions about storage access tiers (hot, cool, cold, archive), when to use each tier, and tier comparison. Provides object storage, SMB file shares, async messaging, NoSQL key-value, and big data analytics. Includes lifecycle management. USE FOR: blob storage, file shares, queue storage, table storage, data lake, upload files, download blobs, storage accounts, access tiers, storage tiers, hot cool cold archive, storage tier comparison, when to use storage tiers, lifecycle management, Azure Storage concepts. DO NOT USE FOR: SQL databases, Cosmos DB (use azure-prepare), messaging with Event Hubs or Service Bus (use azure-messaging).

