Closed metapox closed 1 month ago
@metapox Good afternoon. Unfortunately, I'm unable to reproduce the issue. Once CDK submits the delete stack request, CloudFormation takes over and handles the resource deletion. The CloudFormation would display the LogGroup has been deleted. Sometimes, the log streams take a while to be reflected in CloudFormation in the configured region, so it could be a timing issue.
Thanks, Ashish
This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.
Describe the bug
I configured a LogGroup with a removalPolicy set to DESTROY and assigned it to an AwsCustomResource.
When I delete the stack, the LogGroup is deleted initially but is quickly recreated and persists.
It seems likely that the LogGroup is being recreated because asynchronous Lambda logs (from the AwsCustomResource) are being written after the LogGroup has been deleted.
Regression Issue
Last Known Working CDK Version
No response
Expected Behavior
The LogGroup should be deleted only after confirming that Lambda (AwsCustomResource) has finished writing logs.
Current Behavior
I set up an AwsCustomResource with a LogGroup that has the removalPolicy set to DESTROY. When the stack is deleted, the LogGroup appears to remain, even though the retention period is different and only the final Lambda execution logs are present.
This suggests that the LogGroup was deleted and then recreated due to the asynchronous writing of logs after the Lambda's execution.
Reproduction Steps
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.158.0
Framework Version
No response
Node.js Version
v20.17.0
OS
MacOS
Language
TypeScript
Language Version
No response
Other information
Even though I introduced a dependency between the LogGroup and the AwsCustomResource, the result remains unchanged.