turbot/terraform_azure_compliance

Query: iot_hub_logging_enabled

Usage

powerpipe query terraform_azure_compliance.query.iot_hub_logging_enabled

Steampipe Tables

SQL

select
address as resource,
case
when name in (select split_part((attributes_std ->> 'target_resource_id'), '.', 3) from terraform_resource where type = 'azurerm_monitor_diagnostic_setting' and split_part((attributes_std ->> 'target_resource_id'), '.', 2) = 'azurerm_iothub')then 'ok'
else 'alarm'
end status,
split_part(address, '.', 2) || case
when name in (select split_part((attributes_std ->> 'target_resource_id'), '.', 3) from terraform_resource where type = 'azurerm_monitor_diagnostic_setting' and split_part((attributes_std ->> 'target_resource_id'), '.', 2) = 'azurerm_iothub')then ' logging enabled'
else ' logging disabled'
end || '.' reason
, path || ':' || start_line
from
terraform_resource
where
type = 'azurerm_iothub';

Controls

The query is being used by the following controls: