PSE-PRISMACLOUD · Question #1
Which RQL string searches for all EBS volumes that do not have a "DataClassification" tag?
The correct answer is B. config where api.name = ,aws-ec2-describe-volumes' AND json.rule = tags[*]key !=. Option B is correct because the != operator in RQL is used to find resources where a condition is not met - in this case, finding EBS volumes where no tag key equals "DataClassification". The tags[].key != syntax targets all elements in the tags array and filters for those…
Question
Which RQL string searches for all EBS volumes that do not have a "DataClassification" tag?
Options
- Aconfig where api.name = 'aws-ec2-describe-volumes, AND json.rule = tags[*]key contains
- Bconfig where api.name = ,aws-ec2-describe-volumes' AND json.rule = tags[*]key !=
- Cconfig where api.name = ,aws-ec2-describe-volumes' AND json.rule = tags[*].key exists
- Dconfig where api.name = 'aws-ec2-describe-volumes' AND json.rule = tags[*].key = 1
How the community answered
(47 responses)- A11% (5)
- B70% (33)
- C4% (2)
- D15% (7)
Explanation
Option B is correct because the != operator in RQL is used to find resources where a condition is not met - in this case, finding EBS volumes where no tag key equals "DataClassification". The tags[*].key != syntax targets all elements in the tags array and filters for those lacking the specified key value.
Why the distractors fail:
- A uses
contains, which would match volumes that do have a tag key matching a substring - the opposite of what's needed - and also has a syntax error (missing closing quote and dot intags[*]key). - C uses
exists, which returns volumes where any tag key is present, not absent - again the inverse of the goal. - D uses
= 1, which compares the key to a numeric value, which is meaningless for checking tag names.
Memory tip: For "does NOT have" queries in RQL, reach for != (not-equal). A helpful mental shortcut: "!= means 'I ain't got it'" - if you want to find resources missing something, use the negation operator, not existence or contains operators.
Topics
Community Discussion
No community discussion yet for this question.