dumpcft is a streamlined CLI tool for AWS CloudFormation template extraction. It allows you to export all CloudFormation templates from your AWS account to local files for documentation, backup, or analysis purposes.
- Export CloudFormation templates from all or selected AWS regions
- Automatic file format detection (YAML or JSON)
- Consistent file naming with account ID, region, and stack name
- Supports multiple AWS profiles
Download the latest release from the releases page for your platform:
- Linux (amd64, arm64)
- MacOS (amd64, arm64)
- Windows (amd64, arm64)
If you have Go 1.24+ installed:
go install github.com/scottbrown/dumpcft/cmd@latestCreate an output directory and run dumpcft:
mkdir templates
dumpcft --profile PROFILE templatesThis will export all CloudFormation templates from all active regions to the templates directory.
Usage:
dumpcft [flags] [output-directory]
Flags:
-h, --help help for dumpcft
-o, --output-dir string The directory where templates are persisted to disk (default "templates")
-p, --profile string The AWS profile to use
-r, --regions string One or more comma-delimited regions to dump
-v, --verbose Shows debug output
dumpcft --profile your-aws-profile -o /tmp/cfn-templatesdumpcft --profile your-aws-profile --regions us-east-1,us-west-2 templatesTemplates are saved with the following naming convention:
<AWS_ACCOUNT_ID>.<REGION>.<STACK_NAME>.cfn.<FORMAT>
For example:
012345678901.us-east-1.my-application-stack.cfn.yaml012345678901.us-west-2.database-stack.cfn.json
The format extension (.yaml or .json) is automatically determined by analyzing the template content.
- Infrastructure Auditing: Snapshot all your CloudFormation templates for compliance reviews
- Documentation: Export templates to include in architecture documentation
- Code Archaeology: Analyze historical infrastructure changes by comparing template snapshots
- Backup: Store copies of critical infrastructure templates for disaster recovery
- Migration: Prepare for cross-account or cross-region migrations
The following AWS permissions are required:
- cloudformation:DescribeStacks
- cloudformation:GetTemplate
- ec2:DescribeRegions
- sts:GetCallerIdentity
- Go 1.24 or higher
- AWS account for integration testing
make buildmake testmake checkmake fmtContributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to your branch
(git push origin feature/amazing-feature) - Open a Pull Request
Before submitting:
- Run
make fmtto ensure consistent code formatting - Run
make testto verify all tests pass - Run
make checkto perform security and code quality checks
This project is licensed under the MIT License – see the LICENSE file for details.