You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using terrascan to interrogate a Terraform plan file. When attempting to resolve the HIGH severity error produced by terrascan with regard to resource locks on azure resources, the provided rule does not compare the relevant components to determine if a lock is present.
What I Did
main.tf
locals {
name_prefix="prefix"name_suffix="suffix"
}
resource"azurerm_container_registry""this" {
name="${local.name_prefix}acr${local.name_suffix}"resource_group_name="resource_group_name"location="eastus"sku=var.skuadmin_enabled=var.admin_enabled
}
resource"azurerm_management_lock""this" {
name="${local.name_prefix}acr${local.name_suffix}"scope=azurerm_container_registry.this.idlock_level="CanNotDelete"notes="Managed by terraform. Locked for the warm and fuzzies"
}
resource"azurerm_management_lock""this" {
name="azurerm_management_lock.this"scope=azurerm_container_registry.this.idlock_level="CanNotDelete"# azurerm_management_lock does not contain tags, and we cannot match them not unless the resource is deployed in the cloud.notes="Cannot Delete Resource"
}
The text was updated successfully, but these errors were encountered:
Description
Using terrascan to interrogate a Terraform plan file. When attempting to resolve the HIGH severity error produced by terrascan with regard to resource locks on azure resources, the provided rule does not compare the relevant components to determine if a lock is present.
What I Did
main.tf
This rule is trigged as a violation containerRegistryResourceLock.rego
I enabled debugging mode and grabbed the "expected" result and decoded it.
The expected lock resource is:
The text was updated successfully, but these errors were encountered: