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

com.pulumi.azure.monitoring.kotlin.ActionRuleActionGroupArgs.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.15.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azure.monitoring.kotlin

import com.pulumi.azure.monitoring.ActionRuleActionGroupArgs.builder
import com.pulumi.azure.monitoring.kotlin.inputs.ActionRuleActionGroupConditionArgs
import com.pulumi.azure.monitoring.kotlin.inputs.ActionRuleActionGroupConditionArgsBuilder
import com.pulumi.azure.monitoring.kotlin.inputs.ActionRuleActionGroupScopeArgs
import com.pulumi.azure.monitoring.kotlin.inputs.ActionRuleActionGroupScopeArgsBuilder
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 action group.
 * !> **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.AlertProcessingRuleActionGroup` 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 exampleActionGroup = new azure.monitoring.ActionGroup("example", {
 *     name: "example-action-group",
 *     resourceGroupName: example.name,
 *     shortName: "example",
 * });
 * const exampleActionRuleActionGroup = new azure.monitoring.ActionRuleActionGroup("example", {
 *     name: "example-amar",
 *     resourceGroupName: example.name,
 *     actionGroupId: exampleActionGroup.id,
 *     scope: {
 *         type: "ResourceGroup",
 *         resourceIds: [example.id],
 *     },
 *     tags: {
 *         foo: "bar",
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * example = azure.core.ResourceGroup("example",
 *     name="example-resources",
 *     location="West Europe")
 * example_action_group = azure.monitoring.ActionGroup("example",
 *     name="example-action-group",
 *     resource_group_name=example.name,
 *     short_name="example")
 * example_action_rule_action_group = azure.monitoring.ActionRuleActionGroup("example",
 *     name="example-amar",
 *     resource_group_name=example.name,
 *     action_group_id=example_action_group.id,
 *     scope=azure.monitoring.ActionRuleActionGroupScopeArgs(
 *         type="ResourceGroup",
 *         resource_ids=[example.id],
 *     ),
 *     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 exampleActionGroup = new Azure.Monitoring.ActionGroup("example", new()
 *     {
 *         Name = "example-action-group",
 *         ResourceGroupName = example.Name,
 *         ShortName = "example",
 *     });
 *     var exampleActionRuleActionGroup = new Azure.Monitoring.ActionRuleActionGroup("example", new()
 *     {
 *         Name = "example-amar",
 *         ResourceGroupName = example.Name,
 *         ActionGroupId = exampleActionGroup.Id,
 *         Scope = new Azure.Monitoring.Inputs.ActionRuleActionGroupScopeArgs
 *         {
 *             Type = "ResourceGroup",
 *             ResourceIds = new[]
 *             {
 *                 example.Id,
 *             },
 *         },
 *         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
 * 		}
 * 		exampleActionGroup, err := monitoring.NewActionGroup(ctx, "example", &monitoring.ActionGroupArgs{
 * 			Name:              pulumi.String("example-action-group"),
 * 			ResourceGroupName: example.Name,
 * 			ShortName:         pulumi.String("example"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = monitoring.NewActionRuleActionGroup(ctx, "example", &monitoring.ActionRuleActionGroupArgs{
 * 			Name:              pulumi.String("example-amar"),
 * 			ResourceGroupName: example.Name,
 * 			ActionGroupId:     exampleActionGroup.ID(),
 * 			Scope: &monitoring.ActionRuleActionGroupScopeArgs{
 * 				Type: pulumi.String("ResourceGroup"),
 * 				ResourceIds: pulumi.StringArray{
 * 					example.ID(),
 * 				},
 * 			},
 * 			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.ActionGroup;
 * import com.pulumi.azure.monitoring.ActionGroupArgs;
 * import com.pulumi.azure.monitoring.ActionRuleActionGroup;
 * import com.pulumi.azure.monitoring.ActionRuleActionGroupArgs;
 * import com.pulumi.azure.monitoring.inputs.ActionRuleActionGroupScopeArgs;
 * 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 exampleActionGroup = new ActionGroup("exampleActionGroup", ActionGroupArgs.builder()
 *             .name("example-action-group")
 *             .resourceGroupName(example.name())
 *             .shortName("example")
 *             .build());
 *         var exampleActionRuleActionGroup = new ActionRuleActionGroup("exampleActionRuleActionGroup", ActionRuleActionGroupArgs.builder()
 *             .name("example-amar")
 *             .resourceGroupName(example.name())
 *             .actionGroupId(exampleActionGroup.id())
 *             .scope(ActionRuleActionGroupScopeArgs.builder()
 *                 .type("ResourceGroup")
 *                 .resourceIds(example.id())
 *                 .build())
 *             .tags(Map.of("foo", "bar"))
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: example-resources
 *       location: West Europe
 *   exampleActionGroup:
 *     type: azure:monitoring:ActionGroup
 *     name: example
 *     properties:
 *       name: example-action-group
 *       resourceGroupName: ${example.name}
 *       shortName: example
 *   exampleActionRuleActionGroup:
 *     type: azure:monitoring:ActionRuleActionGroup
 *     name: example
 *     properties:
 *       name: example-amar
 *       resourceGroupName: ${example.name}
 *       actionGroupId: ${exampleActionGroup.id}
 *       scope:
 *         type: ResourceGroup
 *         resourceIds:
 *           - ${example.id}
 *       tags:
 *         foo: bar
 * ```
 * 
 * ## Import
 * Monitor Action Rule can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:monitoring/actionRuleActionGroup:ActionRuleActionGroup example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AlertsManagement/actionRules/actionRule1
 * ```
 * @property actionGroupId Specifies the resource id of monitor action group.
 * @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 tags A mapping of tags to assign to the resource.
 */
public data class ActionRuleActionGroupArgs(
    public val actionGroupId: Output? = null,
    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 tags: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.monitoring.ActionRuleActionGroupArgs =
        com.pulumi.azure.monitoring.ActionRuleActionGroupArgs.builder()
            .actionGroupId(actionGroupId?.applyValue({ args0 -> args0 }))
            .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() }) }))
            .tags(
                tags?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.key.to(args0.value)
                    }).toMap()
                }),
            ).build()
}

/**
 * Builder for [ActionRuleActionGroupArgs].
 */
@PulumiTagMarker
public class ActionRuleActionGroupArgsBuilder internal constructor() {
    private var actionGroupId: Output? = null

    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 tags: Output>? = null

    /**
     * @param value Specifies the resource id of monitor action group.
     */
    @JvmName("aqiovihqrukswair")
    public suspend fun actionGroupId(`value`: Output) {
        this.actionGroupId = value
    }

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

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

    /**
     * @param value Is the Action Rule enabled? Defaults to `true`.
     */
    @JvmName("ygosqqhebdkdyhiy")
    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("bccoqpyordctregg")
    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("sgtaoauklbeichid")
    public suspend fun resourceGroupName(`value`: Output) {
        this.resourceGroupName = value
    }

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

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

    /**
     * @param value Specifies the resource id of monitor action group.
     */
    @JvmName("cimmaviefgpcelgy")
    public suspend fun actionGroupId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.actionGroupId = mapped
    }

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

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

    /**
     * @param value Specifies a description for the Action Rule.
     */
    @JvmName("rfiuumjgpxqtackx")
    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("evfcuvehmakhbxkr")
    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("nkmonbtiwbsgwlkn")
    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("ywrgtqqwhwdjeroq")
    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("takuimuluousfwho")
    public suspend fun scope(`value`: ActionRuleActionGroupScopeArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.scope = mapped
    }

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

    /**
     * @param value A mapping of tags to assign to the resource.
     */
    @JvmName("crvsvrtxhsxjacup")
    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("audvnqbydsbdsoav")
    public fun tags(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.tags = mapped
    }

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy