Optimize and manage cloud costs across AWS, Azure, and GCP using reserved instances, spot pricing, and cost monitoring tools.
Cloud cost management involves monitoring, analyzing, and optimizing cloud spending. Implement strategies using reserved instances, spot pricing, proper sizing, and cost allocation to maximize ROI and prevent budget overruns.
Minimal working example:
# Enable Cost Explorer
aws ce get-cost-and-usage \
--time-period Start=2024-01-01,End=2024-01-31 \
--granularity MONTHLY \
--metrics "UnblendedCost" \
--group-by Type=DIMENSION,Key=SERVICE
# List EC2 instances for right-sizing
aws ec2 describe-instances \
--query 'Reservations[*].Instances[*].[InstanceId,InstanceType,State.Name,LaunchTime,Tag]' \
--output table
# Find unattached EBS volumes
aws ec2 describe-volumes \
--filters Name=status,Values=available \
--query 'Volumes[*].[VolumeId,Size,State,CreateTime]'
# Identify unattached Elastic IPs
aws ec2 describe-addresses \
--query 'Addresses[?AssociationId==null]'
# Get RDS instance costs
aws rds describe-db-instances \
--query 'DBInstances[*].[DBInstanceIdentifier,DBInstanceClass,StorageType,AllocatedStorage]'
// ... (see reference guides for full implementation)
Detailed implementations in the references/ directory:
| Guide | Contents | |---|---| | AWS Cost Optimization with AWS CLI | AWS Cost Optimization with AWS CLI | | Terraform Cost Management Configuration | Terraform Cost Management Configuration | | Azure Cost Management | Azure Cost Management | | GCP Cost Optimization | GCP Cost Optimization | | Cost Monitoring Dashboard | Cost Monitoring Dashboard |
Copy a source-pinned command for your client. You run it yourself.
Destination: .claude/skills/cloud-cost-management · pinned to the source commit
git clone https://github.com/aj-geddes/useful-ai-prompts.git
cd useful-ai-prompts
git checkout 3f5182cfd739fc113f4af5244a1cf342ad7f7911
mkdir -p ".claude/skills/cloud-cost-management"
cp -r "skills/cloud-cost-management" ".claude/skills/cloud-cost-management"Review the source before running. This copies files into your project; it is not a one-click install and does not verify runtime safety.
Scanner static-checks@0.1.0 · commit 3f5182cfd739. Static checks cannot prove runtime safety – review the source and the exact diff before installing. How checks work.
No static rules matched. This is not a safety guarantee.