azure logo
Azure Classic v5.43.0, May 6 23

azure.costmanagement.AnomalyAlert

Explore with Pulumi AI

Manages a Cost Anomaly Alert.

Example Usage

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()
    {
        DisplayName = "Alert DisplayName",
        EmailAddresses = new[]
        {
            "example@test.net",
        },
        EmailSubject = "My Test Anomaly Alert",
    });

});
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{
			DisplayName: pulumi.String("Alert DisplayName"),
			EmailAddresses: pulumi.StringArray{
				pulumi.String("example@test.net"),
			},
			EmailSubject: pulumi.String("My Test Anomaly Alert"),
		})
		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()        
            .displayName("Alert DisplayName")
            .emailAddresses("example@test.net")
            .emailSubject("My Test Anomaly Alert")
            .build());

    }
}
import pulumi
import pulumi_azure as azure

example = azure.costmanagement.AnomalyAlert("example",
    display_name="Alert DisplayName",
    email_addresses=["example@test.net"],
    email_subject="My Test Anomaly Alert")
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const example = new azure.costmanagement.AnomalyAlert("example", {
    displayName: "Alert DisplayName",
    emailAddresses: ["example@test.net"],
    emailSubject: "My Test Anomaly Alert",
});
resources:
  example:
    type: azure:costmanagement:AnomalyAlert
    properties:
      displayName: Alert DisplayName
      emailAddresses:
        - example@test.net
      emailSubject: My Test Anomaly Alert

Create AnomalyAlert Resource

new AnomalyAlert(name: string, args: AnomalyAlertArgs, opts?: CustomResourceOptions);
@overload
def AnomalyAlert(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 display_name: Optional[str] = None,
                 email_addresses: Optional[Sequence[str]] = None,
                 email_subject: Optional[str] = None,
                 message: Optional[str] = None,
                 name: Optional[str] = None)
@overload
def AnomalyAlert(resource_name: str,
                 args: AnomalyAlertArgs,
                 opts: Optional[ResourceOptions] = None)
func NewAnomalyAlert(ctx *Context, name string, args AnomalyAlertArgs, opts ...ResourceOption) (*AnomalyAlert, error)
public AnomalyAlert(string name, AnomalyAlertArgs args, CustomResourceOptions? opts = null)
public AnomalyAlert(String name, AnomalyAlertArgs args)
public AnomalyAlert(String name, AnomalyAlertArgs args, CustomResourceOptions options)
type: azure:costmanagement:AnomalyAlert
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args AnomalyAlertArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args AnomalyAlertArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args AnomalyAlertArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args AnomalyAlertArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args AnomalyAlertArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

AnomalyAlert Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The AnomalyAlert resource accepts the following input properties:

DisplayName string

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

EmailAddresses List<string>

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

EmailSubject string

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

Message string

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

Name string

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.

DisplayName string

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

EmailAddresses []string

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

EmailSubject string

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

Message string

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

Name string

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.

displayName String

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

emailAddresses List<String>

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

emailSubject String

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

message String

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

name String

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.

displayName string

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

emailAddresses string[]

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

emailSubject string

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

message string

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

name string

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.

display_name str

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

email_addresses Sequence[str]

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

email_subject str

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

message str

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

name str

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.

displayName String

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

emailAddresses List<String>

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

emailSubject String

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

message String

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

name String

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.

Outputs

All input properties are implicitly available as output properties. Additionally, the AnomalyAlert resource produces the following output properties:

Id string

The provider-assigned unique ID for this managed resource.

Id string

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

id string

The provider-assigned unique ID for this managed resource.

id str

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

Look up Existing AnomalyAlert Resource

Get an existing AnomalyAlert resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: AnomalyAlertState, opts?: CustomResourceOptions): AnomalyAlert
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        display_name: Optional[str] = None,
        email_addresses: Optional[Sequence[str]] = None,
        email_subject: Optional[str] = None,
        message: Optional[str] = None,
        name: Optional[str] = None) -> AnomalyAlert
func GetAnomalyAlert(ctx *Context, name string, id IDInput, state *AnomalyAlertState, opts ...ResourceOption) (*AnomalyAlert, error)
public static AnomalyAlert Get(string name, Input<string> id, AnomalyAlertState? state, CustomResourceOptions? opts = null)
public static AnomalyAlert get(String name, Output<String> id, AnomalyAlertState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
DisplayName string

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

EmailAddresses List<string>

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

EmailSubject string

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

Message string

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

Name string

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.

DisplayName string

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

EmailAddresses []string

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

EmailSubject string

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

Message string

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

Name string

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.

displayName String

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

emailAddresses List<String>

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

emailSubject String

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

message String

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

name String

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.

displayName string

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

emailAddresses string[]

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

emailSubject string

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

message string

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

name string

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.

display_name str

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

email_addresses Sequence[str]

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

email_subject str

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

message str

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

name str

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.

displayName String

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

emailAddresses List<String>

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

emailSubject String

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

message String

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

name String

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.

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

Package Details

Repository
Azure Classic pulumi/pulumi-azure
License
Apache-2.0
Notes

This Pulumi package is based on the azurerm Terraform Provider.