turbot/terraform_azure_compliance

Query: container_registry_zone_redundant_enabled

Usage

powerpipe query terraform_azure_compliance.query.container_registry_zone_redundant_enabled

Steampipe Tables

SQL

with geo_replication_zone_redundant as (
select
distinct name
from
terraform_resource
where
type = 'azurerm_container_registry'
and
(not (attributes_std -> 'georeplications' -> 'zone_redundancy_enabled')::bool
or attributes_std -> 'georeplications' -> 'zone_redundancy_enabled' is null)
)
select
address as resource,
case
when (r.attributes_std -> 'georeplications') is null then 'alarm'
when not (attributes_std -> 'zone_redundancy_enabled')::boolean then 'alarm'
when g.name is not null then 'alarm'
else 'ok'
end status,
split_part(address, '.', 2) || case
when (r.attributes_std -> 'georeplications') is null then ' geo replication not defined'
when not (attributes_std -> 'zone_redundancy_enabled')::boolean then ' not zone redundant'
when g.name is not null then ' not zone redundant'
else ' zone redundant'
end || '.' reason
, path || ':' || start_line
from
terraform_resource as r
left join geo_replication_zone_redundant as g on g.name = r.name
where
type = 'azurerm_container_registry';

Controls

The query is being used by the following controls: