Collections
type: Rule
version: v1
...
spec:
# Collect all azurerm_cosmosdb_account that have a geo_location block.
# `collections.geo_locations` will be an array of all named matches of
# the below audit query.
collect:
- name: geo_locations
audit: |
{{ aResource("azurerm_cosmosdb_account", aBlock("geo_location")) }}
# Find all azurerm_cosmosdb_account that have automatic_failover_enabled not set to true
audit: |
{{ aResource("azurerm_cosmosdb_account", anAttributeValueNotEq("automatic_failover_enabled", "true")) }}
# Skip findings where there can be no failover because there is only a single location.
# See the section on Templating for more details.
skip_finding: |
let geo_locations = filter(flatten(collect(collections, "geo_locations.*")), { #.name == finding.name }) ?? [];
len(geo_locations) < 2Last updated