MetricAlert
Manages a Metric Alert within Azure Monitor.
Create a MetricAlert Resource
new MetricAlert(name: string, args: MetricAlertArgs, opts?: CustomResourceOptions);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<Metric
Alert Criteria Args> One or more
criteriablocks as defined below.- Resource
Group stringName 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<Metric
Alert Action Args> One or more
actionblocks as defined below.- Auto
Mitigate 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,PT30MandPT1H. Defaults toPT1M.- 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,3and4. Defaults to3.- Dictionary<string, string>
A mapping of tags to assign to the resource.
- Window
Size 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 arePT1M,PT5M,PT15M,PT30M,PT1H,PT6H,PT12HandP1D. Defaults toPT5M.
- Criterias
[]Metric
Alert Criteria One or more
criteriablocks as defined below.- Resource
Group stringName 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
[]Metric
Alert Action One or more
actionblocks as defined below.- Auto
Mitigate 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,PT30MandPT1H. Defaults toPT1M.- 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,3and4. Defaults to3.- map[string]string
A mapping of tags to assign to the resource.
- Window
Size 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 arePT1M,PT5M,PT15M,PT30M,PT1H,PT6H,PT12HandP1D. Defaults toPT5M.
- criterias
Metric
Alert Criteria[] One or more
criteriablocks as defined below.- resource
Group stringName 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
Metric
Alert Action[] One or more
actionblocks as defined below.- auto
Mitigate 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,PT30MandPT1H. Defaults toPT1M.- 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,3and4. Defaults to3.- {[key: string]: string}
A mapping of tags to assign to the resource.
- window
Size 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 arePT1M,PT5M,PT15M,PT30M,PT1H,PT6H,PT12HandP1D. Defaults toPT5M.
- criterias
List[Metric
Alert Criteria] One or more
criteriablocks as defined below.- resource_
group_ strname 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[Metric
Alert Action] One or more
actionblocks 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,PT30MandPT1H. Defaults toPT1M.- 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,3and4. Defaults to3.- 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 arePT1M,PT5M,PT15M,PT30M,PT1H,PT6H,PT12HandP1D. Defaults toPT5M.
Outputs
All input properties are implicitly available as output properties. Additionally, the MetricAlert resource produces the following output properties:
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): MetricAlertstatic 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<Metric
Alert Action Args> One or more
actionblocks as defined below.- Auto
Mitigate bool Should the alerts in this Metric Alert be auto resolved? Defaults to
true.- Criterias
List<Metric
Alert Criteria Args> One or more
criteriablocks 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,PT30MandPT1H. Defaults toPT1M.- Name string
The name of the Metric Alert. Changing this forces a new resource to be created.
- Resource
Group stringName 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,3and4. Defaults to3.- Dictionary<string, string>
A mapping of tags to assign to the resource.
- Window
Size 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 arePT1M,PT5M,PT15M,PT30M,PT1H,PT6H,PT12HandP1D. Defaults toPT5M.
- Actions
[]Metric
Alert Action One or more
actionblocks as defined below.- Auto
Mitigate bool Should the alerts in this Metric Alert be auto resolved? Defaults to
true.- Criterias
[]Metric
Alert Criteria One or more
criteriablocks 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,PT30MandPT1H. Defaults toPT1M.- Name string
The name of the Metric Alert. Changing this forces a new resource to be created.
- Resource
Group stringName 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,3and4. Defaults to3.- map[string]string
A mapping of tags to assign to the resource.
- Window
Size 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 arePT1M,PT5M,PT15M,PT30M,PT1H,PT6H,PT12HandP1D. Defaults toPT5M.
- actions
Metric
Alert Action[] One or more
actionblocks as defined below.- auto
Mitigate boolean Should the alerts in this Metric Alert be auto resolved? Defaults to
true.- criterias
Metric
Alert Criteria[] One or more
criteriablocks 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,PT30MandPT1H. Defaults toPT1M.- name string
The name of the Metric Alert. Changing this forces a new resource to be created.
- resource
Group stringName 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,3and4. Defaults to3.- {[key: string]: string}
A mapping of tags to assign to the resource.
- window
Size 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 arePT1M,PT5M,PT15M,PT30M,PT1H,PT6H,PT12HandP1D. Defaults toPT5M.
- actions
List[Metric
Alert Action] One or more
actionblocks as defined below.- auto_
mitigate bool Should the alerts in this Metric Alert be auto resolved? Defaults to
true.- criterias
List[Metric
Alert Criteria] One or more
criteriablocks 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,PT30MandPT1H. Defaults toPT1M.- name str
The name of the Metric Alert. Changing this forces a new resource to be created.
- resource_
group_ strname 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,3and4. Defaults to3.- 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 arePT1M,PT5M,PT15M,PT30M,PT1H,PT6H,PT12HandP1D. Defaults toPT5M.
Supporting Types
MetricAlertAction
- Action
Group stringId The ID of the Action Group can be sourced from the
azure.monitoring.ActionGroupresource- Webhook
Properties Dictionary<string, string> The map of custom string properties to include with the post operation. These data are appended to the webhook payload.
- Action
Group stringId The ID of the Action Group can be sourced from the
azure.monitoring.ActionGroupresource- Webhook
Properties map[string]string The map of custom string properties to include with the post operation. These data are appended to the webhook payload.
- action
Group stringId The ID of the Action Group can be sourced from the
azure.monitoring.ActionGroupresource- webhook
Properties {[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_ strid The ID of the Action Group can be sourced from the
azure.monitoring.ActionGroupresource- webhook
Properties Dict[str, str] The map of custom string properties to include with the post operation. These data are appended to the webhook payload.
MetricAlertCriteria
- Aggregation string
The statistic that runs over the metric values. Possible values are
Average,Count,Minimum,MaximumandTotal.- Metric
Name string One of the metric names to be monitored.
- Metric
Namespace string One of the metric namespaces to be monitored.
- Operator string
The criteria operator. Possible values are
Equals,NotEquals,GreaterThan,GreaterThanOrEqual,LessThanandLessThanOrEqual.- Threshold double
The criteria threshold value that activates the alert.
- Dimensions
List<Metric
Alert Criteria Dimension Args> One or more
dimensionblocks as defined below.
- Aggregation string
The statistic that runs over the metric values. Possible values are
Average,Count,Minimum,MaximumandTotal.- Metric
Name string One of the metric names to be monitored.
- Metric
Namespace string One of the metric namespaces to be monitored.
- Operator string
The criteria operator. Possible values are
Equals,NotEquals,GreaterThan,GreaterThanOrEqual,LessThanandLessThanOrEqual.- Threshold float64
The criteria threshold value that activates the alert.
- Dimensions
[]Metric
Alert Criteria Dimension One or more
dimensionblocks as defined below.
- aggregation string
The statistic that runs over the metric values. Possible values are
Average,Count,Minimum,MaximumandTotal.- metric
Name string One of the metric names to be monitored.
- metric
Namespace string One of the metric namespaces to be monitored.
- operator string
The criteria operator. Possible values are
Equals,NotEquals,GreaterThan,GreaterThanOrEqual,LessThanandLessThanOrEqual.- threshold number
The criteria threshold value that activates the alert.
- dimensions
Metric
Alert Criteria Dimension[] One or more
dimensionblocks as defined below.
- aggregation str
The statistic that runs over the metric values. Possible values are
Average,Count,Minimum,MaximumandTotal.- metric
Name str One of the metric names to be monitored.
- metric
Namespace str One of the metric namespaces to be monitored.
- operator str
The criteria operator. Possible values are
Equals,NotEquals,GreaterThan,GreaterThanOrEqual,LessThanandLessThanOrEqual.- threshold float
The criteria threshold value that activates the alert.
- dimensions
List[Metric
Alert Criteria Dimension] One or more
dimensionblocks as defined below.
MetricAlertCriteriaDimension
Package Details
- Repository
- https://github.com/pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
azurermTerraform Provider.