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

com.pulumi.azure.costmanagement.kotlin.AnomalyAlertArgs.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.costmanagement.kotlin

import com.pulumi.azure.costmanagement.AnomalyAlertArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.String
import kotlin.Suppress
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * Manages a Cost Anomaly Alert.
 * > **Note:** Anomaly alerts are sent based on the current access of the rule creator at the time that the email is sent. Learn more [here](https://learn.microsoft.com/en-us/azure/cost-management-billing/understand/analyze-unexpected-charges#create-an-anomaly-alert).
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * const example = new azure.costmanagement.AnomalyAlert("example", {
 *     name: "alertname",
 *     displayName: "Alert DisplayName",
 *     subscriptionId: "/subscriptions/00000000-0000-0000-0000-000000000000",
 *     emailSubject: "My Test Anomaly Alert",
 *     emailAddresses: ["example@test.net"],
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * example = azure.costmanagement.AnomalyAlert("example",
 *     name="alertname",
 *     display_name="Alert DisplayName",
 *     subscription_id="/subscriptions/00000000-0000-0000-0000-000000000000",
 *     email_subject="My Test Anomaly Alert",
 *     email_addresses=["example@test.net"])
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Azure = Pulumi.Azure;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new Azure.CostManagement.AnomalyAlert("example", new()
 *     {
 *         Name = "alertname",
 *         DisplayName = "Alert DisplayName",
 *         SubscriptionId = "/subscriptions/00000000-0000-0000-0000-000000000000",
 *         EmailSubject = "My Test Anomaly Alert",
 *         EmailAddresses = new[]
 *         {
 *             "[email protected]",
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/costmanagement"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := costmanagement.NewAnomalyAlert(ctx, "example", &costmanagement.AnomalyAlertArgs{
 * 			Name:           pulumi.String("alertname"),
 * 			DisplayName:    pulumi.String("Alert DisplayName"),
 * 			SubscriptionId: pulumi.String("/subscriptions/00000000-0000-0000-0000-000000000000"),
 * 			EmailSubject:   pulumi.String("My Test Anomaly Alert"),
 * 			EmailAddresses: pulumi.StringArray{
 * 				pulumi.String("[email protected]"),
 * 			},
 * 		})
 * 		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.costmanagement.AnomalyAlert;
 * import com.pulumi.azure.costmanagement.AnomalyAlertArgs;
 * 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 AnomalyAlert("example", AnomalyAlertArgs.builder()
 *             .name("alertname")
 *             .displayName("Alert DisplayName")
 *             .subscriptionId("/subscriptions/00000000-0000-0000-0000-000000000000")
 *             .emailSubject("My Test Anomaly Alert")
 *             .emailAddresses("[email protected]")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:costmanagement:AnomalyAlert
 *     properties:
 *       name: alertname
 *       displayName: Alert DisplayName
 *       subscriptionId: /subscriptions/00000000-0000-0000-0000-000000000000
 *       emailSubject: My Test Anomaly Alert
 *       emailAddresses:
 *         - [email protected]
 * ```
 * 
 * ## Import
 * Cost Anomaly Alerts can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:costmanagement/anomalyAlert:AnomalyAlert example /subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/scheduledActions/dailyanomalybyresourcegroup
 * ```
 * @property displayName The display name which should be used for this Cost Anomaly Alert.
 * @property emailAddresses Specifies a list of email addresses which the Anomaly Alerts are send to.
 * @property emailSubject The email subject of the Cost Anomaly Alerts. Maximum length of the subject is 70.
 * @property message The message of the Cost Anomaly Alert. Maximum length of the message is 250.
 * @property name The name which should be used for this Cost Anomaly Alert. Changing this forces a new resource to be created. The name can contain only lowercase letters, numbers and hyphens.
 * @property subscriptionId The ID of the Subscription this Cost Anomaly Alert is scoped to. Changing this forces a new resource to be created. When not supplied this defaults to the subscription configured in the provider.
 */
public data class AnomalyAlertArgs(
    public val displayName: Output? = null,
    public val emailAddresses: Output>? = null,
    public val emailSubject: Output? = null,
    public val message: Output? = null,
    public val name: Output? = null,
    public val subscriptionId: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.costmanagement.AnomalyAlertArgs =
        com.pulumi.azure.costmanagement.AnomalyAlertArgs.builder()
            .displayName(displayName?.applyValue({ args0 -> args0 }))
            .emailAddresses(emailAddresses?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .emailSubject(emailSubject?.applyValue({ args0 -> args0 }))
            .message(message?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .subscriptionId(subscriptionId?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [AnomalyAlertArgs].
 */
@PulumiTagMarker
public class AnomalyAlertArgsBuilder internal constructor() {
    private var displayName: Output? = null

    private var emailAddresses: Output>? = null

    private var emailSubject: Output? = null

    private var message: Output? = null

    private var name: Output? = null

    private var subscriptionId: Output? = null

    /**
     * @param value The display name which should be used for this Cost Anomaly Alert.
     */
    @JvmName("lbrtvbxgtmdbqwvr")
    public suspend fun displayName(`value`: Output) {
        this.displayName = value
    }

    /**
     * @param value Specifies a list of email addresses which the Anomaly Alerts are send to.
     */
    @JvmName("xkwhegeipbatwamr")
    public suspend fun emailAddresses(`value`: Output>) {
        this.emailAddresses = value
    }

    @JvmName("fevxibdqxqxxxeax")
    public suspend fun emailAddresses(vararg values: Output) {
        this.emailAddresses = Output.all(values.asList())
    }

    /**
     * @param values Specifies a list of email addresses which the Anomaly Alerts are send to.
     */
    @JvmName("wpgiovbraygblsim")
    public suspend fun emailAddresses(values: List>) {
        this.emailAddresses = Output.all(values)
    }

    /**
     * @param value The email subject of the Cost Anomaly Alerts. Maximum length of the subject is 70.
     */
    @JvmName("futqnebcaagupfid")
    public suspend fun emailSubject(`value`: Output) {
        this.emailSubject = value
    }

    /**
     * @param value The message of the Cost Anomaly Alert. Maximum length of the message is 250.
     */
    @JvmName("sqboaqwgtlfalpqq")
    public suspend fun message(`value`: Output) {
        this.message = value
    }

    /**
     * @param value The name which should be used for this Cost Anomaly Alert. Changing this forces a new resource to be created. The name can contain only lowercase letters, numbers and hyphens.
     */
    @JvmName("jpovutbfmrdghich")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value The ID of the Subscription this Cost Anomaly Alert is scoped to. Changing this forces a new resource to be created. When not supplied this defaults to the subscription configured in the provider.
     */
    @JvmName("wysqputexpsyrltx")
    public suspend fun subscriptionId(`value`: Output) {
        this.subscriptionId = value
    }

    /**
     * @param value The display name which should be used for this Cost Anomaly Alert.
     */
    @JvmName("wsombevkhgkblnko")
    public suspend fun displayName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.displayName = mapped
    }

    /**
     * @param value Specifies a list of email addresses which the Anomaly Alerts are send to.
     */
    @JvmName("ooyajqcghutktyxg")
    public suspend fun emailAddresses(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.emailAddresses = mapped
    }

    /**
     * @param values Specifies a list of email addresses which the Anomaly Alerts are send to.
     */
    @JvmName("iyqoctgpadlchgma")
    public suspend fun emailAddresses(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.emailAddresses = mapped
    }

    /**
     * @param value The email subject of the Cost Anomaly Alerts. Maximum length of the subject is 70.
     */
    @JvmName("iaqmxeectudtjbwn")
    public suspend fun emailSubject(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.emailSubject = mapped
    }

    /**
     * @param value The message of the Cost Anomaly Alert. Maximum length of the message is 250.
     */
    @JvmName("oxyapwqlpsvmrhaq")
    public suspend fun message(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.message = mapped
    }

    /**
     * @param value The name which should be used for this Cost Anomaly Alert. Changing this forces a new resource to be created. The name can contain only lowercase letters, numbers and hyphens.
     */
    @JvmName("mkdjvjfpmyiorffk")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value The ID of the Subscription this Cost Anomaly Alert is scoped to. Changing this forces a new resource to be created. When not supplied this defaults to the subscription configured in the provider.
     */
    @JvmName("muiurpbfnyinkqhr")
    public suspend fun subscriptionId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.subscriptionId = mapped
    }

    internal fun build(): AnomalyAlertArgs = AnomalyAlertArgs(
        displayName = displayName,
        emailAddresses = emailAddresses,
        emailSubject = emailSubject,
        message = message,
        name = name,
        subscriptionId = subscriptionId,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy