1 Answer
- Newest
- Most votes
- Most comments
0
The DELETE operation will be invoked only for resources that have been created. Add a check in your lambda function to verify if the account has already been on-boarded and return a FAILED status in such case. This causes the stack creation to fail and triggers the rollback of anything that has been created. By putting the custom resource that does the check as dependency of all the other resources in the stack, you avoid the creation of any further resource unless the custom resource succeeds.
Relevant content
- Accepted Answerasked a year ago
- asked 2 years ago
- Why can't I view the EventBridge trigger in my Lambda function that my CloudFormation stack created?AWS OFFICIALUpdated a month ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated a year ago