turbot/terraform_azure_compliance

Query: kubernetes_cluster_max_pod_50

Usage

powerpipe query terraform_azure_compliance.query.kubernetes_cluster_max_pod_50

Steampipe Tables

SQL

select
address as resource,
case
when (type = 'azurerm_kubernetes_cluster' and (attributes_std -> 'default_node_pool' -> 'max_pods') is null)
or (type = 'azurerm_kubernetes_cluster_node_pool' and (attributes_std -> 'max_pods') is null ) then 'alarm'
when type = 'azurerm_kubernetes_cluster_node_pool' and (attributes_std ->> 'max_pods')::int >= 50 then 'ok'
when type = 'azurerm_kubernetes_cluster' and (attributes_std -> 'default_node_pool' ->> 'max_pods')::int >= 50 then 'ok'
else 'alarm'
end status,
split_part(address, '.', 2) || case
when
(type = 'azurerm_kubernetes_cluster' and (attributes_std -> 'default_node_pool' -> 'max_pods') is null)
or (type = 'azurerm_kubernetes_cluster_node_pool' and (attributes_std -> 'max_pods') is null ) then ' max pods not defined'
when type = 'azurerm_kubernetes_cluster_node_pool' then ' has ' || (attributes_std ->> 'max_pods') || ' pods'
when type = 'azurerm_kubernetes_cluster' then ' has ' || (attributes_std -> 'default_node_pool' ->> 'max_pods') || ' pods'
end || '.' reason
, path || ':' || start_line
from
terraform_resource
where
type in ('azurerm_kubernetes_cluster', 'azurerm_kubernetes_cluster_node_pool');

Controls

The query is being used by the following controls: