MetricAlert

Manages a Metric Alert within Azure Monitor.

Create a MetricAlert Resource

def MetricAlert(resource_name, opts=None, actions=None, auto_mitigate=None, criterias=None, description=None, enabled=None, frequency=None, name=None, resource_group_name=None, scopes=None, severity=None, tags=None, window_size=None, __props__=None);
func NewMetricAlert(ctx *Context, name string, args MetricAlertArgs, opts ...ResourceOption) (*MetricAlert, error)
public MetricAlert(string name, MetricAlertArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args MetricAlertArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args MetricAlertArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args MetricAlertArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

MetricAlert Resource Properties

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

Inputs

The MetricAlert resource accepts the following input properties:

Criterias List<MetricAlertCriteriaArgs>

One or more criteria blocks as defined below.

ResourceGroupName string

The name of the resource group in which to create the Metric Alert instance.

Scopes string

A set of strings of resource IDs at which the metric criteria should be applied.

Actions List<MetricAlertActionArgs>

One or more action blocks as defined below.

AutoMitigate bool

Should the alerts in this Metric Alert be auto resolved? Defaults to true.

Description string

The description of this Metric Alert.

Enabled bool

Should this Metric Alert be enabled? Defaults to true.

Frequency string

The evaluation frequency of this Metric Alert, represented in ISO 8601 duration format. Possible values are PT1M, PT5M, PT15M, PT30M and PT1H. Defaults to PT1M.

Name string

The name of the Metric Alert. Changing this forces a new resource to be created.

Severity int

The severity of this Metric Alert. Possible values are 0, 1, 2, 3 and 4. Defaults to 3.

Tags Dictionary<string, string>

A mapping of tags to assign to the resource.

WindowSize string

The period of time that is used to monitor alert activity, represented in ISO 8601 duration format. This value must be greater than frequency. Possible values are PT1M, PT5M, PT15M, PT30M, PT1H, PT6H, PT12H and P1D. Defaults to PT5M.

Criterias []MetricAlertCriteria

One or more criteria blocks as defined below.

ResourceGroupName string

The name of the resource group in which to create the Metric Alert instance.

Scopes string

A set of strings of resource IDs at which the metric criteria should be applied.

Actions []MetricAlertAction

One or more action blocks as defined below.

AutoMitigate bool

Should the alerts in this Metric Alert be auto resolved? Defaults to true.

Description string

The description of this Metric Alert.

Enabled bool

Should this Metric Alert be enabled? Defaults to true.

Frequency string

The evaluation frequency of this Metric Alert, represented in ISO 8601 duration format. Possible values are PT1M, PT5M, PT15M, PT30M and PT1H. Defaults to PT1M.

Name string

The name of the Metric Alert. Changing this forces a new resource to be created.

Severity int

The severity of this Metric Alert. Possible values are 0, 1, 2, 3 and 4. Defaults to 3.

Tags map[string]string

A mapping of tags to assign to the resource.

WindowSize string

The period of time that is used to monitor alert activity, represented in ISO 8601 duration format. This value must be greater than frequency. Possible values are PT1M, PT5M, PT15M, PT30M, PT1H, PT6H, PT12H and P1D. Defaults to PT5M.

criterias MetricAlertCriteria[]

One or more criteria blocks as defined below.

resourceGroupName string

The name of the resource group in which to create the Metric Alert instance.

scopes string

A set of strings of resource IDs at which the metric criteria should be applied.

actions MetricAlertAction[]

One or more action blocks as defined below.

autoMitigate boolean

Should the alerts in this Metric Alert be auto resolved? Defaults to true.

description string

The description of this Metric Alert.

enabled boolean

Should this Metric Alert be enabled? Defaults to true.

frequency string

The evaluation frequency of this Metric Alert, represented in ISO 8601 duration format. Possible values are PT1M, PT5M, PT15M, PT30M and PT1H. Defaults to PT1M.

name string

The name of the Metric Alert. Changing this forces a new resource to be created.

severity number

The severity of this Metric Alert. Possible values are 0, 1, 2, 3 and 4. Defaults to 3.

tags {[key: string]: string}

A mapping of tags to assign to the resource.

windowSize string

The period of time that is used to monitor alert activity, represented in ISO 8601 duration format. This value must be greater than frequency. Possible values are PT1M, PT5M, PT15M, PT30M, PT1H, PT6H, PT12H and P1D. Defaults to PT5M.

criterias List[MetricAlertCriteria]

One or more criteria blocks as defined below.

resource_group_name str

The name of the resource group in which to create the Metric Alert instance.

scopes str

A set of strings of resource IDs at which the metric criteria should be applied.

actions List[MetricAlertAction]

One or more action blocks as defined below.

auto_mitigate bool

Should the alerts in this Metric Alert be auto resolved? Defaults to true.

description str

The description of this Metric Alert.

enabled bool

Should this Metric Alert be enabled? Defaults to true.

frequency str

The evaluation frequency of this Metric Alert, represented in ISO 8601 duration format. Possible values are PT1M, PT5M, PT15M, PT30M and PT1H. Defaults to PT1M.

name str

The name of the Metric Alert. Changing this forces a new resource to be created.

severity float

The severity of this Metric Alert. Possible values are 0, 1, 2, 3 and 4. Defaults to 3.

tags Dict[str, str]

A mapping of tags to assign to the resource.

window_size str

The period of time that is used to monitor alert activity, represented in ISO 8601 duration format. This value must be greater than frequency. Possible values are PT1M, PT5M, PT15M, PT30M, PT1H, PT6H, PT12H and P1D. Defaults to PT5M.

Outputs

All input properties are implicitly available as output properties. Additionally, the MetricAlert 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 str
The provider-assigned unique ID for this managed resource.

Look up an Existing MetricAlert Resource

Get an existing MetricAlert 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?: MetricAlertState, opts?: CustomResourceOptions): MetricAlert
static get(resource_name, id, opts=None, actions=None, auto_mitigate=None, criterias=None, description=None, enabled=None, frequency=None, name=None, resource_group_name=None, scopes=None, severity=None, tags=None, window_size=None, __props__=None);
func GetMetricAlert(ctx *Context, name string, id IDInput, state *MetricAlertState, opts ...ResourceOption) (*MetricAlert, error)
public static MetricAlert Get(string name, Input<string> id, MetricAlertState? state, CustomResourceOptions? opts = null)
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.

The following state arguments are supported:

Actions List<MetricAlertActionArgs>

One or more action blocks as defined below.

AutoMitigate bool

Should the alerts in this Metric Alert be auto resolved? Defaults to true.

Criterias List<MetricAlertCriteriaArgs>

One or more criteria blocks as defined below.

Description string

The description of this Metric Alert.

Enabled bool

Should this Metric Alert be enabled? Defaults to true.

Frequency string

The evaluation frequency of this Metric Alert, represented in ISO 8601 duration format. Possible values are PT1M, PT5M, PT15M, PT30M and PT1H. Defaults to PT1M.

Name string

The name of the Metric Alert. Changing this forces a new resource to be created.

ResourceGroupName string

The name of the resource group in which to create the Metric Alert instance.

Scopes string

A set of strings of resource IDs at which the metric criteria should be applied.

Severity int

The severity of this Metric Alert. Possible values are 0, 1, 2, 3 and 4. Defaults to 3.

Tags Dictionary<string, string>

A mapping of tags to assign to the resource.

WindowSize string

The period of time that is used to monitor alert activity, represented in ISO 8601 duration format. This value must be greater than frequency. Possible values are PT1M, PT5M, PT15M, PT30M, PT1H, PT6H, PT12H and P1D. Defaults to PT5M.

Actions []MetricAlertAction

One or more action blocks as defined below.

AutoMitigate bool

Should the alerts in this Metric Alert be auto resolved? Defaults to true.

Criterias []MetricAlertCriteria

One or more criteria blocks as defined below.

Description string

The description of this Metric Alert.

Enabled bool

Should this Metric Alert be enabled? Defaults to true.

Frequency string

The evaluation frequency of this Metric Alert, represented in ISO 8601 duration format. Possible values are PT1M, PT5M, PT15M, PT30M and PT1H. Defaults to PT1M.

Name string

The name of the Metric Alert. Changing this forces a new resource to be created.

ResourceGroupName string

The name of the resource group in which to create the Metric Alert instance.

Scopes string

A set of strings of resource IDs at which the metric criteria should be applied.

Severity int

The severity of this Metric Alert. Possible values are 0, 1, 2, 3 and 4. Defaults to 3.

Tags map[string]string

A mapping of tags to assign to the resource.

WindowSize string

The period of time that is used to monitor alert activity, represented in ISO 8601 duration format. This value must be greater than frequency. Possible values are PT1M, PT5M, PT15M, PT30M, PT1H, PT6H, PT12H and P1D. Defaults to PT5M.

actions MetricAlertAction[]

One or more action blocks as defined below.

autoMitigate boolean

Should the alerts in this Metric Alert be auto resolved? Defaults to true.

criterias MetricAlertCriteria[]

One or more criteria blocks as defined below.

description string

The description of this Metric Alert.

enabled boolean

Should this Metric Alert be enabled? Defaults to true.

frequency string

The evaluation frequency of this Metric Alert, represented in ISO 8601 duration format. Possible values are PT1M, PT5M, PT15M, PT30M and PT1H. Defaults to PT1M.

name string

The name of the Metric Alert. Changing this forces a new resource to be created.

resourceGroupName string

The name of the resource group in which to create the Metric Alert instance.

scopes string

A set of strings of resource IDs at which the metric criteria should be applied.

severity number

The severity of this Metric Alert. Possible values are 0, 1, 2, 3 and 4. Defaults to 3.

tags {[key: string]: string}

A mapping of tags to assign to the resource.

windowSize string

The period of time that is used to monitor alert activity, represented in ISO 8601 duration format. This value must be greater than frequency. Possible values are PT1M, PT5M, PT15M, PT30M, PT1H, PT6H, PT12H and P1D. Defaults to PT5M.

actions List[MetricAlertAction]

One or more action blocks as defined below.

auto_mitigate bool

Should the alerts in this Metric Alert be auto resolved? Defaults to true.

criterias List[MetricAlertCriteria]

One or more criteria blocks as defined below.

description str

The description of this Metric Alert.

enabled bool

Should this Metric Alert be enabled? Defaults to true.

frequency str

The evaluation frequency of this Metric Alert, represented in ISO 8601 duration format. Possible values are PT1M, PT5M, PT15M, PT30M and PT1H. Defaults to PT1M.

name str

The name of the Metric Alert. Changing this forces a new resource to be created.

resource_group_name str

The name of the resource group in which to create the Metric Alert instance.

scopes str

A set of strings of resource IDs at which the metric criteria should be applied.

severity float

The severity of this Metric Alert. Possible values are 0, 1, 2, 3 and 4. Defaults to 3.

tags Dict[str, str]

A mapping of tags to assign to the resource.

window_size str

The period of time that is used to monitor alert activity, represented in ISO 8601 duration format. This value must be greater than frequency. Possible values are PT1M, PT5M, PT15M, PT30M, PT1H, PT6H, PT12H and P1D. Defaults to PT5M.

Supporting Types

MetricAlertAction

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

ActionGroupId string

The ID of the Action Group can be sourced from the azure.monitoring.ActionGroup resource

WebhookProperties Dictionary<string, string>

The map of custom string properties to include with the post operation. These data are appended to the webhook payload.

ActionGroupId string

The ID of the Action Group can be sourced from the azure.monitoring.ActionGroup resource

WebhookProperties map[string]string

The map of custom string properties to include with the post operation. These data are appended to the webhook payload.

actionGroupId string

The ID of the Action Group can be sourced from the azure.monitoring.ActionGroup resource

webhookProperties {[key: string]: string}

The map of custom string properties to include with the post operation. These data are appended to the webhook payload.

action_group_id str

The ID of the Action Group can be sourced from the azure.monitoring.ActionGroup resource

webhookProperties Dict[str, str]

The map of custom string properties to include with the post operation. These data are appended to the webhook payload.

MetricAlertCriteria

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

Aggregation string

The statistic that runs over the metric values. Possible values are Average, Count, Minimum, Maximum and Total.

MetricName string

One of the metric names to be monitored.

MetricNamespace string

One of the metric namespaces to be monitored.

Operator string

The criteria operator. Possible values are Equals, NotEquals, GreaterThan, GreaterThanOrEqual, LessThan and LessThanOrEqual.

Threshold double

The criteria threshold value that activates the alert.

Dimensions List<MetricAlertCriteriaDimensionArgs>

One or more dimension blocks as defined below.

Aggregation string

The statistic that runs over the metric values. Possible values are Average, Count, Minimum, Maximum and Total.

MetricName string

One of the metric names to be monitored.

MetricNamespace string

One of the metric namespaces to be monitored.

Operator string

The criteria operator. Possible values are Equals, NotEquals, GreaterThan, GreaterThanOrEqual, LessThan and LessThanOrEqual.

Threshold float64

The criteria threshold value that activates the alert.

Dimensions []MetricAlertCriteriaDimension

One or more dimension blocks as defined below.

aggregation string

The statistic that runs over the metric values. Possible values are Average, Count, Minimum, Maximum and Total.

metricName string

One of the metric names to be monitored.

metricNamespace string

One of the metric namespaces to be monitored.

operator string

The criteria operator. Possible values are Equals, NotEquals, GreaterThan, GreaterThanOrEqual, LessThan and LessThanOrEqual.

threshold number

The criteria threshold value that activates the alert.

dimensions MetricAlertCriteriaDimension[]

One or more dimension blocks as defined below.

aggregation str

The statistic that runs over the metric values. Possible values are Average, Count, Minimum, Maximum and Total.

metricName str

One of the metric names to be monitored.

metricNamespace str

One of the metric namespaces to be monitored.

operator str

The criteria operator. Possible values are Equals, NotEquals, GreaterThan, GreaterThanOrEqual, LessThan and LessThanOrEqual.

threshold float

The criteria threshold value that activates the alert.

dimensions List[MetricAlertCriteriaDimension]

One or more dimension blocks as defined below.

MetricAlertCriteriaDimension

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

Name string

One of the dimension names.

Operator string

The dimension operator. Possible values are Include and Exclude.

Values List<string>

The list of dimension values.

Name string

One of the dimension names.

Operator string

The dimension operator. Possible values are Include and Exclude.

Values []string

The list of dimension values.

name string

One of the dimension names.

operator string

The dimension operator. Possible values are Include and Exclude.

values string[]

The list of dimension values.

name str

One of the dimension names.

operator str

The dimension operator. Possible values are Include and Exclude.

values List[str]

The list of dimension values.

Package Details

Repository
https://github.com/pulumi/pulumi-azure
License
Apache-2.0
Notes
This Pulumi package is based on the azurerm Terraform Provider.