- Home
- Skills
- Itsmostafa
- Aws Agent Skills
- Cloudformation
cloudformation_skill
- Python
976
GitHub Stars
2
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill itsmostafa/aws-agent-skills --skill cloudformation- SKILL.md9.6 KB
- template-patterns.md8.5 KB
Overview
This skill provides practical guidance and commands for managing AWS CloudFormation stacks and templates. It focuses on infrastructure as code workflows: writing templates, deploying and updating stacks, managing drift, and troubleshooting deployment failures. The content is organized for quick reference with examples, CLI commands, and patterns for common resources.
How this skill works
It explains core CloudFormation concepts (templates, stacks, change sets, stack sets) and shows YAML examples for common resources like VPCs, Lambda, DynamoDB, and S3. The skill includes CLI snippets for create/update/delete, change set workflows, drift detection, and rollback handling. It also provides best practices for template design, security, organization, and reliability to make deployments predictable and auditable.
When to use it
- Writing or revising CloudFormation templates for repeatable infra provisioning
- Deploying or updating stacks across dev, staging, and prod environments
- Previewing changes safely using change sets before applying updates
- Troubleshooting failed stack operations, rollbacks, or delete failures
- Detecting and reconciling drift between deployed resources and templates
Best practices
- Use parameters, mappings, and conditions to make templates reusable and environment-aware
- Export outputs and use nested stacks or reusable modules for complex architectures
- Prefer IAM roles over access keys and never hardcode secrets; use Secrets Manager
- Enable termination protection and stack policies for production stacks
- Validate templates with aws cloudformation validate-template and use change sets to preview updates
Example use cases
- Create a CI/CD pipeline step that validates and deploys CloudFormation templates to multiple environments
- Define a VPC with public and private subnets and attach an Internet Gateway in a single template
- Deploy a Lambda function and its IAM role, with inline code for small utilities or proofs of concept
- Provision a DynamoDB table with GSIs and point-in-time recovery configured
- Use drift detection to identify manual changes and bring stacks back to the desired state
FAQ
Create a change set with aws cloudformation create-change-set, then inspect it with aws cloudformation describe-change-set before executing.
What should I do when a stack is stuck in DELETE_FAILED?
Describe stack resources to find failures, then retry delete with --retain-resources for problematic resources or delete them manually and retry the stack deletion.