What are CloudFormation custom resources, `cfn-signal` and `CreationPolicy`?
AdvancedConceptObservability, Security Services and IaC
Answer
A custom resource (AWS::CloudFormation::CustomResource or Custom::Name) invokes a Lambda or SNS endpoint during create, update and delete so you can do anything the API lacks; it must send a response to the pre-signed S3 URL or the stack hangs for an hour. A CreationPolicy with ResourceSignal makes CloudFormation wait for a cfn-signal from the instance (for example after user data finishes) before marking it CREATE_COMPLETE, failing on timeout.
/opt/aws/bin/cfn-signal -e $? --stack app --resource WebAsg --region ap-south-1
More on Observability, Security Services and IaC
How are CloudWatch metrics organized?BeginnerHow do CloudWatch Logs groups, streams and Logs Insights work?BeginnerExplain CloudWatch alarm states and missing data handling.AdvancedWhat is the CloudWatch Embedded Metric Format?AdvancedWhat does EC2 not report to CloudWatch by default?IntermediateWhat does CloudTrail record?Beginner