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
aws - cloudfront - logging filter for distributions #5577
aws - cloudfront - logging filter for distributions #5577
Conversation
…Irvine/cloud-custodian into cloudfront-logging-filter
.get('DistributionConfig') | ||
except (client.exceptions.NoSuchResource, client.exceptions.NoSuchDistribution): | ||
r[self.annotation_key] = {} | ||
except Exception as e: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like this is missing test coverage on error handling here (re patch coverage ci check), this is probably easier via mock or passing in a synthetic resource, as an example of using a mock to check error handling https://github.com/cloud-custodian/cloud-custodian/blob/master/tests/test_cwl.py#L92
…Irvine/cloud-custodian into cloudfront-logging-filter
Thanks for the review @kapilt. I think I was able to address all your comments, and I'll definitely be using MagicMock to test exception handling in the future. |
@Lucas-Irvine given that this enables checking to see if logging is enabled on the distributions, are you also planning to add an action to enable logging if it is disabled? |
that's already available. |
Oh wow, thanks for confirming that. I see it in set-attributes now 🤦♂️nevermind @Lucas-Irvine |
Will add a streaming-distribution-config filter and a set-attributes action for streaming distributions as well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, thanks
Filter for Logging enabled in Cloudfront Distributions. This is currently not possible using a value filter because https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/cloudfront.html#CloudFront.Client.list_distributions does not return the Logging Field.