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

com.pulumi.azure.monitoring.kotlin.ActionRuleSuppressionArgs.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 6.14.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azure.monitoring.kotlin

import com.pulumi.azure.monitoring.ActionRuleSuppressionArgs.builder
import com.pulumi.azure.monitoring.kotlin.inputs.ActionRuleSuppressionConditionArgs
import com.pulumi.azure.monitoring.kotlin.inputs.ActionRuleSuppressionConditionArgsBuilder
import com.pulumi.azure.monitoring.kotlin.inputs.ActionRuleSuppressionScopeArgs
import com.pulumi.azure.monitoring.kotlin.inputs.ActionRuleSuppressionScopeArgsBuilder
import com.pulumi.azure.monitoring.kotlin.inputs.ActionRuleSuppressionSuppressionArgs
import com.pulumi.azure.monitoring.kotlin.inputs.ActionRuleSuppressionSuppressionArgsBuilder
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.Boolean
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * Manages a Monitor Action Rule which type is suppression.
 * !> **NOTE:** This resource has been deprecated in version 5.0 of the provider and will be removed in version 6.0. Please use `azure.monitoring.AlertProcessingRuleSuppression` resource instead.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "example-resources",
 *     location: "West Europe",
 * });
 * const exampleActionRuleSuppression = new azure.monitoring.ActionRuleSuppression("example", {
 *     name: "example-amar",
 *     resourceGroupName: example.name,
 *     scope: {
 *         type: "ResourceGroup",
 *         resourceIds: [example.id],
 *     },
 *     suppression: {
 *         recurrenceType: "Weekly",
 *         schedule: {
 *             startDateUtc: "2019-01-01T01:02:03Z",
 *             endDateUtc: "2019-01-03T15:02:07Z",
 *             recurrenceWeeklies: [
 *                 "Sunday",
 *                 "Monday",
 *                 "Friday",
 *                 "Saturday",
 *             ],
 *         },
 *     },
 *     tags: {
 *         foo: "bar",
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * example = azure.core.ResourceGroup("example",
 *     name="example-resources",
 *     location="West Europe")
 * example_action_rule_suppression = azure.monitoring.ActionRuleSuppression("example",
 *     name="example-amar",
 *     resource_group_name=example.name,
 *     scope=azure.monitoring.ActionRuleSuppressionScopeArgs(
 *         type="ResourceGroup",
 *         resource_ids=[example.id],
 *     ),
 *     suppression=azure.monitoring.ActionRuleSuppressionSuppressionArgs(
 *         recurrence_type="Weekly",
 *         schedule=azure.monitoring.ActionRuleSuppressionSuppressionScheduleArgs(
 *             start_date_utc="2019-01-01T01:02:03Z",
 *             end_date_utc="2019-01-03T15:02:07Z",
 *             recurrence_weeklies=[
 *                 "Sunday",
 *                 "Monday",
 *                 "Friday",
 *                 "Saturday",
 *             ],
 *         ),
 *     ),
 *     tags={
 *         "foo": "bar",
 *     })
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Azure = Pulumi.Azure;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new Azure.Core.ResourceGroup("example", new()
 *     {
 *         Name = "example-resources",
 *         Location = "West Europe",
 *     });
 *     var exampleActionRuleSuppression = new Azure.Monitoring.ActionRuleSuppression("example", new()
 *     {
 *         Name = "example-amar",
 *         ResourceGroupName = example.Name,
 *         Scope = new Azure.Monitoring.Inputs.ActionRuleSuppressionScopeArgs
 *         {
 *             Type = "ResourceGroup",
 *             ResourceIds = new[]
 *             {
 *                 example.Id,
 *             },
 *         },
 *         Suppression = new Azure.Monitoring.Inputs.ActionRuleSuppressionSuppressionArgs
 *         {
 *             RecurrenceType = "Weekly",
 *             Schedule = new Azure.Monitoring.Inputs.ActionRuleSuppressionSuppressionScheduleArgs
 *             {
 *                 StartDateUtc = "2019-01-01T01:02:03Z",
 *                 EndDateUtc = "2019-01-03T15:02:07Z",
 *                 RecurrenceWeeklies = new[]
 *                 {
 *                     "Sunday",
 *                     "Monday",
 *                     "Friday",
 *                     "Saturday",
 *                 },
 *             },
 *         },
 *         Tags =
 *         {
 *             { "foo", "bar" },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/monitoring"
 * 	"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("example-resources"),
 * 			Location: pulumi.String("West Europe"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = monitoring.NewActionRuleSuppression(ctx, "example", &monitoring.ActionRuleSuppressionArgs{
 * 			Name:              pulumi.String("example-amar"),
 * 			ResourceGroupName: example.Name,
 * 			Scope: &monitoring.ActionRuleSuppressionScopeArgs{
 * 				Type: pulumi.String("ResourceGroup"),
 * 				ResourceIds: pulumi.StringArray{
 * 					example.ID(),
 * 				},
 * 			},
 * 			Suppression: &monitoring.ActionRuleSuppressionSuppressionArgs{
 * 				RecurrenceType: pulumi.String("Weekly"),
 * 				Schedule: &monitoring.ActionRuleSuppressionSuppressionScheduleArgs{
 * 					StartDateUtc: pulumi.String("2019-01-01T01:02:03Z"),
 * 					EndDateUtc:   pulumi.String("2019-01-03T15:02:07Z"),
 * 					RecurrenceWeeklies: pulumi.StringArray{
 * 						pulumi.String("Sunday"),
 * 						pulumi.String("Monday"),
 * 						pulumi.String("Friday"),
 * 						pulumi.String("Saturday"),
 * 					},
 * 				},
 * 			},
 * 			Tags: pulumi.StringMap{
 * 				"foo": pulumi.String("bar"),
 * 			},
 * 		})
 * 		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.azure.core.ResourceGroup;
 * import com.pulumi.azure.core.ResourceGroupArgs;
 * import com.pulumi.azure.monitoring.ActionRuleSuppression;
 * import com.pulumi.azure.monitoring.ActionRuleSuppressionArgs;
 * import com.pulumi.azure.monitoring.inputs.ActionRuleSuppressionScopeArgs;
 * import com.pulumi.azure.monitoring.inputs.ActionRuleSuppressionSuppressionArgs;
 * import com.pulumi.azure.monitoring.inputs.ActionRuleSuppressionSuppressionScheduleArgs;
 * 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("example-resources")
 *             .location("West Europe")
 *             .build());
 *         var exampleActionRuleSuppression = new ActionRuleSuppression("exampleActionRuleSuppression", ActionRuleSuppressionArgs.builder()
 *             .name("example-amar")
 *             .resourceGroupName(example.name())
 *             .scope(ActionRuleSuppressionScopeArgs.builder()
 *                 .type("ResourceGroup")
 *                 .resourceIds(example.id())
 *                 .build())
 *             .suppression(ActionRuleSuppressionSuppressionArgs.builder()
 *                 .recurrenceType("Weekly")
 *                 .schedule(ActionRuleSuppressionSuppressionScheduleArgs.builder()
 *                     .startDateUtc("2019-01-01T01:02:03Z")
 *                     .endDateUtc("2019-01-03T15:02:07Z")
 *                     .recurrenceWeeklies(
 *                         "Sunday",
 *                         "Monday",
 *                         "Friday",
 *                         "Saturday")
 *                     .build())
 *                 .build())
 *             .tags(Map.of("foo", "bar"))
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: example-resources
 *       location: West Europe
 *   exampleActionRuleSuppression:
 *     type: azure:monitoring:ActionRuleSuppression
 *     name: example
 *     properties:
 *       name: example-amar
 *       resourceGroupName: ${example.name}
 *       scope:
 *         type: ResourceGroup
 *         resourceIds:
 *           - ${example.id}
 *       suppression:
 *         recurrenceType: Weekly
 *         schedule:
 *           startDateUtc: 2019-01-01T01:02:03Z
 *           endDateUtc: 2019-01-03T15:02:07Z
 *           recurrenceWeeklies:
 *             - Sunday
 *             - Monday
 *             - Friday
 *             - Saturday
 *       tags:
 *         foo: bar
 * ```
 * 
 * ## Import
 * Monitor Action Rule can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:monitoring/actionRuleSuppression:ActionRuleSuppression example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AlertsManagement/actionRules/actionRule1
 * ```
 * @property condition A `condition` block as defined below.
 * @property description Specifies a description for the Action Rule.
 * @property enabled Is the Action Rule enabled? Defaults to `true`.
 * @property name Specifies the name of the Monitor Action Rule. Changing this forces a new resource to be created.
 * @property resourceGroupName Specifies the name of the resource group in which the Monitor Action Rule should exist. Changing this forces a new resource to be created.
 * @property scope A `scope` block as defined below.
 * @property suppression A `suppression` block as defined below.
 * @property tags A mapping of tags to assign to the resource.
 */
public data class ActionRuleSuppressionArgs(
    public val condition: Output? = null,
    public val description: Output? = null,
    public val enabled: Output? = null,
    public val name: Output? = null,
    public val resourceGroupName: Output? = null,
    public val scope: Output? = null,
    public val suppression: Output? = null,
    public val tags: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.monitoring.ActionRuleSuppressionArgs =
        com.pulumi.azure.monitoring.ActionRuleSuppressionArgs.builder()
            .condition(condition?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .description(description?.applyValue({ args0 -> args0 }))
            .enabled(enabled?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
            .scope(scope?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .suppression(suppression?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .tags(
                tags?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.key.to(args0.value)
                    }).toMap()
                }),
            ).build()
}

/**
 * Builder for [ActionRuleSuppressionArgs].
 */
@PulumiTagMarker
public class ActionRuleSuppressionArgsBuilder internal constructor() {
    private var condition: Output? = null

    private var description: Output? = null

    private var enabled: Output? = null

    private var name: Output? = null

    private var resourceGroupName: Output? = null

    private var scope: Output? = null

    private var suppression: Output? = null

    private var tags: Output>? = null

    /**
     * @param value A `condition` block as defined below.
     */
    @JvmName("jytfjvonoipammdp")
    public suspend fun condition(`value`: Output) {
        this.condition = value
    }

    /**
     * @param value Specifies a description for the Action Rule.
     */
    @JvmName("gaoxrrjybmlmsups")
    public suspend fun description(`value`: Output) {
        this.description = value
    }

    /**
     * @param value Is the Action Rule enabled? Defaults to `true`.
     */
    @JvmName("wwpabjtfwojjqrbd")
    public suspend fun enabled(`value`: Output) {
        this.enabled = value
    }

    /**
     * @param value Specifies the name of the Monitor Action Rule. Changing this forces a new resource to be created.
     */
    @JvmName("lxiikiiwbrgdodqq")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value Specifies the name of the resource group in which the Monitor Action Rule should exist. Changing this forces a new resource to be created.
     */
    @JvmName("qsejgnfhudmmulix")
    public suspend fun resourceGroupName(`value`: Output) {
        this.resourceGroupName = value
    }

    /**
     * @param value A `scope` block as defined below.
     */
    @JvmName("jjfbwwiuipmrllaf")
    public suspend fun scope(`value`: Output) {
        this.scope = value
    }

    /**
     * @param value A `suppression` block as defined below.
     */
    @JvmName("yfjgikoroqhjirlh")
    public suspend fun suppression(`value`: Output) {
        this.suppression = value
    }

    /**
     * @param value A mapping of tags to assign to the resource.
     */
    @JvmName("iwqymwsjhxlmtgdp")
    public suspend fun tags(`value`: Output>) {
        this.tags = value
    }

    /**
     * @param value A `condition` block as defined below.
     */
    @JvmName("biifapfehjqyengg")
    public suspend fun condition(`value`: ActionRuleSuppressionConditionArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.condition = mapped
    }

    /**
     * @param argument A `condition` block as defined below.
     */
    @JvmName("pvlifiovohyovdnj")
    public suspend
    fun condition(argument: suspend ActionRuleSuppressionConditionArgsBuilder.() -> Unit) {
        val toBeMapped = ActionRuleSuppressionConditionArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.condition = mapped
    }

    /**
     * @param value Specifies a description for the Action Rule.
     */
    @JvmName("aoewjifnfqpivmjv")
    public suspend fun description(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.description = mapped
    }

    /**
     * @param value Is the Action Rule enabled? Defaults to `true`.
     */
    @JvmName("yuniimtcmklkvwun")
    public suspend fun enabled(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.enabled = mapped
    }

    /**
     * @param value Specifies the name of the Monitor Action Rule. Changing this forces a new resource to be created.
     */
    @JvmName("mjqhiixthrxegddp")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value Specifies the name of the resource group in which the Monitor Action Rule should exist. Changing this forces a new resource to be created.
     */
    @JvmName("xgwewunfpextuxes")
    public suspend fun resourceGroupName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resourceGroupName = mapped
    }

    /**
     * @param value A `scope` block as defined below.
     */
    @JvmName("vhxiaornvrvggadc")
    public suspend fun scope(`value`: ActionRuleSuppressionScopeArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.scope = mapped
    }

    /**
     * @param argument A `scope` block as defined below.
     */
    @JvmName("mwcqyclueytramwp")
    public suspend fun scope(argument: suspend ActionRuleSuppressionScopeArgsBuilder.() -> Unit) {
        val toBeMapped = ActionRuleSuppressionScopeArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.scope = mapped
    }

    /**
     * @param value A `suppression` block as defined below.
     */
    @JvmName("wsvfiidhrfnlqokt")
    public suspend fun suppression(`value`: ActionRuleSuppressionSuppressionArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.suppression = mapped
    }

    /**
     * @param argument A `suppression` block as defined below.
     */
    @JvmName("xjpwnbqtoltpypki")
    public suspend
    fun suppression(argument: suspend ActionRuleSuppressionSuppressionArgsBuilder.() -> Unit) {
        val toBeMapped = ActionRuleSuppressionSuppressionArgsBuilder().applySuspend {
            argument()
        }.build()
        val mapped = of(toBeMapped)
        this.suppression = mapped
    }

    /**
     * @param value A mapping of tags to assign to the resource.
     */
    @JvmName("dbtlryfpelbgwuhr")
    public suspend fun tags(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param values A mapping of tags to assign to the resource.
     */
    @JvmName("tllplrjniakrkmna")
    public fun tags(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    internal fun build(): ActionRuleSuppressionArgs = ActionRuleSuppressionArgs(
        condition = condition,
        description = description,
        enabled = enabled,
        name = name,
        resourceGroupName = resourceGroupName,
        scope = scope,
        suppression = suppression,
        tags = tags,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy