Control: Microsoft SQL managed instances should have mandatory tags
Description
Check if Microsoft SQL managed instances have mandatory tags.
Usage
Run the control in your terminal:
powerpipe control run azure_tags.control.mssql_managed_instance_mandatory
Snapshot and share results via Turbot Pipes:
powerpipe loginpowerpipe control run azure_tags.control.mssql_managed_instance_mandatory --share
Steampipe Tables
SQL
with analysis as ( select id, title, tags ? & $1 as has_mandatory_tags, to_jsonb($1) - array( select jsonb_object_keys(tags) ) as missing_tags, _ctx, resource_group, subscription_id, tags, region from azure_mssql_managed_instance)select id as resource, case when has_mandatory_tags then 'ok' else 'alarm' end as status, case when has_mandatory_tags then title || ' has all mandatory tags.' else title || ' is missing tags: ' || array_to_string( array( select jsonb_array_elements_text(missing_tags) ), ', ' ) || '.' end as reason, subscription_id as subscription_idfrom analysis;
Params
Args | Name | Default | Description | Variable |
---|---|---|---|---|
$1 | mandatory_tags |
|