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

com.pulumi.azurenative.alertsmanagement.kotlin.ActionRuleByNameArgs.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: 2.82.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azurenative.alertsmanagement.kotlin

import com.pulumi.azurenative.alertsmanagement.ActionRuleByNameArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Any
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * Action rule object containing target scope, conditions and suppression logic
 * Azure REST API version: 2019-05-05-preview. Prior API version in Azure Native 1.x: 2019-05-05-preview.
 * Other available API versions: 2018-11-02-privatepreview.
 * ## Example Usage
 * ### PutActionRule
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using AzureNative = Pulumi.AzureNative;
 * return await Deployment.RunAsync(() =>
 * {
 *     var actionRuleByName = new AzureNative.AlertsManagement.ActionRuleByName("actionRuleByName", new()
 *     {
 *         ActionRuleName = "DailySuppression",
 *         Location = "Global",
 *         Properties = new AzureNative.AlertsManagement.Inputs.SuppressionArgs
 *         {
 *             Conditions = new AzureNative.AlertsManagement.Inputs.ConditionsArgs
 *             {
 *                 MonitorCondition = new AzureNative.AlertsManagement.Inputs.ConditionArgs
 *                 {
 *                     Operator = AzureNative.AlertsManagement.Operator.EqualsValue,
 *                     Values = new[]
 *                     {
 *                         "Fired",
 *                     },
 *                 },
 *                 MonitorService = new AzureNative.AlertsManagement.Inputs.ConditionArgs
 *                 {
 *                     Operator = AzureNative.AlertsManagement.Operator.EqualsValue,
 *                     Values = new[]
 *                     {
 *                         "Platform",
 *                         "Application Insights",
 *                     },
 *                 },
 *                 Severity = new AzureNative.AlertsManagement.Inputs.ConditionArgs
 *                 {
 *                     Operator = AzureNative.AlertsManagement.Operator.EqualsValue,
 *                     Values = new[]
 *                     {
 *                         "Sev0",
 *                         "Sev2",
 *                     },
 *                 },
 *                 TargetResourceType = new AzureNative.AlertsManagement.Inputs.ConditionArgs
 *                 {
 *                     Operator = AzureNative.AlertsManagement.Operator.NotEquals,
 *                     Values = new[]
 *                     {
 *                         "Microsoft.Compute/VirtualMachines",
 *                     },
 *                 },
 *             },
 *             Description = "Action rule on resource group for daily suppression",
 *             Scope = new AzureNative.AlertsManagement.Inputs.ScopeArgs
 *             {
 *                 ScopeType = AzureNative.AlertsManagement.ScopeType.ResourceGroup,
 *                 Values = new[]
 *                 {
 *                     "/subscriptions/1e3ff1c0-771a-4119-a03b-be82a51e232d/resourceGroups/alertscorrelationrg",
 *                 },
 *             },
 *             Status = AzureNative.AlertsManagement.ActionRuleStatus.Enabled,
 *             SuppressionConfig = new AzureNative.AlertsManagement.Inputs.SuppressionConfigArgs
 *             {
 *                 RecurrenceType = AzureNative.AlertsManagement.SuppressionType.Daily,
 *                 Schedule = new AzureNative.AlertsManagement.Inputs.SuppressionScheduleArgs
 *                 {
 *                     EndDate = "12/18/2018",
 *                     EndTime = "14:00:00",
 *                     StartDate = "12/09/2018",
 *                     StartTime = "06:00:00",
 *                 },
 *             },
 *             Type = "Suppression",
 *         },
 *         ResourceGroupName = "alertscorrelationrg",
 *         Tags = null,
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	alertsmanagement "github.com/pulumi/pulumi-azure-native-sdk/alertsmanagement/v2"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := alertsmanagement.NewActionRuleByName(ctx, "actionRuleByName", &alertsmanagement.ActionRuleByNameArgs{
 * 			ActionRuleName: pulumi.String("DailySuppression"),
 * 			Location:       pulumi.String("Global"),
 * 			Properties: &alertsmanagement.SuppressionArgs{
 * 				Conditions: &alertsmanagement.ConditionsArgs{
 * 					MonitorCondition: &alertsmanagement.ConditionArgs{
 * 						Operator: pulumi.String(alertsmanagement.OperatorEquals),
 * 						Values: pulumi.StringArray{
 * 							pulumi.String("Fired"),
 * 						},
 * 					},
 * 					MonitorService: &alertsmanagement.ConditionArgs{
 * 						Operator: pulumi.String(alertsmanagement.OperatorEquals),
 * 						Values: pulumi.StringArray{
 * 							pulumi.String("Platform"),
 * 							pulumi.String("Application Insights"),
 * 						},
 * 					},
 * 					Severity: &alertsmanagement.ConditionArgs{
 * 						Operator: pulumi.String(alertsmanagement.OperatorEquals),
 * 						Values: pulumi.StringArray{
 * 							pulumi.String("Sev0"),
 * 							pulumi.String("Sev2"),
 * 						},
 * 					},
 * 					TargetResourceType: &alertsmanagement.ConditionArgs{
 * 						Operator: pulumi.String(alertsmanagement.OperatorNotEquals),
 * 						Values: pulumi.StringArray{
 * 							pulumi.String("Microsoft.Compute/VirtualMachines"),
 * 						},
 * 					},
 * 				},
 * 				Description: pulumi.String("Action rule on resource group for daily suppression"),
 * 				Scope: &alertsmanagement.ScopeArgs{
 * 					ScopeType: pulumi.String(alertsmanagement.ScopeTypeResourceGroup),
 * 					Values: pulumi.StringArray{
 * 						pulumi.String("/subscriptions/1e3ff1c0-771a-4119-a03b-be82a51e232d/resourceGroups/alertscorrelationrg"),
 * 					},
 * 				},
 * 				Status: pulumi.String(alertsmanagement.ActionRuleStatusEnabled),
 * 				SuppressionConfig: &alertsmanagement.SuppressionConfigArgs{
 * 					RecurrenceType: pulumi.String(alertsmanagement.SuppressionTypeDaily),
 * 					Schedule: &alertsmanagement.SuppressionScheduleArgs{
 * 						EndDate:   pulumi.String("12/18/2018"),
 * 						EndTime:   pulumi.String("14:00:00"),
 * 						StartDate: pulumi.String("12/09/2018"),
 * 						StartTime: pulumi.String("06:00:00"),
 * 					},
 * 				},
 * 				Type: pulumi.String("Suppression"),
 * 			},
 * 			ResourceGroupName: pulumi.String("alertscorrelationrg"),
 * 			Tags:              nil,
 * 		})
 * 		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.alertsmanagement.ActionRuleByName;
 * import com.pulumi.azurenative.alertsmanagement.ActionRuleByNameArgs;
 * 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 actionRuleByName = new ActionRuleByName("actionRuleByName", ActionRuleByNameArgs.builder()
 *             .actionRuleName("DailySuppression")
 *             .location("Global")
 *             .properties(SuppressionArgs.builder()
 *                 .conditions(ConditionsArgs.builder()
 *                     .monitorCondition(ConditionArgs.builder()
 *                         .operator("Equals")
 *                         .values("Fired")
 *                         .build())
 *                     .monitorService(ConditionArgs.builder()
 *                         .operator("Equals")
 *                         .values(
 *                             "Platform",
 *                             "Application Insights")
 *                         .build())
 *                     .severity(ConditionArgs.builder()
 *                         .operator("Equals")
 *                         .values(
 *                             "Sev0",
 *                             "Sev2")
 *                         .build())
 *                     .targetResourceType(ConditionArgs.builder()
 *                         .operator("NotEquals")
 *                         .values("Microsoft.Compute/VirtualMachines")
 *                         .build())
 *                     .build())
 *                 .description("Action rule on resource group for daily suppression")
 *                 .scope(ScopeArgs.builder()
 *                     .scopeType("ResourceGroup")
 *                     .values("/subscriptions/1e3ff1c0-771a-4119-a03b-be82a51e232d/resourceGroups/alertscorrelationrg")
 *                     .build())
 *                 .status("Enabled")
 *                 .suppressionConfig(SuppressionConfigArgs.builder()
 *                     .recurrenceType("Daily")
 *                     .schedule(SuppressionScheduleArgs.builder()
 *                         .endDate("12/18/2018")
 *                         .endTime("14:00:00")
 *                         .startDate("12/09/2018")
 *                         .startTime("06:00:00")
 *                         .build())
 *                     .build())
 *                 .type("Suppression")
 *                 .build())
 *             .resourceGroupName("alertscorrelationrg")
 *             .tags()
 *             .build());
 *     }
 * }
 * ```
 * ## Import
 * An existing resource can be imported using its type token, name, and identifier, e.g.
 * ```sh
 * $ pulumi import azure-native:alertsmanagement:ActionRuleByName DailySuppression /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AlertsManagement/actionRules/{actionRuleName}
 * ```
 * @property actionRuleName The name of action rule that needs to be created/updated
 * @property location Resource location
 * @property properties action rule properties
 * @property resourceGroupName Resource group name where the resource is created.
 * @property tags Resource tags
 */
public data class ActionRuleByNameArgs(
    public val actionRuleName: Output? = null,
    public val location: Output? = null,
    public val properties: Output? = null,
    public val resourceGroupName: Output? = null,
    public val tags: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azurenative.alertsmanagement.ActionRuleByNameArgs =
        com.pulumi.azurenative.alertsmanagement.ActionRuleByNameArgs.builder()
            .actionRuleName(actionRuleName?.applyValue({ args0 -> args0 }))
            .location(location?.applyValue({ args0 -> args0 }))
            .properties(properties?.applyValue({ args0 -> args0 }))
            .resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
            .tags(
                tags?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.key.to(args0.value)
                    }).toMap()
                }),
            ).build()
}

/**
 * Builder for [ActionRuleByNameArgs].
 */
@PulumiTagMarker
public class ActionRuleByNameArgsBuilder internal constructor() {
    private var actionRuleName: Output? = null

    private var location: Output? = null

    private var properties: Output? = null

    private var resourceGroupName: Output? = null

    private var tags: Output>? = null

    /**
     * @param value The name of action rule that needs to be created/updated
     */
    @JvmName("igxiilhxabjygkth")
    public suspend fun actionRuleName(`value`: Output) {
        this.actionRuleName = value
    }

    /**
     * @param value Resource location
     */
    @JvmName("omxgrpailnooftyv")
    public suspend fun location(`value`: Output) {
        this.location = value
    }

    /**
     * @param value action rule properties
     */
    @JvmName("ioqoihdfngcdalcb")
    public suspend fun properties(`value`: Output) {
        this.properties = value
    }

    /**
     * @param value Resource group name where the resource is created.
     */
    @JvmName("anwlwrsyqvosijlt")
    public suspend fun resourceGroupName(`value`: Output) {
        this.resourceGroupName = value
    }

    /**
     * @param value Resource tags
     */
    @JvmName("ovrcwbiwhfyypxai")
    public suspend fun tags(`value`: Output>) {
        this.tags = value
    }

    /**
     * @param value The name of action rule that needs to be created/updated
     */
    @JvmName("ljauivbiwibtljvk")
    public suspend fun actionRuleName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.actionRuleName = mapped
    }

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

    /**
     * @param value action rule properties
     */
    @JvmName("dnegkbilkwtdexhd")
    public suspend fun properties(`value`: Any?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.properties = mapped
    }

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

    /**
     * @param value Resource tags
     */
    @JvmName("nyxvrrutmhrcnlrc")
    public suspend fun tags(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param values Resource tags
     */
    @JvmName("wqrscfsfypfqylog")
    public fun tags(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    internal fun build(): ActionRuleByNameArgs = ActionRuleByNameArgs(
        actionRuleName = actionRuleName,
        location = location,
        properties = properties,
        resourceGroupName = resourceGroupName,
        tags = tags,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy