Capture diffable JSON snapshots of AWS resources. Compare snapshots to detect drift, track changes over time, and cross-check against Terraform state.
Take a snapshot of AWS resources. Each resource type is a subcommand.
aws-snapshot snapshot s3
aws-snapshot snapshot eks rds lambda
aws-snapshot snapshot all -o snapshot.json
aws-snapshot snapshot all -o s3://my-bucket/snapshot.jsonSupported resource types: apigateway, cloudfront, dynamodb, ecr, ecs, eks, elasticache, elb, eventbridge, iam, lambda, msk, opensearch, rds, route53, s3, sns, sqs, vpc, all.
Compare two or more snapshots. Files are sorted by their timestamp field and compared pairwise.
aws-snapshot diff before.json after.json
aws-snapshot diff s3://bucket/snap1.json s3://bucket/snap2.jsonOutput:
EKS->production->kubernetes_version: "1.32" -> "1.33"
S3->data-exports: (added)
Lambda->old-function: (removed)
Show version information for AWS resources as a table.
aws-snapshot version eks
aws-snapshot version rdsSupported types: eks, rds, msk, elasticache, opensearch.
Compare Terraform state with actual AWS resources to find drift.
aws-snapshot terraform-check --statefile terraform.tfstate s3 rds
aws-snapshot terraform-check --statefile s3://bucket/state.json --statefile other.tfstate allShows resources that exist in AWS but not in Terraform state, and vice versa.
List resources found in Terraform state files.
aws-snapshot terraform-dump --statefile terraform.tfstate s3 lambdaOutput: resource-type: resource-name: state-file-path
--profile string AWS profile to use
--region string AWS region to use
-v, --verbose Print progress messages to stderr
-c, --concurrency Max parallel resource fetches (default 10)
-o, --outfile Output file path or s3://bucket/key (default: stdout)
Snapshots are JSON with arrays sorted for consistent diffs:
{
"timestamp": "2025-02-20T12:00:00Z",
"S3": [
{
"name": "my-bucket",
"region": "us-east-1",
"versioning_state": "enabled"
}
],
"EKS": [
{
"name": "production",
"version": "1.32"
}
],
"RDS": {
"instances": [],
"clusters": []
}
}git clone https://github.com/funcan/aws-snapshot.git
cd aws-snapshot
make build- Go 1.23+
- AWS credentials configured (environment, profile, or IAM role)
GPLv2