AnomalyAlertArgs

data class AnomalyAlertArgs(val displayName: Output<String>? = null, val emailAddresses: Output<List<String>>? = null, val emailSubject: Output<String>? = null, val message: Output<String>? = null, val name: Output<String>? = null, val notificationEmail: Output<String>? = null, val subscriptionId: Output<String>? = null) : ConvertibleToJava<AnomalyAlertArgs>

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.

Example Usage

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&#46;net"],
});
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&#46;net"])
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[]
{
"example@test.net",
},
});
});
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v6/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("example@test.net"),
},
})
if err != nil {
return err
}
return nil
})
}
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("example@test.net")
.build());
}
}
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:
- example@test.net

Import

Cost Anomaly Alerts can be imported using the resource id, e.g.

$ pulumi import azure:costmanagement/anomalyAlert:AnomalyAlert example /subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/scheduledActions/dailyanomalybyresourcegroup

Constructors

Link copied to clipboard
constructor(displayName: Output<String>? = null, emailAddresses: Output<List<String>>? = null, emailSubject: Output<String>? = null, message: Output<String>? = null, name: Output<String>? = null, notificationEmail: Output<String>? = null, subscriptionId: Output<String>? = null)

Properties

Link copied to clipboard
val displayName: Output<String>? = null

The display name which should be used for this Cost Anomaly Alert.

Link copied to clipboard
val emailAddresses: Output<List<String>>? = null

Specifies a list of email addresses which the Anomaly Alerts are send to.

Link copied to clipboard
val emailSubject: Output<String>? = null

The email subject of the Cost Anomaly Alerts. Maximum length of the subject is 70.

Link copied to clipboard
val message: Output<String>? = null

The message of the Cost Anomaly Alert. Maximum length of the message is 250.

Link copied to clipboard
val name: Output<String>? = null

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.

Link copied to clipboard
val notificationEmail: Output<String>? = null

The email address of the point of contact that should get the unsubscribe requests and notification emails.

Link copied to clipboard
val subscriptionId: Output<String>? = null

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.

Functions

Link copied to clipboard
open override fun toJava(): AnomalyAlertArgs