Alarm

This resource provides a alarm rule resource and it can be used to monitor several cloud services according different metrics. Details for alarm rule.

Create a Alarm Resource

new Alarm(name: string, args: AlarmArgs, opts?: CustomResourceOptions);
def Alarm(resource_name, opts=None, contact_groups=None, dimensions=None, effective_interval=None, enabled=None, end_time=None, metric=None, name=None, operator=None, period=None, project=None, silence_time=None, start_time=None, statistics=None, threshold=None, triggered_count=None, webhook=None, __props__=None);
func NewAlarm(ctx *Context, name string, args AlarmArgs, opts ...ResourceOption) (*Alarm, error)
public Alarm(string name, AlarmArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args AlarmArgs
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 AlarmArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args AlarmArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

Alarm Resource Properties

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

Inputs

The Alarm resource accepts the following input properties:

ContactGroups List<string>

List contact groups of the alarm rule, which must have been created on the console.

Dimensions Dictionary<string, object>

Map of the resources associated with the alarm rule, such as “instanceId”, “device” and “port”. Each key’s value is a string and it uses comma to split multiple items. For more information, see Metrics Reference.

Metric string

Name of the monitoring metrics corresponding to a project, such as “CPUUtilization” and “networkin_rate”. For more information, see Metrics Reference.

Project string

Monitor project name, such as “acs_ecs_dashboard” and “acs_rds_dashboard”. For more information, see Metrics Reference.

Threshold string

Alarm threshold value, which must be a numeric value currently.

EffectiveInterval string

The interval of effecting alarm rule. It foramt as “hh:mm-hh:mm”, like “0:00-4:00”. Default to “00:00-23:59”.

Enabled bool

Whether to enable alarm rule. Default to true.

EndTime int

It has been deprecated from provider version 1.50.0 and ‘effective_interval’ instead.

Deprecated: Field 'end_time' has been deprecated from provider version 1.50.0. New field 'effective_interval' instead.

Name string

The alarm rule name.

Operator string

Alarm comparison operator. Valid values: [”<=“, “<“, “>”, “>=”, “==”, “!=”]. Default to “==”.

Period int

Index query cycle, which must be consistent with that defined for metrics. Default to 300, in seconds.

SilenceTime int

Notification silence period in the alarm state, in seconds. Valid value range: [300, 86400]. Default to 86400

StartTime int

It has been deprecated from provider version 1.50.0 and ‘effective_interval’ instead.

Deprecated: Field 'start_time' has been deprecated from provider version 1.50.0. New field 'effective_interval' instead.

Statistics string

Statistical method. It must be consistent with that defined for metrics. Valid values: [“Average”, “Minimum”, “Maximum”]. Default to “Average”.

TriggeredCount int

Number of consecutive times it has been detected that the values exceed the threshold. Default to 3.

Webhook string

The webhook that should be called when the alarm is triggered. Currently, only http protocol is supported. Default is empty string.

ContactGroups []string

List contact groups of the alarm rule, which must have been created on the console.

Dimensions map[string]interface{}

Map of the resources associated with the alarm rule, such as “instanceId”, “device” and “port”. Each key’s value is a string and it uses comma to split multiple items. For more information, see Metrics Reference.

Metric string

Name of the monitoring metrics corresponding to a project, such as “CPUUtilization” and “networkin_rate”. For more information, see Metrics Reference.

Project string

Monitor project name, such as “acs_ecs_dashboard” and “acs_rds_dashboard”. For more information, see Metrics Reference.

Threshold string

Alarm threshold value, which must be a numeric value currently.

EffectiveInterval string

The interval of effecting alarm rule. It foramt as “hh:mm-hh:mm”, like “0:00-4:00”. Default to “00:00-23:59”.

Enabled bool

Whether to enable alarm rule. Default to true.

EndTime int

It has been deprecated from provider version 1.50.0 and ‘effective_interval’ instead.

Deprecated: Field 'end_time' has been deprecated from provider version 1.50.0. New field 'effective_interval' instead.

Name string

The alarm rule name.

Operator string

Alarm comparison operator. Valid values: [”<=“, “<“, “>”, “>=”, “==”, “!=”]. Default to “==”.

Period int

Index query cycle, which must be consistent with that defined for metrics. Default to 300, in seconds.

SilenceTime int

Notification silence period in the alarm state, in seconds. Valid value range: [300, 86400]. Default to 86400

StartTime int

It has been deprecated from provider version 1.50.0 and ‘effective_interval’ instead.

Deprecated: Field 'start_time' has been deprecated from provider version 1.50.0. New field 'effective_interval' instead.

Statistics string

Statistical method. It must be consistent with that defined for metrics. Valid values: [“Average”, “Minimum”, “Maximum”]. Default to “Average”.

TriggeredCount int

Number of consecutive times it has been detected that the values exceed the threshold. Default to 3.

Webhook string

The webhook that should be called when the alarm is triggered. Currently, only http protocol is supported. Default is empty string.

contactGroups string[]

List contact groups of the alarm rule, which must have been created on the console.

dimensions {[key: string]: any}

Map of the resources associated with the alarm rule, such as “instanceId”, “device” and “port”. Each key’s value is a string and it uses comma to split multiple items. For more information, see Metrics Reference.

metric string

Name of the monitoring metrics corresponding to a project, such as “CPUUtilization” and “networkin_rate”. For more information, see Metrics Reference.

project string

Monitor project name, such as “acs_ecs_dashboard” and “acs_rds_dashboard”. For more information, see Metrics Reference.

threshold string

Alarm threshold value, which must be a numeric value currently.

effectiveInterval string

The interval of effecting alarm rule. It foramt as “hh:mm-hh:mm”, like “0:00-4:00”. Default to “00:00-23:59”.

enabled boolean

Whether to enable alarm rule. Default to true.

endTime number

It has been deprecated from provider version 1.50.0 and ‘effective_interval’ instead.

Deprecated: Field 'end_time' has been deprecated from provider version 1.50.0. New field 'effective_interval' instead.

name string

The alarm rule name.

operator string

Alarm comparison operator. Valid values: [”<=“, “<“, “>”, “>=”, “==”, “!=”]. Default to “==”.

period number

Index query cycle, which must be consistent with that defined for metrics. Default to 300, in seconds.

silenceTime number

Notification silence period in the alarm state, in seconds. Valid value range: [300, 86400]. Default to 86400

startTime number

It has been deprecated from provider version 1.50.0 and ‘effective_interval’ instead.

Deprecated: Field 'start_time' has been deprecated from provider version 1.50.0. New field 'effective_interval' instead.

statistics string

Statistical method. It must be consistent with that defined for metrics. Valid values: [“Average”, “Minimum”, “Maximum”]. Default to “Average”.

triggeredCount number

Number of consecutive times it has been detected that the values exceed the threshold. Default to 3.

webhook string

The webhook that should be called when the alarm is triggered. Currently, only http protocol is supported. Default is empty string.

contact_groups List[str]

List contact groups of the alarm rule, which must have been created on the console.

dimensions Dict[str, Any]

Map of the resources associated with the alarm rule, such as “instanceId”, “device” and “port”. Each key’s value is a string and it uses comma to split multiple items. For more information, see Metrics Reference.

metric str

Name of the monitoring metrics corresponding to a project, such as “CPUUtilization” and “networkin_rate”. For more information, see Metrics Reference.

project str

Monitor project name, such as “acs_ecs_dashboard” and “acs_rds_dashboard”. For more information, see Metrics Reference.

threshold str

Alarm threshold value, which must be a numeric value currently.

effective_interval str

The interval of effecting alarm rule. It foramt as “hh:mm-hh:mm”, like “0:00-4:00”. Default to “00:00-23:59”.

enabled bool

Whether to enable alarm rule. Default to true.

end_time float

It has been deprecated from provider version 1.50.0 and ‘effective_interval’ instead.

Deprecated: Field 'end_time' has been deprecated from provider version 1.50.0. New field 'effective_interval' instead.

name str

The alarm rule name.

operator str

Alarm comparison operator. Valid values: [”<=“, “<“, “>”, “>=”, “==”, “!=”]. Default to “==”.

period float

Index query cycle, which must be consistent with that defined for metrics. Default to 300, in seconds.

silence_time float

Notification silence period in the alarm state, in seconds. Valid value range: [300, 86400]. Default to 86400

start_time float

It has been deprecated from provider version 1.50.0 and ‘effective_interval’ instead.

Deprecated: Field 'start_time' has been deprecated from provider version 1.50.0. New field 'effective_interval' instead.

statistics str

Statistical method. It must be consistent with that defined for metrics. Valid values: [“Average”, “Minimum”, “Maximum”]. Default to “Average”.

triggered_count float

Number of consecutive times it has been detected that the values exceed the threshold. Default to 3.

webhook str

The webhook that should be called when the alarm is triggered. Currently, only http protocol is supported. Default is empty string.

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
Status string

The current alarm rule status.

Id string
The provider-assigned unique ID for this managed resource.
Status string

The current alarm rule status.

id string
The provider-assigned unique ID for this managed resource.
status string

The current alarm rule status.

id str
The provider-assigned unique ID for this managed resource.
status str

The current alarm rule status.

Look up an Existing Alarm Resource

Get an existing Alarm 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?: AlarmState, opts?: CustomResourceOptions): Alarm
static get(resource_name, id, opts=None, contact_groups=None, dimensions=None, effective_interval=None, enabled=None, end_time=None, metric=None, name=None, operator=None, period=None, project=None, silence_time=None, start_time=None, statistics=None, status=None, threshold=None, triggered_count=None, webhook=None, __props__=None);
func GetAlarm(ctx *Context, name string, id IDInput, state *AlarmState, opts ...ResourceOption) (*Alarm, error)
public static Alarm Get(string name, Input<string> id, AlarmState? 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:

ContactGroups List<string>

List contact groups of the alarm rule, which must have been created on the console.

Dimensions Dictionary<string, object>

Map of the resources associated with the alarm rule, such as “instanceId”, “device” and “port”. Each key’s value is a string and it uses comma to split multiple items. For more information, see Metrics Reference.

EffectiveInterval string

The interval of effecting alarm rule. It foramt as “hh:mm-hh:mm”, like “0:00-4:00”. Default to “00:00-23:59”.

Enabled bool

Whether to enable alarm rule. Default to true.

EndTime int

It has been deprecated from provider version 1.50.0 and ‘effective_interval’ instead.

Deprecated: Field 'end_time' has been deprecated from provider version 1.50.0. New field 'effective_interval' instead.

Metric string

Name of the monitoring metrics corresponding to a project, such as “CPUUtilization” and “networkin_rate”. For more information, see Metrics Reference.

Name string

The alarm rule name.

Operator string

Alarm comparison operator. Valid values: [”<=“, “<“, “>”, “>=”, “==”, “!=”]. Default to “==”.

Period int

Index query cycle, which must be consistent with that defined for metrics. Default to 300, in seconds.

Project string

Monitor project name, such as “acs_ecs_dashboard” and “acs_rds_dashboard”. For more information, see Metrics Reference.

SilenceTime int

Notification silence period in the alarm state, in seconds. Valid value range: [300, 86400]. Default to 86400

StartTime int

It has been deprecated from provider version 1.50.0 and ‘effective_interval’ instead.

Deprecated: Field 'start_time' has been deprecated from provider version 1.50.0. New field 'effective_interval' instead.

Statistics string

Statistical method. It must be consistent with that defined for metrics. Valid values: [“Average”, “Minimum”, “Maximum”]. Default to “Average”.

Status string

The current alarm rule status.

Threshold string

Alarm threshold value, which must be a numeric value currently.

TriggeredCount int

Number of consecutive times it has been detected that the values exceed the threshold. Default to 3.

Webhook string

The webhook that should be called when the alarm is triggered. Currently, only http protocol is supported. Default is empty string.

ContactGroups []string

List contact groups of the alarm rule, which must have been created on the console.

Dimensions map[string]interface{}

Map of the resources associated with the alarm rule, such as “instanceId”, “device” and “port”. Each key’s value is a string and it uses comma to split multiple items. For more information, see Metrics Reference.

EffectiveInterval string

The interval of effecting alarm rule. It foramt as “hh:mm-hh:mm”, like “0:00-4:00”. Default to “00:00-23:59”.

Enabled bool

Whether to enable alarm rule. Default to true.

EndTime int

It has been deprecated from provider version 1.50.0 and ‘effective_interval’ instead.

Deprecated: Field 'end_time' has been deprecated from provider version 1.50.0. New field 'effective_interval' instead.

Metric string

Name of the monitoring metrics corresponding to a project, such as “CPUUtilization” and “networkin_rate”. For more information, see Metrics Reference.

Name string

The alarm rule name.

Operator string

Alarm comparison operator. Valid values: [”<=“, “<“, “>”, “>=”, “==”, “!=”]. Default to “==”.

Period int

Index query cycle, which must be consistent with that defined for metrics. Default to 300, in seconds.

Project string

Monitor project name, such as “acs_ecs_dashboard” and “acs_rds_dashboard”. For more information, see Metrics Reference.

SilenceTime int

Notification silence period in the alarm state, in seconds. Valid value range: [300, 86400]. Default to 86400

StartTime int

It has been deprecated from provider version 1.50.0 and ‘effective_interval’ instead.

Deprecated: Field 'start_time' has been deprecated from provider version 1.50.0. New field 'effective_interval' instead.

Statistics string

Statistical method. It must be consistent with that defined for metrics. Valid values: [“Average”, “Minimum”, “Maximum”]. Default to “Average”.

Status string

The current alarm rule status.

Threshold string

Alarm threshold value, which must be a numeric value currently.

TriggeredCount int

Number of consecutive times it has been detected that the values exceed the threshold. Default to 3.

Webhook string

The webhook that should be called when the alarm is triggered. Currently, only http protocol is supported. Default is empty string.

contactGroups string[]

List contact groups of the alarm rule, which must have been created on the console.

dimensions {[key: string]: any}

Map of the resources associated with the alarm rule, such as “instanceId”, “device” and “port”. Each key’s value is a string and it uses comma to split multiple items. For more information, see Metrics Reference.

effectiveInterval string

The interval of effecting alarm rule. It foramt as “hh:mm-hh:mm”, like “0:00-4:00”. Default to “00:00-23:59”.

enabled boolean

Whether to enable alarm rule. Default to true.

endTime number

It has been deprecated from provider version 1.50.0 and ‘effective_interval’ instead.

Deprecated: Field 'end_time' has been deprecated from provider version 1.50.0. New field 'effective_interval' instead.

metric string

Name of the monitoring metrics corresponding to a project, such as “CPUUtilization” and “networkin_rate”. For more information, see Metrics Reference.

name string

The alarm rule name.

operator string

Alarm comparison operator. Valid values: [”<=“, “<“, “>”, “>=”, “==”, “!=”]. Default to “==”.

period number

Index query cycle, which must be consistent with that defined for metrics. Default to 300, in seconds.

project string

Monitor project name, such as “acs_ecs_dashboard” and “acs_rds_dashboard”. For more information, see Metrics Reference.

silenceTime number

Notification silence period in the alarm state, in seconds. Valid value range: [300, 86400]. Default to 86400

startTime number

It has been deprecated from provider version 1.50.0 and ‘effective_interval’ instead.

Deprecated: Field 'start_time' has been deprecated from provider version 1.50.0. New field 'effective_interval' instead.

statistics string

Statistical method. It must be consistent with that defined for metrics. Valid values: [“Average”, “Minimum”, “Maximum”]. Default to “Average”.

status string

The current alarm rule status.

threshold string

Alarm threshold value, which must be a numeric value currently.

triggeredCount number

Number of consecutive times it has been detected that the values exceed the threshold. Default to 3.

webhook string

The webhook that should be called when the alarm is triggered. Currently, only http protocol is supported. Default is empty string.

contact_groups List[str]

List contact groups of the alarm rule, which must have been created on the console.

dimensions Dict[str, Any]

Map of the resources associated with the alarm rule, such as “instanceId”, “device” and “port”. Each key’s value is a string and it uses comma to split multiple items. For more information, see Metrics Reference.

effective_interval str

The interval of effecting alarm rule. It foramt as “hh:mm-hh:mm”, like “0:00-4:00”. Default to “00:00-23:59”.

enabled bool

Whether to enable alarm rule. Default to true.

end_time float

It has been deprecated from provider version 1.50.0 and ‘effective_interval’ instead.

Deprecated: Field 'end_time' has been deprecated from provider version 1.50.0. New field 'effective_interval' instead.

metric str

Name of the monitoring metrics corresponding to a project, such as “CPUUtilization” and “networkin_rate”. For more information, see Metrics Reference.

name str

The alarm rule name.

operator str

Alarm comparison operator. Valid values: [”<=“, “<“, “>”, “>=”, “==”, “!=”]. Default to “==”.

period float

Index query cycle, which must be consistent with that defined for metrics. Default to 300, in seconds.

project str

Monitor project name, such as “acs_ecs_dashboard” and “acs_rds_dashboard”. For more information, see Metrics Reference.

silence_time float

Notification silence period in the alarm state, in seconds. Valid value range: [300, 86400]. Default to 86400

start_time float

It has been deprecated from provider version 1.50.0 and ‘effective_interval’ instead.

Deprecated: Field 'start_time' has been deprecated from provider version 1.50.0. New field 'effective_interval' instead.

statistics str

Statistical method. It must be consistent with that defined for metrics. Valid values: [“Average”, “Minimum”, “Maximum”]. Default to “Average”.

status str

The current alarm rule status.

threshold str

Alarm threshold value, which must be a numeric value currently.

triggered_count float

Number of consecutive times it has been detected that the values exceed the threshold. Default to 3.

webhook str

The webhook that should be called when the alarm is triggered. Currently, only http protocol is supported. Default is empty string.

Package Details

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