turbot/steampipe-mod-terraform-azure-compliance

Control: Web apps should have more than one worker

Description

It is recommended to have more than one worker for failover. This control is non-compliant if Web apps have one or less than one worker.

Usage

Run the control in your terminal:

powerpipe control run terraform_azure_compliance.control.appservice_web_app_worker_more_than_one

Snapshot and share results via Turbot Pipes:

powerpipe login
powerpipe control run terraform_azure_compliance.control.appservice_web_app_worker_more_than_one --share

SQL

This control uses a named query:

select
address as resource,
case
when (attributes_std ->> 'worker_count')::int >= 2 then 'ok'
when (attributes_std ->> 'worker_count')::int < 2 then 'alarm'
else 'alarm'
end status,
split_part(address, '.', 2) || case
when (attributes_std ->> 'worker_count')::int >= 2 then ' has ' || (attributes_std ->> 'worker_count') || ' number of workers'
when (attributes_std ->> 'worker_count')::int < 2 then ' has ' || (attributes_std ->> 'worker_count') || ' number of workers'
else ' worker count is not set'
end || '.' reason
, path || ':' || start_line
from
terraform_resource
where
type = 'azurerm_service_plan';

Tags