turbot/terraform_gcp_compliance

Query: sql_instance_sql_with_no_public_ip

Usage

powerpipe query terraform_gcp_compliance.query.sql_instance_sql_with_no_public_ip

Steampipe Tables

SQL

select
address as resource,
case
when (attributes_std -> 'settings' -> 'ip_configuration' ->> 'ipv4_enabled') is null then 'alarm'
when (attributes_std -> 'settings' -> 'ip_configuration' ->> 'ipv4_enabled')::boolean then 'alarm'
else 'ok'
end as status,
split_part(address, '.', 2) || case
when (attributes_std -> 'settings' -> 'ip_configuration' ->> 'ipv4_enabled') is null then ' ipv4_enabled is not defined'
when (attributes_std -> 'settings' -> 'ip_configuration' ->> 'ipv4_enabled')::boolean then ' public IP address configured'
else ' no public IP address configured'
end || '.' reason
, path || ':' || start_line
from
terraform_resource
where
type = 'google_sql_database_instance'
and (attributes_std ->> 'database_version') like 'SQLSERVER%';

Controls

The query is being used by the following controls: