Closed judell closed 2 years ago
I just this bug while testing a new mod, with the same conditions as @judell , namely that if I have syntax errors, I get an error like:
cbruno@M1P terraform_draft % steampipe check control.aws_ec2_instance_not_publicly_accessible
+ AWS EC2 instances should not be publicly accessible ............................................................................................................................... 1 / 1 [==========]
ERROR: prepared statement "terraform_sherlock_aws_ec2_instance_not_publicly_accessib_cb748" does not exist
Summary
OK ...................................................................................................................................................................................... 0 [ ]
SKIP .................................................................................................................................................................................... 0 [ ]
INFO .................................................................................................................................................................................... 0 [ ]
ALARM ................................................................................................................................................................................... 0 [ ]
ERROR ................................................................................................................................................................................... 1 [==========]
TOTAL ............................................................................................................................................................................... 1 / 1 [==========]
But if I run the query in interactive mode, I'm able to see the actual error easily (missing comma):
> select
type || ' ' || name as resource,
case
when not (arguments -> 'associate_public_ip_address')::bool then 'ok'
-- Alarm if property is set to true or isn't defined
else 'alarm'
end as status,
name || case when not (arguments -> 'associate_public_ip_address')::bool then ' is not publicly accessible' else ' is publicly accessible' end || '.' as reason
path
from
terraform_resource
where
type = 'aws_instance'
Error: syntax error at or near "path"
fixed in v0.11.0
errors are reported as expected
Thanks @kaidaguerre!
This snippet fails for an obvious reason.
Error: relation "reposheet.Repos" does not exist
When wrapped as a control, it fails for a non-obvious reason.
Error: prepared statement "github_sherlock_license_is_apache_c28a5" does not exist.
Perhaps related to https://github.com/turbot/steampipe/issues/1144?