Anomaly Alert
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.net"],
});
Content copied to clipboard
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"])
Content copied to clipboard
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",
},
});
});
Content copied to clipboard
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
})
}
Content copied to clipboard
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());
}
}
Content copied to clipboard
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
Content copied to clipboard
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
Content copied to clipboard
Properties
Link copied to clipboard
The display name which should be used for this Cost Anomaly Alert.
Link copied to clipboard
Specifies a list of email addresses which the Anomaly Alerts are send to.
Link copied to clipboard
The email subject of the Cost Anomaly Alerts. Maximum length of the subject is 70.
Link copied to clipboard
The email address of the point of contact that should get the unsubscribe requests and notification emails.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
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.