turbot/gcp_compliance

Query: sql_instance_with_no_public_ips

Usage

powerpipe query gcp_compliance.query.sql_instance_with_no_public_ips

SQL

select
self_link resource,
case
when ip_addresses @> '[{"type": "PRIMARY"}]'
and backend_type = 'SECOND_GEN' then 'alarm'
else 'ok'
end as status,
case
when ip_addresses @> '[{"type": "PRIMARY"}]'
and backend_type = 'SECOND_GEN' then title || ' associated with public IPs.'
else title || ' not associated with public IPs.'
end as reason,
location as location,
project as project
from
gcp_sql_database_instance;

Controls

The query is being used by the following controls: