-
Notifications
You must be signed in to change notification settings - Fork 682
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
Add support for tags to aws_vpcs #3672
Conversation
Signed-off-by: Rik Turnbull <37418542+rikturnbull@users.noreply.github.com>
I'd like to hold off on this until we decide how to handle tags on plural resources. What you have is practical - and if you renamed the field to be something like 'raw_tags', I think we might accept it. We're wanting to reserve the method 'tags' for something that does something more sophisticated, hoping to avoid the awkward search within an array of hashes (which you include in your example, and we think would be a common use case). See #3139 and discuss there if you have ideas. |
The actual problem I'm trying to solve is a lookup of a single resource using a name (which is often a tag). I'm currently writing AWS tests against a fork and building up a worrying number which will need migrating in the future. That fork supports the following:
This PR for the plural Unfortunately, as you suggest this results in the rather inelegant:
I can see a number of open discussions that are relevant here (in particular as this naming lookup seems to be a pattern used by awspec): https://github.com/inspec/inspec/issues/3139 I'm not entirely sure how to move forward. Perhaps the pattern should indeed be as I've described:
and also just:
I've resubmitted #3630 with unit tests. |
I think we should keep in mind the goal of this change - to allow searching by VPC name. That's easy to approve and agree to. The fact that a VPC name comes from a tag is an implementation detail. So long as you don't expose the tag functionality, this PR stays out of the impasse of "how to query tags". So, I would recommend #3630 be a simplified PR to add name-querying support to the singular |
@clintoncwolfe I think tag:Name is just a single specific tag. I would prefer having access to all tags not just a specific one. |
This is being added via inspec/inspec-aws#25 which is currently WIP. |
Adds tag property to aws_vpcs to allow tag based queries: