We recommend using Azure Native.
azure.core.ResourcePolicyRemediation
Explore with Pulumi AI
Manages an Azure Resource Policy Remediation.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = new azure.core.ResourceGroup("example", {
name: "resourcegroup1",
location: "West US",
});
const exampleVirtualNetwork = new azure.network.VirtualNetwork("example", {
name: "vnet1",
resourceGroupName: example.name,
location: example.location,
addressSpaces: ["10.0.0.0/16"],
});
const exampleDefinition = new azure.policy.Definition("example", {
name: "only-deploy-in-westeurope",
policyType: "Custom",
mode: "All",
displayName: "my-policy-definition",
});
const exampleResourcePolicyAssignment = new azure.core.ResourcePolicyAssignment("example", {
name: "assignment1",
resourceId: exampleVirtualNetwork.id,
policyDefinitionId: exampleDefinition.id,
parameters: pulumi.jsonStringify({
listOfAllowedLocations: {
value: [
example.location,
"East US",
],
},
}),
});
const exampleResourceGroupPolicyAssignment = new azure.core.ResourceGroupPolicyAssignment("example", {
name: "example",
resourceGroupId: example.id,
policyDefinitionId: exampleDefinition.id,
});
const exampleResourcePolicyRemediation = new azure.core.ResourcePolicyRemediation("example", {
name: "remediation1",
resourceId: exampleVirtualNetwork.id,
policyAssignmentId: exampleResourceGroupPolicyAssignment.id,
});
import pulumi
import json
import pulumi_azure as azure
example = azure.core.ResourceGroup("example",
name="resourcegroup1",
location="West US")
example_virtual_network = azure.network.VirtualNetwork("example",
name="vnet1",
resource_group_name=example.name,
location=example.location,
address_spaces=["10.0.0.0/16"])
example_definition = azure.policy.Definition("example",
name="only-deploy-in-westeurope",
policy_type="Custom",
mode="All",
display_name="my-policy-definition")
example_resource_policy_assignment = azure.core.ResourcePolicyAssignment("example",
name="assignment1",
resource_id=example_virtual_network.id,
policy_definition_id=example_definition.id,
parameters=pulumi.Output.json_dumps({
"listOfAllowedLocations": {
"value": [
example.location,
"East US",
],
},
}))
example_resource_group_policy_assignment = azure.core.ResourceGroupPolicyAssignment("example",
name="example",
resource_group_id=example.id,
policy_definition_id=example_definition.id)
example_resource_policy_remediation = azure.core.ResourcePolicyRemediation("example",
name="remediation1",
resource_id=example_virtual_network.id,
policy_assignment_id=example_resource_group_policy_assignment.id)
package main
import (
"encoding/json"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/network"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/policy"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
Name: pulumi.String("resourcegroup1"),
Location: pulumi.String("West US"),
})
if err != nil {
return err
}
exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "example", &network.VirtualNetworkArgs{
Name: pulumi.String("vnet1"),
ResourceGroupName: example.Name,
Location: example.Location,
AddressSpaces: pulumi.StringArray{
pulumi.String("10.0.0.0/16"),
},
})
if err != nil {
return err
}
exampleDefinition, err := policy.NewDefinition(ctx, "example", &policy.DefinitionArgs{
Name: pulumi.String("only-deploy-in-westeurope"),
PolicyType: pulumi.String("Custom"),
Mode: pulumi.String("All"),
DisplayName: pulumi.String("my-policy-definition"),
})
if err != nil {
return err
}
_, err = core.NewResourcePolicyAssignment(ctx, "example", &core.ResourcePolicyAssignmentArgs{
Name: pulumi.String("assignment1"),
ResourceId: exampleVirtualNetwork.ID(),
PolicyDefinitionId: exampleDefinition.ID(),
Parameters: example.Location.ApplyT(func(location string) (pulumi.String, error) {
var _zero pulumi.String
tmpJSON0, err := json.Marshal(map[string]interface{}{
"listOfAllowedLocations": map[string]interface{}{
"value": []string{
location,
"East US",
},
},
})
if err != nil {
return _zero, err
}
json0 := string(tmpJSON0)
return pulumi.String(json0), nil
}).(pulumi.StringOutput),
})
if err != nil {
return err
}
exampleResourceGroupPolicyAssignment, err := core.NewResourceGroupPolicyAssignment(ctx, "example", &core.ResourceGroupPolicyAssignmentArgs{
Name: pulumi.String("example"),
ResourceGroupId: example.ID(),
PolicyDefinitionId: exampleDefinition.ID(),
})
if err != nil {
return err
}
_, err = core.NewResourcePolicyRemediation(ctx, "example", &core.ResourcePolicyRemediationArgs{
Name: pulumi.String("remediation1"),
ResourceId: exampleVirtualNetwork.ID(),
PolicyAssignmentId: exampleResourceGroupPolicyAssignment.ID(),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using System.Text.Json;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() =>
{
var example = new Azure.Core.ResourceGroup("example", new()
{
Name = "resourcegroup1",
Location = "West US",
});
var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("example", new()
{
Name = "vnet1",
ResourceGroupName = example.Name,
Location = example.Location,
AddressSpaces = new[]
{
"10.0.0.0/16",
},
});
var exampleDefinition = new Azure.Policy.Definition("example", new()
{
Name = "only-deploy-in-westeurope",
PolicyType = "Custom",
Mode = "All",
DisplayName = "my-policy-definition",
});
var exampleResourcePolicyAssignment = new Azure.Core.ResourcePolicyAssignment("example", new()
{
Name = "assignment1",
ResourceId = exampleVirtualNetwork.Id,
PolicyDefinitionId = exampleDefinition.Id,
Parameters = Output.JsonSerialize(Output.Create(new Dictionary<string, object?>
{
["listOfAllowedLocations"] = new Dictionary<string, object?>
{
["value"] = new object?[]
{
example.Location,
"East US",
},
},
})),
});
var exampleResourceGroupPolicyAssignment = new Azure.Core.ResourceGroupPolicyAssignment("example", new()
{
Name = "example",
ResourceGroupId = example.Id,
PolicyDefinitionId = exampleDefinition.Id,
});
var exampleResourcePolicyRemediation = new Azure.Core.ResourcePolicyRemediation("example", new()
{
Name = "remediation1",
ResourceId = exampleVirtualNetwork.Id,
PolicyAssignmentId = exampleResourceGroupPolicyAssignment.Id,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.core.ResourceGroup;
import com.pulumi.azure.core.ResourceGroupArgs;
import com.pulumi.azure.network.VirtualNetwork;
import com.pulumi.azure.network.VirtualNetworkArgs;
import com.pulumi.azure.policy.Definition;
import com.pulumi.azure.policy.DefinitionArgs;
import com.pulumi.azure.core.ResourcePolicyAssignment;
import com.pulumi.azure.core.ResourcePolicyAssignmentArgs;
import com.pulumi.azure.core.ResourceGroupPolicyAssignment;
import com.pulumi.azure.core.ResourceGroupPolicyAssignmentArgs;
import com.pulumi.azure.core.ResourcePolicyRemediation;
import com.pulumi.azure.core.ResourcePolicyRemediationArgs;
import static com.pulumi.codegen.internal.Serialization.*;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new ResourceGroup("example", ResourceGroupArgs.builder()
.name("resourcegroup1")
.location("West US")
.build());
var exampleVirtualNetwork = new VirtualNetwork("exampleVirtualNetwork", VirtualNetworkArgs.builder()
.name("vnet1")
.resourceGroupName(example.name())
.location(example.location())
.addressSpaces("10.0.0.0/16")
.build());
var exampleDefinition = new Definition("exampleDefinition", DefinitionArgs.builder()
.name("only-deploy-in-westeurope")
.policyType("Custom")
.mode("All")
.displayName("my-policy-definition")
.build());
var exampleResourcePolicyAssignment = new ResourcePolicyAssignment("exampleResourcePolicyAssignment", ResourcePolicyAssignmentArgs.builder()
.name("assignment1")
.resourceId(exampleVirtualNetwork.id())
.policyDefinitionId(exampleDefinition.id())
.parameters(example.location().applyValue(location -> serializeJson(
jsonObject(
jsonProperty("listOfAllowedLocations", jsonObject(
jsonProperty("value", jsonArray(
location,
"East US"
))
))
))))
.build());
var exampleResourceGroupPolicyAssignment = new ResourceGroupPolicyAssignment("exampleResourceGroupPolicyAssignment", ResourceGroupPolicyAssignmentArgs.builder()
.name("example")
.resourceGroupId(example.id())
.policyDefinitionId(exampleDefinition.id())
.build());
var exampleResourcePolicyRemediation = new ResourcePolicyRemediation("exampleResourcePolicyRemediation", ResourcePolicyRemediationArgs.builder()
.name("remediation1")
.resourceId(exampleVirtualNetwork.id())
.policyAssignmentId(exampleResourceGroupPolicyAssignment.id())
.build());
}
}
resources:
example:
type: azure:core:ResourceGroup
properties:
name: resourcegroup1
location: West US
exampleVirtualNetwork:
type: azure:network:VirtualNetwork
name: example
properties:
name: vnet1
resourceGroupName: ${example.name}
location: ${example.location}
addressSpaces:
- 10.0.0.0/16
exampleDefinition:
type: azure:policy:Definition
name: example
properties:
name: only-deploy-in-westeurope
policyType: Custom
mode: All
displayName: my-policy-definition
exampleResourcePolicyAssignment:
type: azure:core:ResourcePolicyAssignment
name: example
properties:
name: assignment1
resourceId: ${exampleVirtualNetwork.id}
policyDefinitionId: ${exampleDefinition.id}
parameters:
fn::toJSON:
listOfAllowedLocations:
value:
- ${example.location}
- East US
exampleResourceGroupPolicyAssignment:
type: azure:core:ResourceGroupPolicyAssignment
name: example
properties:
name: example
resourceGroupId: ${example.id}
policyDefinitionId: ${exampleDefinition.id}
exampleResourcePolicyRemediation:
type: azure:core:ResourcePolicyRemediation
name: example
properties:
name: remediation1
resourceId: ${exampleVirtualNetwork.id}
policyAssignmentId: ${exampleResourceGroupPolicyAssignment.id}
Create ResourcePolicyRemediation Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ResourcePolicyRemediation(name: string, args: ResourcePolicyRemediationArgs, opts?: CustomResourceOptions);
@overload
def ResourcePolicyRemediation(resource_name: str,
args: ResourcePolicyRemediationArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ResourcePolicyRemediation(resource_name: str,
opts: Optional[ResourceOptions] = None,
policy_assignment_id: Optional[str] = None,
resource_id: Optional[str] = None,
failure_percentage: Optional[float] = None,
location_filters: Optional[Sequence[str]] = None,
name: Optional[str] = None,
parallel_deployments: Optional[int] = None,
policy_definition_reference_id: Optional[str] = None,
resource_count: Optional[int] = None,
resource_discovery_mode: Optional[str] = None)
func NewResourcePolicyRemediation(ctx *Context, name string, args ResourcePolicyRemediationArgs, opts ...ResourceOption) (*ResourcePolicyRemediation, error)
public ResourcePolicyRemediation(string name, ResourcePolicyRemediationArgs args, CustomResourceOptions? opts = null)
public ResourcePolicyRemediation(String name, ResourcePolicyRemediationArgs args)
public ResourcePolicyRemediation(String name, ResourcePolicyRemediationArgs args, CustomResourceOptions options)
type: azure:core:ResourcePolicyRemediation
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args ResourcePolicyRemediationArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args ResourcePolicyRemediationArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args ResourcePolicyRemediationArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ResourcePolicyRemediationArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ResourcePolicyRemediationArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var resourcePolicyRemediationResource = new Azure.Core.ResourcePolicyRemediation("resourcePolicyRemediationResource", new()
{
PolicyAssignmentId = "string",
ResourceId = "string",
FailurePercentage = 0,
LocationFilters = new[]
{
"string",
},
Name = "string",
ParallelDeployments = 0,
PolicyDefinitionReferenceId = "string",
ResourceCount = 0,
ResourceDiscoveryMode = "string",
});
example, err := core.NewResourcePolicyRemediation(ctx, "resourcePolicyRemediationResource", &core.ResourcePolicyRemediationArgs{
PolicyAssignmentId: pulumi.String("string"),
ResourceId: pulumi.String("string"),
FailurePercentage: pulumi.Float64(0),
LocationFilters: pulumi.StringArray{
pulumi.String("string"),
},
Name: pulumi.String("string"),
ParallelDeployments: pulumi.Int(0),
PolicyDefinitionReferenceId: pulumi.String("string"),
ResourceCount: pulumi.Int(0),
ResourceDiscoveryMode: pulumi.String("string"),
})
var resourcePolicyRemediationResource = new ResourcePolicyRemediation("resourcePolicyRemediationResource", ResourcePolicyRemediationArgs.builder()
.policyAssignmentId("string")
.resourceId("string")
.failurePercentage(0)
.locationFilters("string")
.name("string")
.parallelDeployments(0)
.policyDefinitionReferenceId("string")
.resourceCount(0)
.resourceDiscoveryMode("string")
.build());
resource_policy_remediation_resource = azure.core.ResourcePolicyRemediation("resourcePolicyRemediationResource",
policy_assignment_id="string",
resource_id="string",
failure_percentage=0,
location_filters=["string"],
name="string",
parallel_deployments=0,
policy_definition_reference_id="string",
resource_count=0,
resource_discovery_mode="string")
const resourcePolicyRemediationResource = new azure.core.ResourcePolicyRemediation("resourcePolicyRemediationResource", {
policyAssignmentId: "string",
resourceId: "string",
failurePercentage: 0,
locationFilters: ["string"],
name: "string",
parallelDeployments: 0,
policyDefinitionReferenceId: "string",
resourceCount: 0,
resourceDiscoveryMode: "string",
});
type: azure:core:ResourcePolicyRemediation
properties:
failurePercentage: 0
locationFilters:
- string
name: string
parallelDeployments: 0
policyAssignmentId: string
policyDefinitionReferenceId: string
resourceCount: 0
resourceDiscoveryMode: string
resourceId: string
ResourcePolicyRemediation Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The ResourcePolicyRemediation resource accepts the following input properties:
- Policy
Assignment stringId - The ID of the Policy Assignment that should be remediated.
- Resource
Id string - The Resource ID at which the Policy Remediation should be applied. Changing this forces a new resource to be created.
- Failure
Percentage double - 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.
- Location
Filters List<string> - A list of the resource locations that will be remediated.
- Name string
- The name of the Policy Remediation. Changing this forces a new resource to be created.
- Parallel
Deployments int - 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.
- Policy
Definition stringReference Id - The unique ID for the policy definition reference within the policy set definition that should be remediated. Required when the policy assignment being remediated assigns a policy set definition.
- Resource
Count int - Determines the max number of resources that can be remediated by the remediation job. If not provided, the default resource count is used.
- Resource
Discovery stringMode - The way that resources to remediate are discovered. Possible values are
ExistingNonCompliant
,ReEvaluateCompliance
. Defaults toExistingNonCompliant
.
- Policy
Assignment stringId - The ID of the Policy Assignment that should be remediated.
- Resource
Id string - The Resource ID at which the Policy Remediation should be applied. Changing this forces a new resource to be created.
- Failure
Percentage float64 - 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.
- Location
Filters []string - A list of the resource locations that will be remediated.
- Name string
- The name of the Policy Remediation. Changing this forces a new resource to be created.
- Parallel
Deployments int - 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.
- Policy
Definition stringReference Id - The unique ID for the policy definition reference within the policy set definition that should be remediated. Required when the policy assignment being remediated assigns a policy set definition.
- Resource
Count int - Determines the max number of resources that can be remediated by the remediation job. If not provided, the default resource count is used.
- Resource
Discovery stringMode - The way that resources to remediate are discovered. Possible values are
ExistingNonCompliant
,ReEvaluateCompliance
. Defaults toExistingNonCompliant
.
- policy
Assignment StringId - The ID of the Policy Assignment that should be remediated.
- resource
Id String - The Resource ID at which the Policy Remediation should be applied. Changing this forces a new resource to be created.
- failure
Percentage Double - 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.
- location
Filters List<String> - A list of the resource locations that will be remediated.
- name String
- The name of the Policy Remediation. Changing this forces a new resource to be created.
- parallel
Deployments Integer - 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.
- policy
Definition StringReference Id - The unique ID for the policy definition reference within the policy set definition that should be remediated. Required when the policy assignment being remediated assigns a policy set definition.
- resource
Count Integer - Determines the max number of resources that can be remediated by the remediation job. If not provided, the default resource count is used.
- resource
Discovery StringMode - The way that resources to remediate are discovered. Possible values are
ExistingNonCompliant
,ReEvaluateCompliance
. Defaults toExistingNonCompliant
.
- policy
Assignment stringId - The ID of the Policy Assignment that should be remediated.
- resource
Id string - The Resource ID at which the Policy Remediation should be applied. Changing this forces a new resource to be created.
- failure
Percentage number - 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.
- location
Filters string[] - A list of the resource locations that will be remediated.
- name string
- The name of the Policy Remediation. Changing this forces a new resource to be created.
- parallel
Deployments number - 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.
- policy
Definition stringReference Id - The unique ID for the policy definition reference within the policy set definition that should be remediated. Required when the policy assignment being remediated assigns a policy set definition.
- resource
Count number - Determines the max number of resources that can be remediated by the remediation job. If not provided, the default resource count is used.
- resource
Discovery stringMode - The way that resources to remediate are discovered. Possible values are
ExistingNonCompliant
,ReEvaluateCompliance
. Defaults toExistingNonCompliant
.
- policy_
assignment_ strid - The ID of the Policy Assignment that should be remediated.
- resource_
id str - The Resource ID at which the Policy Remediation should be applied. Changing this forces a new resource to be created.
- failure_
percentage float - 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.
- location_
filters Sequence[str] - A list of the resource locations that will be remediated.
- name str
- The name of the Policy Remediation. Changing this forces a new resource to be created.
- parallel_
deployments int - 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.
- policy_
definition_ strreference_ id - The unique ID for the policy definition reference within the policy set definition that should be remediated. Required when the policy assignment being remediated assigns a policy set definition.
- resource_
count int - Determines the max number of resources that can be remediated by the remediation job. If not provided, the default resource count is used.
- resource_
discovery_ strmode - The way that resources to remediate are discovered. Possible values are
ExistingNonCompliant
,ReEvaluateCompliance
. Defaults toExistingNonCompliant
.
- policy
Assignment StringId - The ID of the Policy Assignment that should be remediated.
- resource
Id String - The Resource ID at which the Policy Remediation should be applied. Changing this forces a new resource to be created.
- failure
Percentage Number - 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.
- location
Filters List<String> - A list of the resource locations that will be remediated.
- name String
- The name of the Policy Remediation. Changing this forces a new resource to be created.
- parallel
Deployments Number - 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.
- policy
Definition StringReference Id - The unique ID for the policy definition reference within the policy set definition that should be remediated. Required when the policy assignment being remediated assigns a policy set definition.
- resource
Count Number - Determines the max number of resources that can be remediated by the remediation job. If not provided, the default resource count is used.
- resource
Discovery StringMode - The way that resources to remediate are discovered. Possible values are
ExistingNonCompliant
,ReEvaluateCompliance
. Defaults toExistingNonCompliant
.
Outputs
All input properties are implicitly available as output properties. Additionally, the ResourcePolicyRemediation resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing ResourcePolicyRemediation Resource
Get an existing ResourcePolicyRemediation resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: ResourcePolicyRemediationState, opts?: CustomResourceOptions): ResourcePolicyRemediation
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
failure_percentage: Optional[float] = None,
location_filters: Optional[Sequence[str]] = None,
name: Optional[str] = None,
parallel_deployments: Optional[int] = None,
policy_assignment_id: Optional[str] = None,
policy_definition_reference_id: Optional[str] = None,
resource_count: Optional[int] = None,
resource_discovery_mode: Optional[str] = None,
resource_id: Optional[str] = None) -> ResourcePolicyRemediation
func GetResourcePolicyRemediation(ctx *Context, name string, id IDInput, state *ResourcePolicyRemediationState, opts ...ResourceOption) (*ResourcePolicyRemediation, error)
public static ResourcePolicyRemediation Get(string name, Input<string> id, ResourcePolicyRemediationState? state, CustomResourceOptions? opts = null)
public static ResourcePolicyRemediation get(String name, Output<String> id, ResourcePolicyRemediationState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Failure
Percentage double - 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.
- Location
Filters List<string> - A list of the resource locations that will be remediated.
- Name string
- The name of the Policy Remediation. Changing this forces a new resource to be created.
- Parallel
Deployments int - 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.
- Policy
Assignment stringId - The ID of the Policy Assignment that should be remediated.
- Policy
Definition stringReference Id - The unique ID for the policy definition reference within the policy set definition that should be remediated. Required when the policy assignment being remediated assigns a policy set definition.
- Resource
Count int - Determines the max number of resources that can be remediated by the remediation job. If not provided, the default resource count is used.
- Resource
Discovery stringMode - The way that resources to remediate are discovered. Possible values are
ExistingNonCompliant
,ReEvaluateCompliance
. Defaults toExistingNonCompliant
. - Resource
Id string - The Resource ID at which the Policy Remediation should be applied. Changing this forces a new resource to be created.
- Failure
Percentage float64 - 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.
- Location
Filters []string - A list of the resource locations that will be remediated.
- Name string
- The name of the Policy Remediation. Changing this forces a new resource to be created.
- Parallel
Deployments int - 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.
- Policy
Assignment stringId - The ID of the Policy Assignment that should be remediated.
- Policy
Definition stringReference Id - The unique ID for the policy definition reference within the policy set definition that should be remediated. Required when the policy assignment being remediated assigns a policy set definition.
- Resource
Count int - Determines the max number of resources that can be remediated by the remediation job. If not provided, the default resource count is used.
- Resource
Discovery stringMode - The way that resources to remediate are discovered. Possible values are
ExistingNonCompliant
,ReEvaluateCompliance
. Defaults toExistingNonCompliant
. - Resource
Id string - The Resource ID at which the Policy Remediation should be applied. Changing this forces a new resource to be created.
- failure
Percentage Double - 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.
- location
Filters List<String> - A list of the resource locations that will be remediated.
- name String
- The name of the Policy Remediation. Changing this forces a new resource to be created.
- parallel
Deployments Integer - 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.
- policy
Assignment StringId - The ID of the Policy Assignment that should be remediated.
- policy
Definition StringReference Id - The unique ID for the policy definition reference within the policy set definition that should be remediated. Required when the policy assignment being remediated assigns a policy set definition.
- resource
Count Integer - Determines the max number of resources that can be remediated by the remediation job. If not provided, the default resource count is used.
- resource
Discovery StringMode - The way that resources to remediate are discovered. Possible values are
ExistingNonCompliant
,ReEvaluateCompliance
. Defaults toExistingNonCompliant
. - resource
Id String - The Resource ID at which the Policy Remediation should be applied. Changing this forces a new resource to be created.
- failure
Percentage number - 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.
- location
Filters string[] - A list of the resource locations that will be remediated.
- name string
- The name of the Policy Remediation. Changing this forces a new resource to be created.
- parallel
Deployments number - 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.
- policy
Assignment stringId - The ID of the Policy Assignment that should be remediated.
- policy
Definition stringReference Id - The unique ID for the policy definition reference within the policy set definition that should be remediated. Required when the policy assignment being remediated assigns a policy set definition.
- resource
Count number - Determines the max number of resources that can be remediated by the remediation job. If not provided, the default resource count is used.
- resource
Discovery stringMode - The way that resources to remediate are discovered. Possible values are
ExistingNonCompliant
,ReEvaluateCompliance
. Defaults toExistingNonCompliant
. - resource
Id string - The Resource ID at which the Policy Remediation should be applied. Changing this forces a new resource to be created.
- failure_
percentage float - 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.
- location_
filters Sequence[str] - A list of the resource locations that will be remediated.
- name str
- The name of the Policy Remediation. Changing this forces a new resource to be created.
- parallel_
deployments int - 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.
- policy_
assignment_ strid - The ID of the Policy Assignment that should be remediated.
- policy_
definition_ strreference_ id - The unique ID for the policy definition reference within the policy set definition that should be remediated. Required when the policy assignment being remediated assigns a policy set definition.
- resource_
count int - Determines the max number of resources that can be remediated by the remediation job. If not provided, the default resource count is used.
- resource_
discovery_ strmode - The way that resources to remediate are discovered. Possible values are
ExistingNonCompliant
,ReEvaluateCompliance
. Defaults toExistingNonCompliant
. - resource_
id str - The Resource ID at which the Policy Remediation should be applied. Changing this forces a new resource to be created.
- failure
Percentage Number - 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.
- location
Filters List<String> - A list of the resource locations that will be remediated.
- name String
- The name of the Policy Remediation. Changing this forces a new resource to be created.
- parallel
Deployments Number - 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.
- policy
Assignment StringId - The ID of the Policy Assignment that should be remediated.
- policy
Definition StringReference Id - The unique ID for the policy definition reference within the policy set definition that should be remediated. Required when the policy assignment being remediated assigns a policy set definition.
- resource
Count Number - Determines the max number of resources that can be remediated by the remediation job. If not provided, the default resource count is used.
- resource
Discovery StringMode - The way that resources to remediate are discovered. Possible values are
ExistingNonCompliant
,ReEvaluateCompliance
. Defaults toExistingNonCompliant
. - resource
Id String - The Resource ID at which the Policy Remediation should be applied. Changing this forces a new resource to be created.
Import
Policy Remediations can be imported using the resource id
, e.g.
$ pulumi import azure:core/resourcePolicyRemediation:ResourcePolicyRemediation example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Compute/virtualMachines/vm1/providers/Microsoft.PolicyInsights/remediations/remediation1
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
azurerm
Terraform Provider.