All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.azurenative.policyinsights.kotlin.RemediationAtResourceGroupArgs.kt Maven / Gradle / Ivy

@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azurenative.policyinsights.kotlin

import com.pulumi.azurenative.policyinsights.RemediationAtResourceGroupArgs.builder
import com.pulumi.azurenative.policyinsights.kotlin.enums.ResourceDiscoveryMode
import com.pulumi.azurenative.policyinsights.kotlin.inputs.RemediationFiltersArgs
import com.pulumi.azurenative.policyinsights.kotlin.inputs.RemediationFiltersArgsBuilder
import com.pulumi.azurenative.policyinsights.kotlin.inputs.RemediationPropertiesFailureThresholdArgs
import com.pulumi.azurenative.policyinsights.kotlin.inputs.RemediationPropertiesFailureThresholdArgsBuilder
import com.pulumi.core.Either
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.jvm.JvmName

/**
 * The remediation definition.
 * Azure REST API version: 2021-10-01. Prior API version in Azure Native 1.x: 2019-07-01.
 * Other available API versions: 2018-07-01-preview.
 * ## Example Usage
 * ### Create remediation at resource group scope
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using AzureNative = Pulumi.AzureNative;
 * return await Deployment.RunAsync(() =>
 * {
 *     var remediationAtResourceGroup = new AzureNative.PolicyInsights.RemediationAtResourceGroup("remediationAtResourceGroup", new()
 *     {
 *         PolicyAssignmentId = "/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourceGroups/myResourceGroup/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5",
 *         RemediationName = "storageRemediation",
 *         ResourceGroupName = "myResourceGroup",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	policyinsights "github.com/pulumi/pulumi-azure-native-sdk/policyinsights/v2"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := policyinsights.NewRemediationAtResourceGroup(ctx, "remediationAtResourceGroup", &policyinsights.RemediationAtResourceGroupArgs{
 * 			PolicyAssignmentId: pulumi.String("/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourceGroups/myResourceGroup/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5"),
 * 			RemediationName:    pulumi.String("storageRemediation"),
 * 			ResourceGroupName:  pulumi.String("myResourceGroup"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		return nil
 * 	})
 * }
 * ```
 * ```java
 * package generated_program;
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.azurenative.policyinsights.RemediationAtResourceGroup;
 * import com.pulumi.azurenative.policyinsights.RemediationAtResourceGroupArgs;
 * 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 remediationAtResourceGroup = new RemediationAtResourceGroup("remediationAtResourceGroup", RemediationAtResourceGroupArgs.builder()
 *             .policyAssignmentId("/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourceGroups/myResourceGroup/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5")
 *             .remediationName("storageRemediation")
 *             .resourceGroupName("myResourceGroup")
 *             .build());
 *     }
 * }
 * ```
 * ## Import
 * An existing resource can be imported using its type token, name, and identifier, e.g.
 * ```sh
 * $ pulumi import azure-native:policyinsights:RemediationAtResourceGroup storageRemediation /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/remediations/{remediationName}
 * ```
 * @property failureThreshold The remediation failure threshold settings
 * @property filters The filters that will be applied to determine which resources to remediate.
 * @property parallelDeployments 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.
 * @property policyAssignmentId The resource ID of the policy assignment that should be remediated.
 * @property policyDefinitionReferenceId 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.
 * @property remediationName The name of the remediation.
 * @property resourceCount Determines the max number of resources that can be remediated by the remediation job. If not provided, the default resource count is used.
 * @property resourceDiscoveryMode The way resources to remediate are discovered. Defaults to ExistingNonCompliant if not specified.
 * @property resourceGroupName Resource group name.
 */
public data class RemediationAtResourceGroupArgs(
    public val failureThreshold: Output? = null,
    public val filters: Output? = null,
    public val parallelDeployments: Output? = null,
    public val policyAssignmentId: Output? = null,
    public val policyDefinitionReferenceId: Output? = null,
    public val remediationName: Output? = null,
    public val resourceCount: Output? = null,
    public val resourceDiscoveryMode: Output>? = null,
    public val resourceGroupName: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azurenative.policyinsights.RemediationAtResourceGroupArgs =
        com.pulumi.azurenative.policyinsights.RemediationAtResourceGroupArgs.builder()
            .failureThreshold(failureThreshold?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .filters(filters?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .parallelDeployments(parallelDeployments?.applyValue({ args0 -> args0 }))
            .policyAssignmentId(policyAssignmentId?.applyValue({ args0 -> args0 }))
            .policyDefinitionReferenceId(policyDefinitionReferenceId?.applyValue({ args0 -> args0 }))
            .remediationName(remediationName?.applyValue({ args0 -> args0 }))
            .resourceCount(resourceCount?.applyValue({ args0 -> args0 }))
            .resourceDiscoveryMode(
                resourceDiscoveryMode?.applyValue({ args0 ->
                    args0.transform({ args0 ->
                        args0
                    }, { args0 -> args0.let({ args0 -> args0.toJava() }) })
                }),
            )
            .resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [RemediationAtResourceGroupArgs].
 */
@PulumiTagMarker
public class RemediationAtResourceGroupArgsBuilder internal constructor() {
    private var failureThreshold: Output? = null

    private var filters: Output? = null

    private var parallelDeployments: Output? = null

    private var policyAssignmentId: Output? = null

    private var policyDefinitionReferenceId: Output? = null

    private var remediationName: Output? = null

    private var resourceCount: Output? = null

    private var resourceDiscoveryMode: Output>? = null

    private var resourceGroupName: Output? = null

    /**
     * @param value The remediation failure threshold settings
     */
    @JvmName("dgemrqwburxmbbpb")
    public suspend fun failureThreshold(`value`: Output) {
        this.failureThreshold = value
    }

    /**
     * @param value The filters that will be applied to determine which resources to remediate.
     */
    @JvmName("lglvlkjbnsixwssi")
    public suspend fun filters(`value`: Output) {
        this.filters = value
    }

    /**
     * @param value 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.
     */
    @JvmName("emmkdrnrmcvgykyc")
    public suspend fun parallelDeployments(`value`: Output) {
        this.parallelDeployments = value
    }

    /**
     * @param value The resource ID of the policy assignment that should be remediated.
     */
    @JvmName("seurxbwieutjxcle")
    public suspend fun policyAssignmentId(`value`: Output) {
        this.policyAssignmentId = value
    }

    /**
     * @param value 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.
     */
    @JvmName("areehnjjvwgupcba")
    public suspend fun policyDefinitionReferenceId(`value`: Output) {
        this.policyDefinitionReferenceId = value
    }

    /**
     * @param value The name of the remediation.
     */
    @JvmName("iouyswybdqxciypc")
    public suspend fun remediationName(`value`: Output) {
        this.remediationName = value
    }

    /**
     * @param value Determines the max number of resources that can be remediated by the remediation job. If not provided, the default resource count is used.
     */
    @JvmName("olcqcvuneuhdmtsm")
    public suspend fun resourceCount(`value`: Output) {
        this.resourceCount = value
    }

    /**
     * @param value The way resources to remediate are discovered. Defaults to ExistingNonCompliant if not specified.
     */
    @JvmName("wletilsjxqhbofcj")
    public suspend fun resourceDiscoveryMode(`value`: Output>) {
        this.resourceDiscoveryMode = value
    }

    /**
     * @param value Resource group name.
     */
    @JvmName("xxhqkqiixkjmrpbf")
    public suspend fun resourceGroupName(`value`: Output) {
        this.resourceGroupName = value
    }

    /**
     * @param value The remediation failure threshold settings
     */
    @JvmName("anlcqpxekheseixa")
    public suspend fun failureThreshold(`value`: RemediationPropertiesFailureThresholdArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.failureThreshold = mapped
    }

    /**
     * @param argument The remediation failure threshold settings
     */
    @JvmName("wggprxxullunfjlx")
    public suspend fun failureThreshold(argument: suspend RemediationPropertiesFailureThresholdArgsBuilder.() -> Unit) {
        val toBeMapped = RemediationPropertiesFailureThresholdArgsBuilder().applySuspend {
            argument()
        }.build()
        val mapped = of(toBeMapped)
        this.failureThreshold = mapped
    }

    /**
     * @param value The filters that will be applied to determine which resources to remediate.
     */
    @JvmName("lrrrpmtrkscbudpg")
    public suspend fun filters(`value`: RemediationFiltersArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.filters = mapped
    }

    /**
     * @param argument The filters that will be applied to determine which resources to remediate.
     */
    @JvmName("eehhcdgdgnvglwdd")
    public suspend fun filters(argument: suspend RemediationFiltersArgsBuilder.() -> Unit) {
        val toBeMapped = RemediationFiltersArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.filters = mapped
    }

    /**
     * @param value 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.
     */
    @JvmName("aourlanqibswqlla")
    public suspend fun parallelDeployments(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.parallelDeployments = mapped
    }

    /**
     * @param value The resource ID of the policy assignment that should be remediated.
     */
    @JvmName("cxxytpbqduydjuxx")
    public suspend fun policyAssignmentId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.policyAssignmentId = mapped
    }

    /**
     * @param value 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.
     */
    @JvmName("mmpuopdqqfpablhy")
    public suspend fun policyDefinitionReferenceId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.policyDefinitionReferenceId = mapped
    }

    /**
     * @param value The name of the remediation.
     */
    @JvmName("boayptaboyuyuluc")
    public suspend fun remediationName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.remediationName = mapped
    }

    /**
     * @param value Determines the max number of resources that can be remediated by the remediation job. If not provided, the default resource count is used.
     */
    @JvmName("kbxwlklgidrkfkud")
    public suspend fun resourceCount(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resourceCount = mapped
    }

    /**
     * @param value The way resources to remediate are discovered. Defaults to ExistingNonCompliant if not specified.
     */
    @JvmName("svgytsaxbpkfejva")
    public suspend fun resourceDiscoveryMode(`value`: Either?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resourceDiscoveryMode = mapped
    }

    /**
     * @param value The way resources to remediate are discovered. Defaults to ExistingNonCompliant if not specified.
     */
    @JvmName("vkwgpygmiifhirxu")
    public fun resourceDiscoveryMode(`value`: String) {
        val toBeMapped = Either.ofLeft(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.resourceDiscoveryMode = mapped
    }

    /**
     * @param value The way resources to remediate are discovered. Defaults to ExistingNonCompliant if not specified.
     */
    @JvmName("aqnjrqwqdommnqdt")
    public fun resourceDiscoveryMode(`value`: ResourceDiscoveryMode) {
        val toBeMapped = Either.ofRight(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.resourceDiscoveryMode = mapped
    }

    /**
     * @param value Resource group name.
     */
    @JvmName("qgmapfiqvgykthtf")
    public suspend fun resourceGroupName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resourceGroupName = mapped
    }

    internal fun build(): RemediationAtResourceGroupArgs = RemediationAtResourceGroupArgs(
        failureThreshold = failureThreshold,
        filters = filters,
        parallelDeployments = parallelDeployments,
        policyAssignmentId = policyAssignmentId,
        policyDefinitionReferenceId = policyDefinitionReferenceId,
        remediationName = remediationName,
        resourceCount = resourceCount,
        resourceDiscoveryMode = resourceDiscoveryMode,
        resourceGroupName = resourceGroupName,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy