Resource Type definition for AWS::CloudWatch::Alert. An alert runs a SQL or PromQL query in a CloudWatch Omni space on a fixed interval, compares the result against warning and critical thresholds, and sends notifications to Amazon SNS topics or integrations when its state changes.
Using getAlert
Two invocation forms are available. The direct form accepts plain
arguments and either blocks until the result value is available, or
returns a Promise-wrapped result. The output form accepts
Input-wrapped arguments and returns an Output-wrapped result.
def get_alert(alert_id: Optional[str] = None,
space_id: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetAlertResult
def get_alert_output(alert_id: pulumi.Input[Optional[str]] = None,
space_id: pulumi.Input[Optional[str]] = None,
opts: Optional[InvokeOutputOptions] = None) -> Output[GetAlertResult]
> Note: This function is named LookupAlert in the Go SDK.
public static CompletableFuture<GetAlertResult> getAlert(GetAlertArgs args, InvokeOptions options)
public static Output<GetAlertResult> getAlert(GetAlertArgs args, InvokeOptions options)
public static Output<GetAlertResult> getAlert(GetAlertArgs args, InvokeOutputOptions options)
fn::invoke:
function: aws-native:cloudwatch:getAlert
arguments:
# arguments dictionary
data "aws-native_cloudwatch_get_alert" "name" {
# arguments
}
The following arguments are supported:
- AlertId
string
- The ID of the alert, assigned by CloudWatch when the alert is created. It doesn't change when the alert is updated, and it is the resource ID in the alert's ARN.
- SpaceId
string
- The ID of the space to create the alert in. Changing this value replaces the alert.
- AlertId
string
- The ID of the alert, assigned by CloudWatch when the alert is created. It doesn't change when the alert is updated, and it is the resource ID in the alert's ARN.
- SpaceId
string
- The ID of the space to create the alert in. Changing this value replaces the alert.
- alert_id
string
- The ID of the alert, assigned by CloudWatch when the alert is created. It doesn't change when the alert is updated, and it is the resource ID in the alert's ARN.
- space_id
string
- The ID of the space to create the alert in. Changing this value replaces the alert.
- alertId
String
- The ID of the alert, assigned by CloudWatch when the alert is created. It doesn't change when the alert is updated, and it is the resource ID in the alert's ARN.
- spaceId
String
- The ID of the space to create the alert in. Changing this value replaces the alert.
- alertId
string
- The ID of the alert, assigned by CloudWatch when the alert is created. It doesn't change when the alert is updated, and it is the resource ID in the alert's ARN.
- spaceId
string
- The ID of the space to create the alert in. Changing this value replaces the alert.
- alert_id
str
- The ID of the alert, assigned by CloudWatch when the alert is created. It doesn't change when the alert is updated, and it is the resource ID in the alert's ARN.
- space_id
str
- The ID of the space to create the alert in. Changing this value replaces the alert.
- alertId
String
- The ID of the alert, assigned by CloudWatch when the alert is created. It doesn't change when the alert is updated, and it is the resource ID in the alert's ARN.
- spaceId
String
- The ID of the space to create the alert in. Changing this value replaces the alert.
getAlert Result
The following output properties are available:
- AccountId
string
- The AWS account ID that owns the alert.
- AlertId
string
- The ID of the alert, assigned by CloudWatch when the alert is created. It doesn't change when the alert is updated, and it is the resource ID in the alert's ARN.
- Arn
string
- The Amazon Resource Name (ARN) of the alert.
- CreatedAt
string
- The time the alert was created, in ISO 8601 format (UTC).
- Description
string
- A description of the alert.
- Name
string
- The display name of the alert. Names don't need to be unique within a space; the alert is identified by AlertId.
- NotificationRules
[]AlertNotificationRule
- The notification rules that determine when and where notifications are sent.
- NotificationsEnabled
bool
- Whether the alert sends notifications. When false, the alert is still evaluated and records its state, but sends nothing. Defaults to true.
- ProfileId
string
- The ID of the access profile the alert uses to run its query and send notifications.
- Rule
AlertRule
- Tags
Tag
- An array of key-value pairs to apply to this resource.
- UpdatedAt
string
- The time the alert was last updated, in ISO 8601 format (UTC).
- account_id
string
- The AWS account ID that owns the alert.
- alert_id
string
- The ID of the alert, assigned by CloudWatch when the alert is created. It doesn't change when the alert is updated, and it is the resource ID in the alert's ARN.
- arn
string
- The Amazon Resource Name (ARN) of the alert.
- created_at
string
- The time the alert was created, in ISO 8601 format (UTC).
- description
string
- A description of the alert.
- name
string
- The display name of the alert. Names don't need to be unique within a space; the alert is identified by AlertId.
- notification_rules
list(object)
- The notification rules that determine when and where notifications are sent.
- notifications_enabled
bool
- Whether the alert sends notifications. When false, the alert is still evaluated and records its state, but sends nothing. Defaults to true.
- profile_id
string
- The ID of the access profile the alert uses to run its query and send notifications.
- rule
object
- tags
list(object)
- An array of key-value pairs to apply to this resource.
- updated_at
string
- The time the alert was last updated, in ISO 8601 format (UTC).
- accountId
String
- The AWS account ID that owns the alert.
- alertId
String
- The ID of the alert, assigned by CloudWatch when the alert is created. It doesn't change when the alert is updated, and it is the resource ID in the alert's ARN.
- arn
String
- The Amazon Resource Name (ARN) of the alert.
- createdAt
String
- The time the alert was created, in ISO 8601 format (UTC).
- description
String
- A description of the alert.
- name
String
- The display name of the alert. Names don't need to be unique within a space; the alert is identified by AlertId.
- notificationRules
List<AlertNotificationRule>
- The notification rules that determine when and where notifications are sent.
- notificationsEnabled
Boolean
- Whether the alert sends notifications. When false, the alert is still evaluated and records its state, but sends nothing. Defaults to true.
- profileId
String
- The ID of the access profile the alert uses to run its query and send notifications.
- rule
AlertRule
- tags
List<Tag>
- An array of key-value pairs to apply to this resource.
- updatedAt
String
- The time the alert was last updated, in ISO 8601 format (UTC).
- accountId
string
- The AWS account ID that owns the alert.
- alertId
string
- The ID of the alert, assigned by CloudWatch when the alert is created. It doesn't change when the alert is updated, and it is the resource ID in the alert's ARN.
- arn
string
- The Amazon Resource Name (ARN) of the alert.
- createdAt
string
- The time the alert was created, in ISO 8601 format (UTC).
- description
string
- A description of the alert.
- name
string
- The display name of the alert. Names don't need to be unique within a space; the alert is identified by AlertId.
- notificationRules
AlertNotificationRule[]
- The notification rules that determine when and where notifications are sent.
- notificationsEnabled
boolean
- Whether the alert sends notifications. When false, the alert is still evaluated and records its state, but sends nothing. Defaults to true.
- profileId
string
- The ID of the access profile the alert uses to run its query and send notifications.
- rule
AlertRule
- tags
Tag[]
- An array of key-value pairs to apply to this resource.
- updatedAt
string
- The time the alert was last updated, in ISO 8601 format (UTC).
- account_id
str
- The AWS account ID that owns the alert.
- alert_id
str
- The ID of the alert, assigned by CloudWatch when the alert is created. It doesn't change when the alert is updated, and it is the resource ID in the alert's ARN.
- arn
str
- The Amazon Resource Name (ARN) of the alert.
- created_at
str
- The time the alert was created, in ISO 8601 format (UTC).
- description
str
- A description of the alert.
- name
str
- The display name of the alert. Names don't need to be unique within a space; the alert is identified by AlertId.
- notification_rules
Sequence[AlertNotificationRule]
- The notification rules that determine when and where notifications are sent.
- notifications_enabled
bool
- Whether the alert sends notifications. When false, the alert is still evaluated and records its state, but sends nothing. Defaults to true.
- profile_id
str
- The ID of the access profile the alert uses to run its query and send notifications.
- rule
AlertRule
- tags
Sequence[root_Tag]
- An array of key-value pairs to apply to this resource.
- updated_at
str
- The time the alert was last updated, in ISO 8601 format (UTC).
- accountId
String
- The AWS account ID that owns the alert.
- alertId
String
- The ID of the alert, assigned by CloudWatch when the alert is created. It doesn't change when the alert is updated, and it is the resource ID in the alert's ARN.
- arn
String
- The Amazon Resource Name (ARN) of the alert.
- createdAt
String
- The time the alert was created, in ISO 8601 format (UTC).
- description
String
- A description of the alert.
- name
String
- The display name of the alert. Names don't need to be unique within a space; the alert is identified by AlertId.
- notificationRules
List<Property Map>
- The notification rules that determine when and where notifications are sent.
- notificationsEnabled
Boolean
- Whether the alert sends notifications. When false, the alert is still evaluated and records its state, but sends nothing. Defaults to true.
- profileId
String
- The ID of the access profile the alert uses to run its query and send notifications.
- rule
Property Map
- tags
List<Property Map>
- An array of key-value pairs to apply to this resource.
- updatedAt
String
- The time the alert was last updated, in ISO 8601 format (UTC).
Supporting Types
AlertCondition
- Comparator
AlertConditionComparator
- The comparison operator. Valid values: GT, GTE, LT, LTE (greater than, greater than or equal to, less than, less than or equal to).
- CriticalThreshold
float64
- The value at which the alert enters the CRITICAL state.
- ThresholdField
string
- The result field to compare against the threshold. Required when ThresholdMode is FIELD_VALUE.
- ThresholdMode
AlertConditionThresholdMode
- How the threshold is applied. COUNT_OF_RESULTS compares the number of rows the query returns. FIELD_VALUE compares the value of ThresholdField in each result row; each row is tracked separately.
- WarningThreshold
float64
- The value at which the alert enters the WARNING state.
- comparator
"GT" | "LT" | "GTE" | "LTE"
- The comparison operator. Valid values: GT, GTE, LT, LTE (greater than, greater than or equal to, less than, less than or equal to).
- critical_threshold
number
- The value at which the alert enters the CRITICAL state.
- threshold_field
string
- The result field to compare against the threshold. Required when ThresholdMode is FIELD_VALUE.
- threshold_mode
"COUNT_OF_RESULTS" | "FIELD_VALUE"
- How the threshold is applied. COUNT_OF_RESULTS compares the number of rows the query returns. FIELD_VALUE compares the value of ThresholdField in each result row; each row is tracked separately.
- warning_threshold
number
- The value at which the alert enters the WARNING state.
- comparator
AlertConditionComparator
- The comparison operator. Valid values: GT, GTE, LT, LTE (greater than, greater than or equal to, less than, less than or equal to).
- criticalThreshold
Double
- The value at which the alert enters the CRITICAL state.
- thresholdField
String
- The result field to compare against the threshold. Required when ThresholdMode is FIELD_VALUE.
- thresholdMode
AlertConditionThresholdMode
- How the threshold is applied. COUNT_OF_RESULTS compares the number of rows the query returns. FIELD_VALUE compares the value of ThresholdField in each result row; each row is tracked separately.
- warningThreshold
Double
- The value at which the alert enters the WARNING state.
- comparator
AlertConditionComparator
- The comparison operator. Valid values: GT, GTE, LT, LTE (greater than, greater than or equal to, less than, less than or equal to).
- criticalThreshold
number
- The value at which the alert enters the CRITICAL state.
- thresholdField
string
- The result field to compare against the threshold. Required when ThresholdMode is FIELD_VALUE.
- thresholdMode
AlertConditionThresholdMode
- How the threshold is applied. COUNT_OF_RESULTS compares the number of rows the query returns. FIELD_VALUE compares the value of ThresholdField in each result row; each row is tracked separately.
- warningThreshold
number
- The value at which the alert enters the WARNING state.
- comparator
AlertConditionComparator
- The comparison operator. Valid values: GT, GTE, LT, LTE (greater than, greater than or equal to, less than, less than or equal to).
- critical_threshold
float
- The value at which the alert enters the CRITICAL state.
- threshold_field
str
- The result field to compare against the threshold. Required when ThresholdMode is FIELD_VALUE.
- threshold_mode
AlertConditionThresholdMode
- How the threshold is applied. COUNT_OF_RESULTS compares the number of rows the query returns. FIELD_VALUE compares the value of ThresholdField in each result row; each row is tracked separately.
- warning_threshold
float
- The value at which the alert enters the WARNING state.
- comparator
"GT" | "LT" | "GTE" | "LTE"
- The comparison operator. Valid values: GT, GTE, LT, LTE (greater than, greater than or equal to, less than, less than or equal to).
- criticalThreshold
Number
- The value at which the alert enters the CRITICAL state.
- thresholdField
String
- The result field to compare against the threshold. Required when ThresholdMode is FIELD_VALUE.
- thresholdMode
"COUNT_OF_RESULTS" | "FIELD_VALUE"
- How the threshold is applied. COUNT_OF_RESULTS compares the number of rows the query returns. FIELD_VALUE compares the value of ThresholdField in each result row; each row is tracked separately.
- warningThreshold
Number
- The value at which the alert enters the WARNING state.
AlertConditionComparator
| Name | Value |
|---|
| Gt | GT |
| Lt | LT |
| Gte | GTE |
| Lte | LTE |
| Name | Value |
|---|
| AlertConditionComparatorGt | GT |
| AlertConditionComparatorLt | LT |
| AlertConditionComparatorGte | GTE |
| AlertConditionComparatorLte | LTE |
| Name | Value |
|---|
| Gt | GT |
| Lt | LT |
| Gte | GTE |
| Lte | LTE |
| Name | Value |
|---|
| Gt | GT |
| Lt | LT |
| Gte | GTE |
| Lte | LTE |
| Name | Value |
|---|
| GT | GT |
| LT | LT |
| GTE | GTE |
| LTE | LTE |
AlertConditionThresholdMode
| Name | Value |
|---|
| CountOfResults | COUNT_OF_RESULTS |
| FieldValue | FIELD_VALUE |
| Name | Value |
|---|
| AlertConditionThresholdModeCountOfResults | COUNT_OF_RESULTS |
| AlertConditionThresholdModeFieldValue | FIELD_VALUE |
| Value |
|---|
COUNT_OF_RESULTS |
FIELD_VALUE |
| Name | Value |
|---|
| CountOfResults | COUNT_OF_RESULTS |
| FieldValue | FIELD_VALUE |
| Name | Value |
|---|
| CountOfResults | COUNT_OF_RESULTS |
| FieldValue | FIELD_VALUE |
| Name | Value |
|---|
| COUNT_OF_RESULTS | COUNT_OF_RESULTS |
| FIELD_VALUE | FIELD_VALUE |
| Value |
|---|
COUNT_OF_RESULTS |
FIELD_VALUE |
AlertEvaluation
- IntervalSeconds
int
- The time between evaluations, in seconds. Valid values: 30, 60, 120, 300, 600, 900, 1800, 3600.
- PendingDurationSeconds
int
- How long a threshold breach must last before the alert changes state, in seconds. Must be a multiple of IntervalSeconds. 0 changes state immediately.
- RecoveryDurationSeconds
int
- How long the result must stay within its thresholds before the alert returns to OK, in seconds. Must be a multiple of IntervalSeconds. 0 returns to OK immediately.
- IntervalSeconds
int
- The time between evaluations, in seconds. Valid values: 30, 60, 120, 300, 600, 900, 1800, 3600.
- PendingDurationSeconds
int
- How long a threshold breach must last before the alert changes state, in seconds. Must be a multiple of IntervalSeconds. 0 changes state immediately.
- RecoveryDurationSeconds
int
- How long the result must stay within its thresholds before the alert returns to OK, in seconds. Must be a multiple of IntervalSeconds. 0 returns to OK immediately.
- interval_seconds
number
- The time between evaluations, in seconds. Valid values: 30, 60, 120, 300, 600, 900, 1800, 3600.
- pending_duration_seconds
number
- How long a threshold breach must last before the alert changes state, in seconds. Must be a multiple of IntervalSeconds. 0 changes state immediately.
- recovery_duration_seconds
number
- How long the result must stay within its thresholds before the alert returns to OK, in seconds. Must be a multiple of IntervalSeconds. 0 returns to OK immediately.
- intervalSeconds
Integer
- The time between evaluations, in seconds. Valid values: 30, 60, 120, 300, 600, 900, 1800, 3600.
- pendingDurationSeconds
Integer
- How long a threshold breach must last before the alert changes state, in seconds. Must be a multiple of IntervalSeconds. 0 changes state immediately.
- recoveryDurationSeconds
Integer
- How long the result must stay within its thresholds before the alert returns to OK, in seconds. Must be a multiple of IntervalSeconds. 0 returns to OK immediately.
- intervalSeconds
number
- The time between evaluations, in seconds. Valid values: 30, 60, 120, 300, 600, 900, 1800, 3600.
- pendingDurationSeconds
number
- How long a threshold breach must last before the alert changes state, in seconds. Must be a multiple of IntervalSeconds. 0 changes state immediately.
- recoveryDurationSeconds
number
- How long the result must stay within its thresholds before the alert returns to OK, in seconds. Must be a multiple of IntervalSeconds. 0 returns to OK immediately.
- interval_seconds
int
- The time between evaluations, in seconds. Valid values: 30, 60, 120, 300, 600, 900, 1800, 3600.
- pending_duration_seconds
int
- How long a threshold breach must last before the alert changes state, in seconds. Must be a multiple of IntervalSeconds. 0 changes state immediately.
- recovery_duration_seconds
int
- How long the result must stay within its thresholds before the alert returns to OK, in seconds. Must be a multiple of IntervalSeconds. 0 returns to OK immediately.
- intervalSeconds
Number
- The time between evaluations, in seconds. Valid values: 30, 60, 120, 300, 600, 900, 1800, 3600.
- pendingDurationSeconds
Number
- How long a threshold breach must last before the alert changes state, in seconds. Must be a multiple of IntervalSeconds. 0 changes state immediately.
- recoveryDurationSeconds
Number
- How long the result must stay within its thresholds before the alert returns to OK, in seconds. Must be a multiple of IntervalSeconds. 0 returns to OK immediately.
AlertNoData
- TreatAs
AlertNoDataTreatAs
- The state to report when an evaluation returns no data. Valid values: OK, WARNING, CRITICAL, NODATA.
- treatAs
AlertNoDataTreatAs
- The state to report when an evaluation returns no data. Valid values: OK, WARNING, CRITICAL, NODATA.
- treatAs
AlertNoDataTreatAs
- The state to report when an evaluation returns no data. Valid values: OK, WARNING, CRITICAL, NODATA.
AlertNoDataTreatAs
| Name | Value |
|---|
| Ok | OK |
| Warning | WARNING |
| Critical | CRITICAL |
| Nodata | NODATA |
| Name | Value |
|---|
| AlertNoDataTreatAsOk | OK |
| AlertNoDataTreatAsWarning | WARNING |
| AlertNoDataTreatAsCritical | CRITICAL |
| AlertNoDataTreatAsNodata | NODATA |
| Value |
|---|
OK |
WARNING |
CRITICAL |
NODATA |
| Name | Value |
|---|
| Ok | OK |
| Warning | WARNING |
| Critical | CRITICAL |
| Nodata | NODATA |
| Name | Value |
|---|
| Ok | OK |
| Warning | WARNING |
| Critical | CRITICAL |
| Nodata | NODATA |
| Name | Value |
|---|
| OK | OK |
| WARNING | WARNING |
| CRITICAL | CRITICAL |
| NODATA | NODATA |
| Value |
|---|
OK |
WARNING |
CRITICAL |
NODATA |
AlertNotificationRule
AlertQuery
- expression
string
- The query expression. For PromQL, the series value is returned in a field named value.
- language
"SQL" | "PROMQL"
- The query language. Valid values: SQL, PROMQL.
- expression
String
- The query expression. For PromQL, the series value is returned in a field named value.
- language
"SQL" | "PROMQL"
- The query language. Valid values: SQL, PROMQL.
AlertQueryLanguage
| Name | Value |
|---|
| Sql | SQL |
| Promql | PROMQL |
| Name | Value |
|---|
| AlertQueryLanguageSql | SQL |
| AlertQueryLanguagePromql | PROMQL |
| Name | Value |
|---|
| Sql | SQL |
| Promql | PROMQL |
| Name | Value |
|---|
| Sql | SQL |
| Promql | PROMQL |
| Name | Value |
|---|
| SQL | SQL |
| PROMQL | PROMQL |
AlertRule
AlertTarget
- Arn
string
- The ARN of the target. For sns, the ARN of the Amazon SNS topic. For slack and pagerduty, the ARN of a CloudWatch Omni integration.
- Type
AlertTargetType
- The target type. Valid values: sns, slack, pagerduty.
- Metadata
map[string]string
- arn
string
- The ARN of the target. For sns, the ARN of the Amazon SNS topic. For slack and pagerduty, the ARN of a CloudWatch Omni integration.
- type
"sns" | "slack" | "pagerduty"
- The target type. Valid values: sns, slack, pagerduty.
- metadata
map(string)
- arn
String
- The ARN of the target. For sns, the ARN of the Amazon SNS topic. For slack and pagerduty, the ARN of a CloudWatch Omni integration.
- type
AlertTargetType
- The target type. Valid values: sns, slack, pagerduty.
- metadata
Map<String,String>
- arn
string
- The ARN of the target. For sns, the ARN of the Amazon SNS topic. For slack and pagerduty, the ARN of a CloudWatch Omni integration.
- type
AlertTargetType
- The target type. Valid values: sns, slack, pagerduty.
- metadata
{[key: string]: string}
- arn
str
- The ARN of the target. For sns, the ARN of the Amazon SNS topic. For slack and pagerduty, the ARN of a CloudWatch Omni integration.
- type
AlertTargetType
- The target type. Valid values: sns, slack, pagerduty.
- metadata
Mapping[str, str]
- arn
String
- The ARN of the target. For sns, the ARN of the Amazon SNS topic. For slack and pagerduty, the ARN of a CloudWatch Omni integration.
- type
"sns" | "slack" | "pagerduty"
- The target type. Valid values: sns, slack, pagerduty.
- metadata
Map<String>
AlertTargetType
| Name | Value |
|---|
| Sns | sns |
| Slack | slack |
| Pagerduty | pagerduty |
| Name | Value |
|---|
| AlertTargetTypeSns | sns |
| AlertTargetTypeSlack | slack |
| AlertTargetTypePagerduty | pagerduty |
| Name | Value |
|---|
| Sns | sns |
| Slack | slack |
| Pagerduty | pagerduty |
| Name | Value |
|---|
| Sns | sns |
| Slack | slack |
| Pagerduty | pagerduty |
| Name | Value |
|---|
| SNS | sns |
| SLACK | slack |
| PAGERDUTY | pagerduty |
AlertTelemetryRule
AlertTrigger
AlertTriggerStateValuesItem
| Name | Value |
|---|
| Ok | OK |
| Warning | WARNING |
| Critical | CRITICAL |
| Nodata | NODATA |
| Name | Value |
|---|
| AlertTriggerStateValuesItemOk | OK |
| AlertTriggerStateValuesItemWarning | WARNING |
| AlertTriggerStateValuesItemCritical | CRITICAL |
| AlertTriggerStateValuesItemNodata | NODATA |
| Value |
|---|
OK |
WARNING |
CRITICAL |
NODATA |
| Name | Value |
|---|
| Ok | OK |
| Warning | WARNING |
| Critical | CRITICAL |
| Nodata | NODATA |
| Name | Value |
|---|
| Ok | OK |
| Warning | WARNING |
| Critical | CRITICAL |
| Nodata | NODATA |
| Name | Value |
|---|
| OK | OK |
| WARNING | WARNING |
| CRITICAL | CRITICAL |
| NODATA | NODATA |
| Value |
|---|
OK |
WARNING |
CRITICAL |
NODATA |
Tag
- Key
string
- The key name of the tag
- Value
string
- The value of the tag
- Key
string
- The key name of the tag
- Value
string
- The value of the tag
- key
string
- The key name of the tag
- value
string
- The value of the tag
- key
String
- The key name of the tag
- value
String
- The value of the tag
- key
string
- The key name of the tag
- value
string
- The value of the tag
- key
str
- The key name of the tag
- value
str
- The value of the tag
- key
String
- The key name of the tag
- value
String
- The value of the tag
Package Details
- Repository
- AWS Native pulumi/pulumi-aws-native
- License
- Apache-2.0