Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LogGroup Not Deleted #28

Open
ambsw-technology opened this issue May 2, 2020 · 1 comment
Open

LogGroup Not Deleted #28

ambsw-technology opened this issue May 2, 2020 · 1 comment

Comments

@ambsw-technology
Copy link

ambsw-technology commented May 2, 2020

We're using cloudformation/cfn-resource-provider.yaml as a nested stack in another CF Template. When that stack fails to deploy, the log group is not cleaned up.

My best guess is that this is the cause. Specifically the Log Group is destroyed while another lambda is still running. When it completes, it logs messages which (due to its permissions) recreate the log.

This seems to be resolved by revoking logs:CreateLogGroup (since CF handles the create anyway) e.g. by reducing the logs permissions from logs:* to:

- logs:CreateLogStream
- logs:PutLogEvents

The log is created and completely deleted. I've tried it twice both ways in an effort to confirm.

EDIT: It's also possible (but untested) that reversing the DependsOn (so the lambda is deleted before the Log Group) would be adequate.

@ambsw-technology
Copy link
Author

ambsw-technology commented May 2, 2020

FWIW I would also restrict these permissions to the actual log group that's being created i.e.

Resource: 
- !GetAtt 'CFNCustomProviderLogGroup.Arn'

Obviously, this would require dropping the DependsOn to CFNCustomProvider or you'd end up with a circular dependency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant