-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
adding support to filter on 'vpc attribute' #1908
Conversation
c7n/resources/vpc.py
Outdated
|
||
for r in resources: | ||
hostname = client.describe_vpc_attribute( | ||
VpcId=r['VpcId'], |
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.
Ideally only fetch the attribute if it’s being matched on
c7n/resources/vpc.py
Outdated
"""Filters VPCs based on their DNS attributes""" | ||
schema = type_schema( | ||
'vpc-attributes', | ||
EnableDnsHostnames={'type': 'boolean'}, |
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.
We be generally gone for lower case hyphenated when not letting the user specify arbitrary keys
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.
gotcha. I had originally used lower case for the parameters but noted a few instances where upper case was used.
I also forgot to add in a mock policy in the docstring... |
- corrected parameter case (all lower case) - added example policy in doctstring - added second unittest for single attribute matching
i'd suggest we also drop the 'enable' prefix on the attributes. |
- removing 'enabled' prefix from parameters - correcting example policy to make sense with provided filter
- correcting unittest (previously changed parameter syntax)
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.
thanks, lgtm
Per #1616 , adding support to filter VPC based on vpc-attribute