- Access exclusive content
- Connect with peers
- Share your expertise
- Find support resources
11-04-2025 08:19 AM
Hi Community,
I’m facing an issue where RQL queries that work perfectly in the Investigate > Search console do not work when used in policy definitions via Terraform (v1.5.7). For example:
Query that works in Investigate > Search:
config from cloud.resource where api.name = 'aws-ec2-describe-internet-gateways' as X; config from cloud.resource where api.name = 'aws-ec2-describe-vpcs' as Y; filter '$.X.attachments[*].vpcId equals $.Y.vpcId'; show Y;
This returns the expected results in the search console, showing VPCs with attached IGWs.
Problem:
When I use this query in a policy definition, I get a 400 error:invalid_search_query severity:error subject:invalid_rule
Context:
Questions:
Any help or examples would be greatly appreciated!!
11-04-2025 12:27 PM
Hello A. Putttrevu!
My customer uses multiple joins in Terraform "pushed" policies frequently, so I'm not sure that is your issue.
I read where you ran the query manually and it works. However, have you tried creating the policy in the GUI just to see?
Also, can you give us some more specifics as to how you're using Terraofrm to deploy policies, e.g. what provider are you using, and what version, and are you using any API endpoints, and if so, which ones?
Thanks 🙂
Click Accept as Solution to acknowledge that the answer to your question has been provided.
The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!
These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!
The LIVEcommunity thanks you for your participation!

