Skip to content

How to enable remediation for only certain policies in a custom initiative while still enabling the compliance report for all policies. #103

Answered by gettek
raghuvanshir asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @raghuvanshir, on the assignment module you can skip_remediation=true, then create a remediation task alognside the module resource, specifying the subset of references you wish to remediate:

locals {
  definition_reference_ids = [
    "foo",
    "bar"
  ]
}

resource "azurerm_subscription_policy_remediation" "rem" {
  for_each                       = toset(local.definition_reference_ids)
  name                           = lower("${each.key}-${formatdate("DD-MM-YYYY-hh:mm:ss", timestamp())}")
  subscription_id                = data.azurerm_client_config.current.subscription_id
  policy_assignment_id           = module.set_rg_configure_diag_initiative.id
  policy_definition_reference_id = 

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@raghuvanshir
Comment options

Answer selected by raghuvanshir
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants