1. Packages
  2. Azure Native v1
  3. API Docs
  4. policyinsights
  5. RemediationAtSubscription
These are the docs for Azure Native v1. We recommenend using the latest version, Azure Native v2.
Azure Native v1 v1.104.0 published on Thursday, Jul 6, 2023 by Pulumi

azure-native.policyinsights.RemediationAtSubscription

Explore with Pulumi AI

azure-native-v1 logo
These are the docs for Azure Native v1. We recommenend using the latest version, Azure Native v2.
Azure Native v1 v1.104.0 published on Thursday, Jul 6, 2023 by Pulumi

    The remediation definition. API Version: 2019-07-01.

    Example Usage

    Create remediation at subscription scope

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AzureNative = Pulumi.AzureNative;
    
    return await Deployment.RunAsync(() => 
    {
        var remediationAtSubscription = new AzureNative.PolicyInsights.RemediationAtSubscription("remediationAtSubscription", new()
        {
            PolicyAssignmentId = "/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5",
            RemediationName = "storageRemediation",
        });
    
    });
    
    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.NewRemediationAtSubscription(ctx, "remediationAtSubscription", &policyinsights.RemediationAtSubscriptionArgs{
    			PolicyAssignmentId: pulumi.String("/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5"),
    			RemediationName:    pulumi.String("storageRemediation"),
    		})
    		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.RemediationAtSubscription;
    import com.pulumi.azurenative.policyinsights.RemediationAtSubscriptionArgs;
    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 remediationAtSubscription = new RemediationAtSubscription("remediationAtSubscription", RemediationAtSubscriptionArgs.builder()        
                .policyAssignmentId("/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5")
                .remediationName("storageRemediation")
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_azure_native as azure_native
    
    remediation_at_subscription = azure_native.policyinsights.RemediationAtSubscription("remediationAtSubscription",
        policy_assignment_id="/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5",
        remediation_name="storageRemediation")
    
    import * as pulumi from "@pulumi/pulumi";
    import * as azure_native from "@pulumi/azure-native";
    
    const remediationAtSubscription = new azure_native.policyinsights.RemediationAtSubscription("remediationAtSubscription", {
        policyAssignmentId: "/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5",
        remediationName: "storageRemediation",
    });
    
    resources:
      remediationAtSubscription:
        type: azure-native:policyinsights:RemediationAtSubscription
        properties:
          policyAssignmentId: /subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5
          remediationName: storageRemediation
    

    Create remediation at subscription scope with all properties

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AzureNative = Pulumi.AzureNative;
    
    return await Deployment.RunAsync(() => 
    {
        var remediationAtSubscription = new AzureNative.PolicyInsights.RemediationAtSubscription("remediationAtSubscription", new()
        {
            Filters = new AzureNative.PolicyInsights.Inputs.RemediationFiltersArgs
            {
                Locations = new[]
                {
                    "eastus",
                    "westus",
                },
            },
            PolicyAssignmentId = "/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5",
            PolicyDefinitionReferenceId = "8c8fa9e4",
            RemediationName = "storageRemediation",
            ResourceDiscoveryMode = "ReEvaluateCompliance",
        });
    
    });
    
    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.NewRemediationAtSubscription(ctx, "remediationAtSubscription", &policyinsights.RemediationAtSubscriptionArgs{
    			Filters: &policyinsights.RemediationFiltersArgs{
    				Locations: pulumi.StringArray{
    					pulumi.String("eastus"),
    					pulumi.String("westus"),
    				},
    			},
    			PolicyAssignmentId:          pulumi.String("/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5"),
    			PolicyDefinitionReferenceId: pulumi.String("8c8fa9e4"),
    			RemediationName:             pulumi.String("storageRemediation"),
    			ResourceDiscoveryMode:       pulumi.String("ReEvaluateCompliance"),
    		})
    		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.RemediationAtSubscription;
    import com.pulumi.azurenative.policyinsights.RemediationAtSubscriptionArgs;
    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 remediationAtSubscription = new RemediationAtSubscription("remediationAtSubscription", RemediationAtSubscriptionArgs.builder()        
                .filters(Map.of("locations",             
                    "eastus",
                    "westus"))
                .policyAssignmentId("/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5")
                .policyDefinitionReferenceId("8c8fa9e4")
                .remediationName("storageRemediation")
                .resourceDiscoveryMode("ReEvaluateCompliance")
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_azure_native as azure_native
    
    remediation_at_subscription = azure_native.policyinsights.RemediationAtSubscription("remediationAtSubscription",
        filters=azure_native.policyinsights.RemediationFiltersArgs(
            locations=[
                "eastus",
                "westus",
            ],
        ),
        policy_assignment_id="/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5",
        policy_definition_reference_id="8c8fa9e4",
        remediation_name="storageRemediation",
        resource_discovery_mode="ReEvaluateCompliance")
    
    import * as pulumi from "@pulumi/pulumi";
    import * as azure_native from "@pulumi/azure-native";
    
    const remediationAtSubscription = new azure_native.policyinsights.RemediationAtSubscription("remediationAtSubscription", {
        filters: {
            locations: [
                "eastus",
                "westus",
            ],
        },
        policyAssignmentId: "/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5",
        policyDefinitionReferenceId: "8c8fa9e4",
        remediationName: "storageRemediation",
        resourceDiscoveryMode: "ReEvaluateCompliance",
    });
    
    resources:
      remediationAtSubscription:
        type: azure-native:policyinsights:RemediationAtSubscription
        properties:
          filters:
            locations:
              - eastus
              - westus
          policyAssignmentId: /subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5
          policyDefinitionReferenceId: 8c8fa9e4
          remediationName: storageRemediation
          resourceDiscoveryMode: ReEvaluateCompliance
    

    Create RemediationAtSubscription Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new RemediationAtSubscription(name: string, args?: RemediationAtSubscriptionArgs, opts?: CustomResourceOptions);
    @overload
    def RemediationAtSubscription(resource_name: str,
                                  args: Optional[RemediationAtSubscriptionArgs] = None,
                                  opts: Optional[ResourceOptions] = None)
    
    @overload
    def RemediationAtSubscription(resource_name: str,
                                  opts: Optional[ResourceOptions] = 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 NewRemediationAtSubscription(ctx *Context, name string, args *RemediationAtSubscriptionArgs, opts ...ResourceOption) (*RemediationAtSubscription, error)
    public RemediationAtSubscription(string name, RemediationAtSubscriptionArgs? args = null, CustomResourceOptions? opts = null)
    public RemediationAtSubscription(String name, RemediationAtSubscriptionArgs args)
    public RemediationAtSubscription(String name, RemediationAtSubscriptionArgs args, CustomResourceOptions options)
    
    type: azure-native:policyinsights:RemediationAtSubscription
    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 RemediationAtSubscriptionArgs
    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 RemediationAtSubscriptionArgs
    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 RemediationAtSubscriptionArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args RemediationAtSubscriptionArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args RemediationAtSubscriptionArgs
    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 remediationAtSubscriptionResource = new AzureNative.Policyinsights.RemediationAtSubscription("remediationAtSubscriptionResource", new()
    {
        Filters = 
        {
            { "locations", new[]
            {
                "string",
            } },
        },
        PolicyAssignmentId = "string",
        PolicyDefinitionReferenceId = "string",
        RemediationName = "string",
        ResourceDiscoveryMode = "string",
    });
    
    example, err := policyinsights.NewRemediationAtSubscription(ctx, "remediationAtSubscriptionResource", &policyinsights.RemediationAtSubscriptionArgs{
    	Filters: map[string]interface{}{
    		"locations": []string{
    			"string",
    		},
    	},
    	PolicyAssignmentId:          "string",
    	PolicyDefinitionReferenceId: "string",
    	RemediationName:             "string",
    	ResourceDiscoveryMode:       "string",
    })
    
    var remediationAtSubscriptionResource = new RemediationAtSubscription("remediationAtSubscriptionResource", RemediationAtSubscriptionArgs.builder()
        .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_subscription_resource = azure_native.policyinsights.RemediationAtSubscription("remediationAtSubscriptionResource",
        filters={
            locations: [string],
        },
        policy_assignment_id=string,
        policy_definition_reference_id=string,
        remediation_name=string,
        resource_discovery_mode=string)
    
    const remediationAtSubscriptionResource = new azure_native.policyinsights.RemediationAtSubscription("remediationAtSubscriptionResource", {
        filters: {
            locations: ["string"],
        },
        policyAssignmentId: "string",
        policyDefinitionReferenceId: "string",
        remediationName: "string",
        resourceDiscoveryMode: "string",
    });
    
    type: azure-native:policyinsights:RemediationAtSubscription
    properties:
        filters:
            locations:
                - string
        policyAssignmentId: string
        policyDefinitionReferenceId: string
        remediationName: string
        resourceDiscoveryMode: string
    

    RemediationAtSubscription 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 RemediationAtSubscription resource accepts the following input properties:

    Filters Pulumi.AzureNative.PolicyInsights.Inputs.RemediationFilters
    The filters that will be applied to determine which resources to remediate.
    PolicyAssignmentId string
    The resource ID of the policy assignment that should be remediated.
    PolicyDefinitionReferenceId string
    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.
    RemediationName string
    The name of the remediation.
    ResourceDiscoveryMode string | Pulumi.AzureNative.PolicyInsights.ResourceDiscoveryMode
    The way resources to remediate are discovered. Defaults to ExistingNonCompliant if not specified.
    Filters RemediationFiltersArgs
    The filters that will be applied to determine which resources to remediate.
    PolicyAssignmentId string
    The resource ID of the policy assignment that should be remediated.
    PolicyDefinitionReferenceId string
    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.
    RemediationName string
    The name of the remediation.
    ResourceDiscoveryMode string | ResourceDiscoveryMode
    The way resources to remediate are discovered. Defaults to ExistingNonCompliant if not specified.
    filters RemediationFilters
    The filters that will be applied to determine which resources to remediate.
    policyAssignmentId String
    The resource ID of the policy assignment that should be remediated.
    policyDefinitionReferenceId String
    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.
    remediationName String
    The name of the remediation.
    resourceDiscoveryMode String | ResourceDiscoveryMode
    The way resources to remediate are discovered. Defaults to ExistingNonCompliant if not specified.
    filters RemediationFilters
    The filters that will be applied to determine which resources to remediate.
    policyAssignmentId string
    The resource ID of the policy assignment that should be remediated.
    policyDefinitionReferenceId string
    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.
    remediationName string
    The name of the remediation.
    resourceDiscoveryMode string | ResourceDiscoveryMode
    The way resources to remediate are discovered. Defaults to ExistingNonCompliant if not specified.
    filters RemediationFiltersArgs
    The filters that will be applied to determine which resources to remediate.
    policy_assignment_id str
    The resource ID of the policy assignment that should be remediated.
    policy_definition_reference_id str
    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_mode str | ResourceDiscoveryMode
    The way resources to remediate are discovered. Defaults to ExistingNonCompliant if not specified.
    filters Property Map
    The filters that will be applied to determine which resources to remediate.
    policyAssignmentId String
    The resource ID of the policy assignment that should be remediated.
    policyDefinitionReferenceId String
    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.
    remediationName String
    The name of the remediation.
    resourceDiscoveryMode String | "ExistingNonCompliant" | "ReEvaluateCompliance"
    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 RemediationAtSubscription resource produces the following output properties:

    CreatedOn string
    The time at which the remediation was created.
    DeploymentStatus Pulumi.AzureNative.PolicyInsights.Outputs.RemediationDeploymentSummaryResponse
    The deployment status summary for all deployments created by the remediation.
    Id string
    The provider-assigned unique ID for this managed resource.
    LastUpdatedOn string
    The time at which the remediation was last updated.
    Name string
    The name of the remediation.
    ProvisioningState string
    The status of the remediation.
    Type string
    The type of the remediation.
    CreatedOn string
    The time at which the remediation was created.
    DeploymentStatus RemediationDeploymentSummaryResponse
    The deployment status summary for all deployments created by the remediation.
    Id string
    The provider-assigned unique ID for this managed resource.
    LastUpdatedOn string
    The time at which the remediation was last updated.
    Name string
    The name of the remediation.
    ProvisioningState string
    The status of the remediation.
    Type string
    The type of the remediation.
    createdOn String
    The time at which the remediation was created.
    deploymentStatus RemediationDeploymentSummaryResponse
    The deployment status summary for all deployments created by the remediation.
    id String
    The provider-assigned unique ID for this managed resource.
    lastUpdatedOn String
    The time at which the remediation was last updated.
    name String
    The name of the remediation.
    provisioningState String
    The status of the remediation.
    type String
    The type of the remediation.
    createdOn string
    The time at which the remediation was created.
    deploymentStatus RemediationDeploymentSummaryResponse
    The deployment status summary for all deployments created by the remediation.
    id string
    The provider-assigned unique ID for this managed resource.
    lastUpdatedOn string
    The time at which the remediation was last updated.
    name string
    The name of the remediation.
    provisioningState 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 RemediationDeploymentSummaryResponse
    The deployment status summary for all deployments created by the remediation.
    id str
    The provider-assigned unique ID for this managed resource.
    last_updated_on str
    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.
    createdOn String
    The time at which the remediation was created.
    deploymentStatus Property Map
    The deployment status summary for all deployments created by the remediation.
    id String
    The provider-assigned unique ID for this managed resource.
    lastUpdatedOn String
    The time at which the remediation was last updated.
    name String
    The name of the remediation.
    provisioningState String
    The status of the remediation.
    type String
    The type of the remediation.

    Supporting Types

    RemediationDeploymentSummaryResponse, RemediationDeploymentSummaryResponseArgs

    FailedDeployments int
    The number of deployments required by the remediation that have failed.
    SuccessfulDeployments int
    The number of deployments required by the remediation that have succeeded.
    TotalDeployments int
    The number of deployments required by the remediation.
    FailedDeployments int
    The number of deployments required by the remediation that have failed.
    SuccessfulDeployments int
    The number of deployments required by the remediation that have succeeded.
    TotalDeployments int
    The number of deployments required by the remediation.
    failedDeployments Integer
    The number of deployments required by the remediation that have failed.
    successfulDeployments Integer
    The number of deployments required by the remediation that have succeeded.
    totalDeployments Integer
    The number of deployments required by the remediation.
    failedDeployments number
    The number of deployments required by the remediation that have failed.
    successfulDeployments number
    The number of deployments required by the remediation that have succeeded.
    totalDeployments 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.
    failedDeployments Number
    The number of deployments required by the remediation that have failed.
    successfulDeployments Number
    The number of deployments required by the remediation that have succeeded.
    totalDeployments 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

    ExistingNonCompliant
    ExistingNonCompliantRemediate resources that are already known to be non-compliant.
    ReEvaluateCompliance
    ReEvaluateComplianceRe-evaluate the compliance state of resources and then remediate the resources found to be non-compliant.
    ResourceDiscoveryModeExistingNonCompliant
    ExistingNonCompliantRemediate resources that are already known to be non-compliant.
    ResourceDiscoveryModeReEvaluateCompliance
    ReEvaluateComplianceRe-evaluate the compliance state of resources and then remediate the resources found to be non-compliant.
    ExistingNonCompliant
    ExistingNonCompliantRemediate resources that are already known to be non-compliant.
    ReEvaluateCompliance
    ReEvaluateComplianceRe-evaluate the compliance state of resources and then remediate the resources found to be non-compliant.
    ExistingNonCompliant
    ExistingNonCompliantRemediate resources that are already known to be non-compliant.
    ReEvaluateCompliance
    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.
    "ExistingNonCompliant"
    ExistingNonCompliantRemediate resources that are already known to be non-compliant.
    "ReEvaluateCompliance"
    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:RemediationAtSubscription storageRemediation /subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/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
    azure-native-v1 logo
    These are the docs for Azure Native v1. We recommenend using the latest version, Azure Native v2.
    Azure Native v1 v1.104.0 published on Thursday, Jul 6, 2023 by Pulumi