azure-native.policyinsights.RemediationAtResource
Explore with Pulumi AI
The remediation definition. API Version: 2019-07-01.
Example Usage
Create remediation at individual resource scope
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var remediationAtResource = new AzureNative.PolicyInsights.RemediationAtResource("remediationAtResource", new()
{
PolicyAssignmentId = "/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourceGroups/myResourceGroup/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5",
RemediationName = "storageRemediation",
ResourceId = "subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myResourceGroup/providers/microsoft.storage/storageaccounts/storAc1",
});
});
package main
import (
policyinsights "github.com/pulumi/pulumi-azure-native-sdk/policyinsights"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := policyinsights.NewRemediationAtResource(ctx, "remediationAtResource", &policyinsights.RemediationAtResourceArgs{
PolicyAssignmentId: pulumi.String("/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourceGroups/myResourceGroup/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5"),
RemediationName: pulumi.String("storageRemediation"),
ResourceId: pulumi.String("subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myResourceGroup/providers/microsoft.storage/storageaccounts/storAc1"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.policyinsights.RemediationAtResource;
import com.pulumi.azurenative.policyinsights.RemediationAtResourceArgs;
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 remediationAtResource = new RemediationAtResource("remediationAtResource", RemediationAtResourceArgs.builder()
.policyAssignmentId("/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourceGroups/myResourceGroup/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5")
.remediationName("storageRemediation")
.resourceId("subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myResourceGroup/providers/microsoft.storage/storageaccounts/storAc1")
.build());
}
}
import pulumi
import pulumi_azure_native as azure_native
remediation_at_resource = azure_native.policyinsights.RemediationAtResource("remediationAtResource",
policy_assignment_id="/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourceGroups/myResourceGroup/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5",
remediation_name="storageRemediation",
resource_id="subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myResourceGroup/providers/microsoft.storage/storageaccounts/storAc1")
import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";
const remediationAtResource = new azure_native.policyinsights.RemediationAtResource("remediationAtResource", {
policyAssignmentId: "/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourceGroups/myResourceGroup/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5",
remediationName: "storageRemediation",
resourceId: "subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myResourceGroup/providers/microsoft.storage/storageaccounts/storAc1",
});
resources:
remediationAtResource:
type: azure-native:policyinsights:RemediationAtResource
properties:
policyAssignmentId: /subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourceGroups/myResourceGroup/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5
remediationName: storageRemediation
resourceId: subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myResourceGroup/providers/microsoft.storage/storageaccounts/storAc1
Create RemediationAtResource Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new RemediationAtResource(name: string, args: RemediationAtResourceArgs, opts?: CustomResourceOptions);
@overload
def RemediationAtResource(resource_name: str,
args: RemediationAtResourceArgs,
opts: Optional[ResourceOptions] = None)
@overload
def RemediationAtResource(resource_name: str,
opts: Optional[ResourceOptions] = None,
resource_id: Optional[str] = None,
filters: Optional[RemediationFiltersArgs] = None,
policy_assignment_id: Optional[str] = None,
policy_definition_reference_id: Optional[str] = None,
remediation_name: Optional[str] = None,
resource_discovery_mode: Optional[Union[str, ResourceDiscoveryMode]] = None)
func NewRemediationAtResource(ctx *Context, name string, args RemediationAtResourceArgs, opts ...ResourceOption) (*RemediationAtResource, error)
public RemediationAtResource(string name, RemediationAtResourceArgs args, CustomResourceOptions? opts = null)
public RemediationAtResource(String name, RemediationAtResourceArgs args)
public RemediationAtResource(String name, RemediationAtResourceArgs args, CustomResourceOptions options)
type: azure-native:policyinsights:RemediationAtResource
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 RemediationAtResourceArgs
- 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 RemediationAtResourceArgs
- 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 RemediationAtResourceArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args RemediationAtResourceArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args RemediationAtResourceArgs
- 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 remediationAtResourceResource = new AzureNative.Policyinsights.RemediationAtResource("remediationAtResourceResource", new()
{
ResourceId = "string",
Filters =
{
{ "locations", new[]
{
"string",
} },
},
PolicyAssignmentId = "string",
PolicyDefinitionReferenceId = "string",
RemediationName = "string",
ResourceDiscoveryMode = "string",
});
example, err := policyinsights.NewRemediationAtResource(ctx, "remediationAtResourceResource", &policyinsights.RemediationAtResourceArgs{
ResourceId: "string",
Filters: map[string]interface{}{
"locations": []string{
"string",
},
},
PolicyAssignmentId: "string",
PolicyDefinitionReferenceId: "string",
RemediationName: "string",
ResourceDiscoveryMode: "string",
})
var remediationAtResourceResource = new RemediationAtResource("remediationAtResourceResource", RemediationAtResourceArgs.builder()
.resourceId("string")
.filters(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
.policyAssignmentId("string")
.policyDefinitionReferenceId("string")
.remediationName("string")
.resourceDiscoveryMode("string")
.build());
remediation_at_resource_resource = azure_native.policyinsights.RemediationAtResource("remediationAtResourceResource",
resource_id=string,
filters={
locations: [string],
},
policy_assignment_id=string,
policy_definition_reference_id=string,
remediation_name=string,
resource_discovery_mode=string)
const remediationAtResourceResource = new azure_native.policyinsights.RemediationAtResource("remediationAtResourceResource", {
resourceId: "string",
filters: {
locations: ["string"],
},
policyAssignmentId: "string",
policyDefinitionReferenceId: "string",
remediationName: "string",
resourceDiscoveryMode: "string",
});
type: azure-native:policyinsights:RemediationAtResource
properties:
filters:
locations:
- string
policyAssignmentId: string
policyDefinitionReferenceId: string
remediationName: string
resourceDiscoveryMode: string
resourceId: string
RemediationAtResource 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 RemediationAtResource resource accepts the following input properties:
- Resource
Id string - Resource ID.
- Filters
Pulumi.
Azure Native. Policy Insights. Inputs. Remediation Filters - The filters that will be applied to determine which resources to remediate.
- Policy
Assignment stringId - The resource ID of the policy assignment that should be remediated.
- Policy
Definition stringReference Id - 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.
- Remediation
Name string - The name of the remediation.
- Resource
Discovery string | Pulumi.Mode Azure Native. Policy Insights. Resource Discovery Mode - The way resources to remediate are discovered. Defaults to ExistingNonCompliant if not specified.
- Resource
Id string - Resource ID.
- Filters
Remediation
Filters Args - The filters that will be applied to determine which resources to remediate.
- Policy
Assignment stringId - The resource ID of the policy assignment that should be remediated.
- Policy
Definition stringReference Id - 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.
- Remediation
Name string - The name of the remediation.
- Resource
Discovery string | ResourceMode Discovery Mode - The way resources to remediate are discovered. Defaults to ExistingNonCompliant if not specified.
- resource
Id String - Resource ID.
- filters
Remediation
Filters - The filters that will be applied to determine which resources to remediate.
- policy
Assignment StringId - The resource ID of the policy assignment that should be remediated.
- policy
Definition StringReference Id - 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.
- remediation
Name String - The name of the remediation.
- resource
Discovery String | ResourceMode Discovery Mode - The way resources to remediate are discovered. Defaults to ExistingNonCompliant if not specified.
- resource
Id string - Resource ID.
- filters
Remediation
Filters - The filters that will be applied to determine which resources to remediate.
- policy
Assignment stringId - The resource ID of the policy assignment that should be remediated.
- policy
Definition stringReference Id - 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.
- remediation
Name string - The name of the remediation.
- resource
Discovery string | ResourceMode Discovery Mode - The way resources to remediate are discovered. Defaults to ExistingNonCompliant if not specified.
- resource_
id str - Resource ID.
- filters
Remediation
Filters Args - The filters that will be applied to determine which resources to remediate.
- policy_
assignment_ strid - The resource ID of the policy assignment that should be remediated.
- policy_
definition_ strreference_ id - 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.
- remediation_
name str - The name of the remediation.
- resource_
discovery_ str | Resourcemode Discovery Mode - The way resources to remediate are discovered. Defaults to ExistingNonCompliant if not specified.
- resource
Id String - Resource ID.
- filters Property Map
- The filters that will be applied to determine which resources to remediate.
- policy
Assignment StringId - The resource ID of the policy assignment that should be remediated.
- policy
Definition StringReference Id - 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.
- remediation
Name String - The name of the remediation.
- resource
Discovery String | "ExistingMode Non Compliant" | "Re Evaluate Compliance" - The way resources to remediate are discovered. Defaults to ExistingNonCompliant if not specified.
Outputs
All input properties are implicitly available as output properties. Additionally, the RemediationAtResource resource produces the following output properties:
- Created
On string - The time at which the remediation was created.
- Deployment
Status Pulumi.Azure Native. Policy Insights. Outputs. Remediation Deployment Summary Response - The deployment status summary for all deployments created by the remediation.
- Id string
- The provider-assigned unique ID for this managed resource.
- Last
Updated stringOn - The time at which the remediation was last updated.
- Name string
- The name of the remediation.
- Provisioning
State string - The status of the remediation.
- Type string
- The type of the remediation.
- Created
On string - The time at which the remediation was created.
- Deployment
Status RemediationDeployment Summary Response - The deployment status summary for all deployments created by the remediation.
- Id string
- The provider-assigned unique ID for this managed resource.
- Last
Updated stringOn - The time at which the remediation was last updated.
- Name string
- The name of the remediation.
- Provisioning
State string - The status of the remediation.
- Type string
- The type of the remediation.
- created
On String - The time at which the remediation was created.
- deployment
Status RemediationDeployment Summary Response - The deployment status summary for all deployments created by the remediation.
- id String
- The provider-assigned unique ID for this managed resource.
- last
Updated StringOn - The time at which the remediation was last updated.
- name String
- The name of the remediation.
- provisioning
State String - The status of the remediation.
- type String
- The type of the remediation.
- created
On string - The time at which the remediation was created.
- deployment
Status RemediationDeployment Summary Response - The deployment status summary for all deployments created by the remediation.
- id string
- The provider-assigned unique ID for this managed resource.
- last
Updated stringOn - The time at which the remediation was last updated.
- name string
- The name of the remediation.
- provisioning
State string - The status of the remediation.
- type string
- The type of the remediation.
- created_
on str - The time at which the remediation was created.
- deployment_
status RemediationDeployment Summary Response - The deployment status summary for all deployments created by the remediation.
- id str
- The provider-assigned unique ID for this managed resource.
- last_
updated_ stron - The time at which the remediation was last updated.
- name str
- The name of the remediation.
- provisioning_
state str - The status of the remediation.
- type str
- The type of the remediation.
- created
On String - The time at which the remediation was created.
- deployment
Status Property Map - The deployment status summary for all deployments created by the remediation.
- id String
- The provider-assigned unique ID for this managed resource.
- last
Updated StringOn - The time at which the remediation was last updated.
- name String
- The name of the remediation.
- provisioning
State String - The status of the remediation.
- type String
- The type of the remediation.
Supporting Types
RemediationDeploymentSummaryResponse, RemediationDeploymentSummaryResponseArgs
- Failed
Deployments int - The number of deployments required by the remediation that have failed.
- Successful
Deployments int - The number of deployments required by the remediation that have succeeded.
- Total
Deployments int - The number of deployments required by the remediation.
- Failed
Deployments int - The number of deployments required by the remediation that have failed.
- Successful
Deployments int - The number of deployments required by the remediation that have succeeded.
- Total
Deployments int - The number of deployments required by the remediation.
- failed
Deployments Integer - The number of deployments required by the remediation that have failed.
- successful
Deployments Integer - The number of deployments required by the remediation that have succeeded.
- total
Deployments Integer - The number of deployments required by the remediation.
- failed
Deployments number - The number of deployments required by the remediation that have failed.
- successful
Deployments number - The number of deployments required by the remediation that have succeeded.
- total
Deployments number - The number of deployments required by the remediation.
- failed_
deployments int - The number of deployments required by the remediation that have failed.
- successful_
deployments int - The number of deployments required by the remediation that have succeeded.
- total_
deployments int - The number of deployments required by the remediation.
- failed
Deployments Number - The number of deployments required by the remediation that have failed.
- successful
Deployments Number - The number of deployments required by the remediation that have succeeded.
- total
Deployments Number - The number of deployments required by the remediation.
RemediationFilters, RemediationFiltersArgs
- Locations List<string>
- The resource locations that will be remediated.
- Locations []string
- The resource locations that will be remediated.
- locations List<String>
- The resource locations that will be remediated.
- locations string[]
- The resource locations that will be remediated.
- locations Sequence[str]
- The resource locations that will be remediated.
- locations List<String>
- The resource locations that will be remediated.
RemediationFiltersResponse, RemediationFiltersResponseArgs
- Locations List<string>
- The resource locations that will be remediated.
- Locations []string
- The resource locations that will be remediated.
- locations List<String>
- The resource locations that will be remediated.
- locations string[]
- The resource locations that will be remediated.
- locations Sequence[str]
- The resource locations that will be remediated.
- locations List<String>
- The resource locations that will be remediated.
ResourceDiscoveryMode, ResourceDiscoveryModeArgs
- Existing
Non Compliant - ExistingNonCompliantRemediate resources that are already known to be non-compliant.
- Re
Evaluate Compliance - ReEvaluateComplianceRe-evaluate the compliance state of resources and then remediate the resources found to be non-compliant.
- Resource
Discovery Mode Existing Non Compliant - ExistingNonCompliantRemediate resources that are already known to be non-compliant.
- Resource
Discovery Mode Re Evaluate Compliance - ReEvaluateComplianceRe-evaluate the compliance state of resources and then remediate the resources found to be non-compliant.
- Existing
Non Compliant - ExistingNonCompliantRemediate resources that are already known to be non-compliant.
- Re
Evaluate Compliance - ReEvaluateComplianceRe-evaluate the compliance state of resources and then remediate the resources found to be non-compliant.
- Existing
Non Compliant - ExistingNonCompliantRemediate resources that are already known to be non-compliant.
- Re
Evaluate Compliance - ReEvaluateComplianceRe-evaluate the compliance state of resources and then remediate the resources found to be non-compliant.
- EXISTING_NON_COMPLIANT
- ExistingNonCompliantRemediate resources that are already known to be non-compliant.
- RE_EVALUATE_COMPLIANCE
- ReEvaluateComplianceRe-evaluate the compliance state of resources and then remediate the resources found to be non-compliant.
- "Existing
Non Compliant" - ExistingNonCompliantRemediate resources that are already known to be non-compliant.
- "Re
Evaluate Compliance" - ReEvaluateComplianceRe-evaluate the compliance state of resources and then remediate the resources found to be non-compliant.
Import
An existing resource can be imported using its type token, name, and identifier, e.g.
$ pulumi import azure-native:policyinsights:RemediationAtResource storageRemediation /subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myResourceGroup/providers/microsoft.storage/storageaccounts/storAc1/providers/microsoft.policyinsights/remediations/storageRemediation
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- azure-native-v1 pulumi/pulumi-azure-native
- License
- Apache-2.0