All dev instances are stopped every night, yet the account still costs money each day.
BeginnerTroubleshootingCloudFormation, CloudWatch, KMS, Secrets and Cost
Answer
Likely causes → Stopped instances still have charged EBS volumes. Other charges continue too: snapshots, Elastic IPs and all public IPv4 addresses (charged hourly since February 2024), NAT gateways, load balancers, RDS instances (which also restart automatically after 7 days stopped) and CloudWatch Logs storage.
Diagnose →
aws ec2 describe-volumes --filters Name=status,Values=available --query 'Volumes[].[VolumeId,Size,CreateTime]'
aws ec2 describe-addresses --query 'Addresses[?AssociationId==null].[PublicIp,AllocationId]'
aws ec2 describe-nat-gateways --filter Name=state,Values=available --query 'NatGateways[].NatGatewayId'
aws elbv2 describe-load-balancers --query 'LoadBalancers[].LoadBalancerName'
Fix →
- Delete unattached volumes and unused EIPs
- Expire old snapshots with Data Lifecycle Manager
- Remove idle NATs and ALBs in dev (recreate them with IaC when needed)
Prevent → Run ephemeral dev environments from IaC that are destroyed nightly, and use Trusted Advisor or Compute Optimizer idle-resource checks.
More on CloudFormation, CloudWatch, KMS, Secrets and Cost
Updating a stack fails: `Stack:arn:aws:cloudformation:...:stack/app/... is in ROLLBACK_COMPLETE state and can not be updated.`BeginnerA stack is stuck in `UPDATE_ROLLBACK_FAILED`.AdvancedA pipeline fails with `An error occurred (ValidationError) when calling the UpdateStack operation: No updates are to be performed.`Beginner`InsufficientCapabilitiesException: Requires capabilities : [CAPABILITY_NAMED_IAM]`.BeginnerStack deletion ends in `DELETE_FAILED` with `The bucket you tried to delete is not empty` on an S3 bucket resource.IntermediateDrift detection shows `MODIFIED` on a security group and an RDS instance that someone changed in the console. How do you reconcile?Advanced