Interview Prep/AWS/CloudFormation, CloudWatch, KMS, Secrets and Cost

A stack has been in `CREATE_IN_PROGRESS` for an hour on a `Custom::DbSeeder` resource.

AdvancedTroubleshootingCloudFormation, CloudWatch, KMS, Secrets and Cost
Answer

Likely causes → The custom resource Lambda never sent a response to the pre-signed ResponseURL. It crashed, timed out, could not reach S3 (in a VPC without NAT or an endpoint), or forgot to answer on Delete. CloudFormation waits up to the service timeout, which is one hour by default.

Diagnose →

aws cloudformation describe-stack-resource --stack-name app --logical-resource-id DbSeeder
aws logs tail /aws/lambda/app-DbSeeder --since 2h

Fix →

  1. To unblock now, send a response yourself with curl -X PUT -H 'Content-Type:' --data-binary '{"Status":"FAILURE","Reason":"manual","PhysicalResourceId":"seed","StackId":"...","RequestId":"...","LogicalResourceId":"DbSeeder"}' "<ResponseURL from logs>"
  2. Fix the handler so it always responds in try/finally, including on Delete

Prevent → Use the cfn-response module or CDK Provider framework, and set ServiceTimeout on the custom resource to something short (for example, 300 seconds).

aws All AWS questions Roadmap: Cloud cost & architecture

More on CloudFormation, CloudWatch, KMS, Secrets and Cost