-
Notifications
You must be signed in to change notification settings - Fork 396
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
Syntax error in "aws_kms_info" example for filtering by tag #276
Comments
What the exactly error message you got?
works fine. With communit.aws 1.0.0 and also with current version 1.2.1 |
I'm about 90% sure that "tag:Name" is correct (looking at the integration tests for other modules), we're currently waiting on some CI policy changes so that we can run the KMS tests in CI. Once that's in I'll go through the KMS examples and add some integration tests to make sure they work. |
We got the test policies in place for #200 and I've added a test. I've identified a bug if you search for a tag that not all keys have:
I expect to fix this with #200 |
Thanks for looking into it. The example on the docs page reads I only had success with I may be mistaken, but from a brief look I took into the module, it looks like it's written to utilize It is unknown to me what should be the correct syntax ( |
The relevant code is
What's really confusing is that the filter is named 'tag:...' but the data from the 'describe_key' is stored in 'keys' If you used 'tags:Name' it should actually ignore the filter entirely... I'm not a big fan of the way this is implemented, unfortunately the AWS APIs don't allow for filtering lists of CMKs in the way thay (for example) EC2 instance lists can be filtered. |
Thanks for raising the issue, adding an integration test to double check the behaviour did expose that the code's fragile and will break if the tag doesn't exist on all CMKs. I've updated the integration test to include a tag based filter:
Hopefully this can give you some level of confidence that the code works. Note: there are 6 copies of this test running in parallel, |
can this issue be closed? |
Imo yes. |
SUMMARY
"HINT: Did you know the documentation has an "Edit on GitHub" link on every page ?"
I did not see this feature.
The example for tag filtering below:
Ought to read:
https://docs.ansible.com/ansible/latest/collections/community/aws/aws_kms_info_module.html
ISSUE TYPE
COMPONENT NAME
community.aws.aws_kms_info
ANSIBLE VERSION
The text was updated successfully, but these errors were encountered: