File tree Expand file tree Collapse file tree 6 files changed +24
-11
lines changed
Expand file tree Collapse file tree 6 files changed +24
-11
lines changed Original file line number Diff line number Diff line change @@ -49,7 +49,6 @@ variable "parameters" {
4949 description = " Parameters for the policy assignment."
5050}
5151
52-
5352variable "policy_assignment_scope" {
5453 type = string
5554 description = " The scope at which this assignment is assigned"
@@ -87,5 +86,3 @@ variable "requires_identity" {
8786 description = " True if the policy requires a managed identity, false otherwise"
8887 default = false
8988}
90-
91-
Original file line number Diff line number Diff line change @@ -52,7 +52,8 @@ variable "policy_rule" {
5252 type = object ({
5353 if = any
5454 then = object ({
55- effect = string
55+ effect = string
56+ details = optional (any )
5657 })
5758 })
5859 validation {
@@ -70,6 +71,7 @@ Azure Policy Rule object. Must follow Microsoft schema:
7071 },
7172 "then": {
7273 "effect": "deny | audit | modify | denyAction | append | auditIfNotExists | deployIfNotExists | disabled"
74+ "details": <policy details>
7375 }
7476}
7577EOT
Original file line number Diff line number Diff line change 1-
2-
1+ resource "azurerm_resource_policy_remediation" "remediation" {
2+ name = var. remediation_name
3+ policy_assignment_id = var. policy_assignment_id
4+ resource_discovery_mode = " ExistingNonCompliant"
5+ resource_id = var. resource_id
6+ }
Original file line number Diff line number Diff line change 1-
1+ output "policy_remediation_id" {
2+ value = azurerm_resource_policy_remediation. remediation . id
3+ description = " The ID of the created policy remediation."
4+ }
Original file line number Diff line number Diff line change 1+ variable "remediation_name" {
2+ type = string
3+ description = " The policy remediation name."
4+ }
15
2- variable "policy_assignment_scope " {
6+ variable "policy_assignment_id " {
37 type = string
4- description = " The scope at which this assignment is assigned "
8+ description = " The identifier of a specific policy assignment. "
59}
610
7- variable "policy_assignment_principal_id " {
11+ variable "resource_id " {
812 type = string
9- description = " The identifier of a specific service principal to use for the policy assignment"
13+ description = " The identifier of a specific resource to apply this policy onto."
14+ default = null
1015}
Original file line number Diff line number Diff line change @@ -93,6 +93,8 @@ locals {
9393 network-interface = upper (" ${ var . env } -${ var . location_map [var . location ]} -${ var . application } " )
9494 network-security-group = upper (" NSG-${ var . env } -${ var . location_map [var . location ]} -${ var . application } " )
9595 postgres-sql-server = lower (" postgres-${ var . application } -${ var . env } -${ var . location_map [var . location ]} " )
96+ policy-definition = lower (" policy-def-${ var . application } -${ var . env } -${ var . location_map [var . location ]} " )
97+ policy-assignment = lower (" policy-assign-${ var . application } -${ var . env } -${ var . location_map [var . location ]} " )
9698 private-ssh-key = lower (" ssh-pri-${ var . env } ${ var . location_map [var . location ]} ${ var . application } " )
9799 private-link-scope = lower (" ampls-${ var . env } ${ var . application } " )
98100 private-link-scope-private-endpoint = lower (" ampls-${ var . env } ${ var . location_map [var . location ]} ${ var . application } -private-endpoint" )
You can’t perform that action at this time.
0 commit comments