diff --git a/schemas/2018-05-01/subscriptionDeploymentTemplate.json b/schemas/2018-05-01/subscriptionDeploymentTemplate.json index 230701689e..76a1af5f2b 100644 --- a/schemas/2018-05-01/subscriptionDeploymentTemplate.json +++ b/schemas/2018-05-01/subscriptionDeploymentTemplate.json @@ -965,6 +965,9 @@ { "$ref": "https://schema.management.azure.com/schemas/2021-01-01/Microsoft.PolicyInsights.json#/subscription_resourceDefinitions/attestations" }, + { + "$ref": "https://schema.management.azure.com/schemas/2021-10-01/Microsoft.PolicyInsights.json#/subscription_resourceDefinitions/remediations" + }, { "$ref": "https://schema.management.azure.com/schemas/2020-11-20/Microsoft.ProviderHub.json#/subscription_resourceDefinitions/providerRegistrations" }, diff --git a/schemas/2019-08-01/managementGroupDeploymentTemplate.json b/schemas/2019-08-01/managementGroupDeploymentTemplate.json index 3e293cf178..24f1cc9ae9 100644 --- a/schemas/2019-08-01/managementGroupDeploymentTemplate.json +++ b/schemas/2019-08-01/managementGroupDeploymentTemplate.json @@ -716,6 +716,9 @@ { "$ref": "https://schema.management.azure.com/schemas/2019-07-01/Microsoft.PolicyInsights.json#/unknown_resourceDefinitions/remediations" }, + { + "$ref": "https://schema.management.azure.com/schemas/2021-10-01/Microsoft.PolicyInsights.json#/unknown_resourceDefinitions/remediations" + }, { "$ref": "https://schema.management.azure.com/schemas/2019-05-01/Microsoft.Resources.json#/managementGroup_resourceDefinitions/deployments" }, diff --git a/schemas/2021-10-01/Microsoft.PolicyInsights.json b/schemas/2021-10-01/Microsoft.PolicyInsights.json new file mode 100644 index 0000000000..0aba511c3a --- /dev/null +++ b/schemas/2021-10-01/Microsoft.PolicyInsights.json @@ -0,0 +1,282 @@ +{ + "id": "https://schema.management.azure.com/schemas/2021-10-01/Microsoft.PolicyInsights.json#", + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "Microsoft.PolicyInsights", + "description": "Microsoft PolicyInsights Resource Types", + "resourceDefinitions": { + "remediations": { + "type": "object", + "properties": { + "apiVersion": { + "type": "string", + "enum": [ + "2021-10-01" + ] + }, + "name": { + "type": "string", + "description": "The name of the remediation." + }, + "properties": { + "oneOf": [ + { + "$ref": "#/definitions/RemediationProperties" + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "The remediation properties." + }, + "type": { + "type": "string", + "enum": [ + "Microsoft.PolicyInsights/remediations" + ] + } + }, + "required": [ + "apiVersion", + "name", + "properties", + "type" + ], + "description": "Microsoft.PolicyInsights/remediations" + } + }, + "subscription_resourceDefinitions": { + "remediations": { + "type": "object", + "properties": { + "apiVersion": { + "type": "string", + "enum": [ + "2021-10-01" + ] + }, + "name": { + "type": "string", + "description": "The name of the remediation." + }, + "properties": { + "oneOf": [ + { + "$ref": "#/definitions/RemediationProperties" + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "The remediation properties." + }, + "type": { + "type": "string", + "enum": [ + "Microsoft.PolicyInsights/remediations" + ] + } + }, + "required": [ + "apiVersion", + "name", + "properties", + "type" + ], + "description": "Microsoft.PolicyInsights/remediations" + } + }, + "extension_resourceDefinitions": { + "remediations": { + "type": "object", + "properties": { + "apiVersion": { + "type": "string", + "enum": [ + "2021-10-01" + ] + }, + "name": { + "type": "string", + "description": "The name of the remediation." + }, + "properties": { + "oneOf": [ + { + "$ref": "#/definitions/RemediationProperties" + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "The remediation properties." + }, + "type": { + "type": "string", + "enum": [ + "Microsoft.PolicyInsights/remediations" + ] + } + }, + "required": [ + "apiVersion", + "name", + "properties", + "type" + ], + "description": "Microsoft.PolicyInsights/remediations" + } + }, + "unknown_resourceDefinitions": { + "remediations": { + "type": "object", + "properties": { + "apiVersion": { + "type": "string", + "enum": [ + "2021-10-01" + ] + }, + "name": { + "type": "string", + "description": "The name of the remediation." + }, + "properties": { + "oneOf": [ + { + "$ref": "#/definitions/RemediationProperties" + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "The remediation properties." + }, + "type": { + "type": "string", + "enum": [ + "Microsoft.PolicyInsights/remediations" + ] + } + }, + "required": [ + "apiVersion", + "name", + "properties", + "type" + ], + "description": "Microsoft.PolicyInsights/remediations" + } + }, + "definitions": { + "RemediationFilters": { + "type": "object", + "properties": { + "locations": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "The resource locations that will be remediated." + } + }, + "description": "The filters that will be applied to determine which resources to remediate." + }, + "RemediationProperties": { + "type": "object", + "properties": { + "failureThreshold": { + "oneOf": [ + { + "$ref": "#/definitions/RemediationPropertiesFailureThreshold" + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "The remediation failure threshold settings" + }, + "filters": { + "oneOf": [ + { + "$ref": "#/definitions/RemediationFilters" + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "The filters that will be applied to determine which resources to remediate." + }, + "parallelDeployments": { + "oneOf": [ + { + "type": "integer" + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "Determines how many resources to remediate at any given time. Can be used to increase or reduce the pace of the remediation. If not provided, the default parallel deployments value is used." + }, + "policyAssignmentId": { + "type": "string", + "description": "The resource ID of the policy assignment that should be remediated." + }, + "policyDefinitionReferenceId": { + "type": "string", + "description": "The policy definition reference ID of the individual definition that should be remediated. Required when the policy assignment being remediated assigns a policy set definition." + }, + "resourceCount": { + "oneOf": [ + { + "type": "integer" + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "Determines the max number of resources that can be remediated by the remediation job. If not provided, the default resource count is used." + }, + "resourceDiscoveryMode": { + "oneOf": [ + { + "type": "string", + "enum": [ + "ExistingNonCompliant", + "ReEvaluateCompliance" + ] + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "The way resources to remediate are discovered. Defaults to ExistingNonCompliant if not specified." + } + }, + "description": "The remediation properties." + }, + "RemediationPropertiesFailureThreshold": { + "type": "object", + "properties": { + "percentage": { + "oneOf": [ + { + "type": "number" + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "A number between 0.0 to 1.0 representing the percentage failure threshold. The remediation will fail if the percentage of failed remediation operations (i.e. failed deployments) exceeds this threshold." + } + }, + "description": "The remediation failure threshold settings" + } + } +} \ No newline at end of file diff --git a/schemas/common/autogeneratedResources.json b/schemas/common/autogeneratedResources.json index 985f436ae1..35c38264cc 100644 --- a/schemas/common/autogeneratedResources.json +++ b/schemas/common/autogeneratedResources.json @@ -9841,6 +9841,9 @@ { "$ref": "https://schema.management.azure.com/schemas/2021-01-01/Microsoft.PolicyInsights.json#/resourceDefinitions/attestations" }, + { + "$ref": "https://schema.management.azure.com/schemas/2021-10-01/Microsoft.PolicyInsights.json#/resourceDefinitions/remediations" + }, { "$ref": "https://schema.management.azure.com/schemas/2015-08-01-preview/Microsoft.Portal.json#/resourceDefinitions/dashboards" },