Skip to content

aws.lightsail.get_alarms

Example SQL Queries

SELECT * FROM
aws.lightsail.get_alarms;

Description

Returns information about the configured alarms. Specify an alarm name in your request to return information about a specific alarm, or specify a monitored resource name to return information about all alarms for a specific resource.

An alarm is used to monitor a single metric for one of your resources. When a metric condition is met, the alarm can notify you by email, SMS text message, and a banner displayed on the Amazon Lightsail console. For more information, see Alarms in Amazon Lightsail.

Table Definition

Column NameColumn Data Type
alarm_name Input Column

The name of the alarm.

Specify an alarm name to return information about a specific alarm.

VARCHAR
monitored_resource_name Input Column

The name of the Lightsail resource being monitored by the alarm.

Specify a monitored resource name to return information about all alarms for a specific resource.

VARCHAR
page_token Input Column

The token to advance to the next page of results from your request.

To get a page token, perform an initial GetAlarms request. If your results are paginated, the response will return a next page token that you can specify as the page token in a subsequent request.

VARCHAR
_aws_profile Input Column

The AWS profile defines the AWS identity used. It can be defined via credentials or by assuming a IAM role.

STRUCT(
"type" VARCHAR,
"name" VARCHAR,
"account_id" VARCHAR,
"via_profile_name" VARCHAR,
"assumed_role_arn" VARCHAR,
"organization" STRUCT(
"account_name" VARCHAR,
"id" VARCHAR,
"tags" STRUCT(
"key" VARCHAR,
"value" VARCHAR
)[],
"master_account" STRUCT(
"id" VARCHAR,
"email" VARCHAR
),
"parents" STRUCT(
"type" VARCHAR,
"id" VARCHAR,
"name" VARCHAR,
"tags" STRUCT(
"key" VARCHAR,
"value" VARCHAR
)[]
)[]
)
)
Show child fields
_aws_profile.account_id

The AWS account id

_aws_profile.assumed_role_arn

The ARN of the assumed role

_aws_profile.name

The unique name of the profile.

_aws_profile.organization

Information about this profile's membership in the AWS organization.

Show child fields
_aws_profile.organization.account_name

The name of account speciifed by the organization

_aws_profile.organization.id

The organization id

_aws_profile.organization.master_account
Show child fields
_aws_profile.organization.master_account.email

The organization master account email address

_aws_profile.organization.master_account.id

The organization master account id

_aws_profile.organization.parents[]
Show child fields
_aws_profile.organization.parents[].id

The id of the parent

_aws_profile.organization.parents[].name

The name of the parent

_aws_profile.organization.parents[].tags[]
Show child fields
_aws_profile.organization.parents[].tags[].key
_aws_profile.organization.parents[].tags[].value
_aws_profile.organization.parents[].type

The type of parent can be an organization unit or a root

_aws_profile.organization.tags[]
Show child fields
_aws_profile.organization.tags[].key
_aws_profile.organization.tags[].value
_aws_profile.type

The type of profile, either 'credentials' or 'assumed_role'

_aws_profile.via_profile_name

This IAM role for this profile is assumed by first utilizing another profile with this name to obtain credentials.

_aws_region Input Column

The AWS region to use.

VARCHAR
alarms

An array of objects that describe the alarms.

STRUCT(
"name" VARCHAR,
"arn" VARCHAR,
"created_at" TIMESTAMP_S,
"location" STRUCT(
"availability_zone" VARCHAR,
"region_name" VARCHAR
),
"resource_type" VARCHAR,
"support_code" VARCHAR,
"monitored_resource_info" STRUCT(
"arn" VARCHAR,
"name" VARCHAR,
"resource_type" VARCHAR
),
"comparison_operator" VARCHAR,
"evaluation_periods" BIGINT,
"period" BIGINT,
"threshold" DOUBLE,
"datapoints_to_alarm" BIGINT,
"treat_missing_data" VARCHAR,
"statistic" VARCHAR,
"metric_name" VARCHAR,
"state" VARCHAR,
"unit" VARCHAR,
"contact_protocols" VARCHAR[],
"notification_triggers" VARCHAR[],
"notification_enabled" BOOLEAN
)[]
Show child fields
alarms[]
Show child fields
alarms[].arn

The Amazon Resource Name (ARN) of the alarm.

alarms[].comparison_operator

The arithmetic operation used when comparing the specified statistic and threshold.

alarms[].contact_protocols[]
alarms[].created_at

The timestamp when the alarm was created.

alarms[].datapoints_to_alarm

The number of data points that must not within the specified threshold to trigger the alarm.

alarms[].evaluation_periods

The number of periods over which data is compared to the specified threshold.

alarms[].location

An object that lists information about the location of the alarm.

Show child fields
alarms[].location.availability_zone

The Availability Zone. Follows the format us-east-2a (case-sensitive).

alarms[].location.region_name

The Amazon Web Services Region name.

alarms[].metric_name

The name of the metric associated with the alarm.

alarms[].monitored_resource_info

An object that lists information about the resource monitored by the alarm.

Show child fields
alarms[].monitored_resource_info.arn

The Amazon Resource Name (ARN) of the resource being monitored.

alarms[].monitored_resource_info.name

The name of the Lightsail resource being monitored.

alarms[].monitored_resource_info.resource_type

The Lightsail resource type of the resource being monitored.

Instances, load balancers, and relational databases are the only Lightsail resources that can currently be monitored by alarms.

alarms[].name

The name of the alarm.

alarms[].notification_enabled

Indicates whether the alarm is enabled.

alarms[].notification_triggers[]
alarms[].period

The period, in seconds, over which the statistic is applied.

alarms[].resource_type

The Lightsail resource type of the alarm.

alarms[].state

The current state of the alarm.

An alarm has the following possible states:

  • ALARM - The metric is outside of the defined threshold.

  • INSUFFICIENT_DATA - The alarm has just started, the metric is not available, or not enough data is available for the metric to determine the alarm state.

  • OK - The metric is within the defined threshold.

alarms[].statistic

The statistic for the metric associated with the alarm.

The following statistics are available:

  • Minimum - The lowest value observed during the specified period. Use this value to determine low volumes of activity for your application.

  • Maximum - The highest value observed during the specified period. Use this value to determine high volumes of activity for your application.

  • Sum - All values submitted for the matching metric added together. You can use this statistic to determine the total volume of a metric.

  • Average - The value of Sum/SampleCount during the specified period. By comparing this statistic with the Minimum and Maximum values, you can determine the full scope of a metric and how close the average use is to the Minimum and Maximum values. This comparison helps you to know when to increase or decrease your resources.

  • SampleCount - The count, or number, of data points used for the statistical calculation.

alarms[].support_code

The support code. Include this code in your email to support when you have questions about your Lightsail alarm. This code enables our support team to look up your Lightsail information more easily.

alarms[].threshold

The value against which the specified statistic is compared.

alarms[].treat_missing_data

Specifies how the alarm handles missing data points.

An alarm can treat missing data in the following ways:

  • breaching - Assume the missing data is not within the threshold. Missing data counts towards the number of times the metric is not within the threshold.

  • notBreaching - Assume the missing data is within the threshold. Missing data does not count towards the number of times the metric is not within the threshold.

  • ignore - Ignore the missing data. Maintains the current alarm state.

  • missing - Missing data is treated as missing.

alarms[].unit

The unit of the metric associated with the alarm.

next_page_token

The token to advance to the next page of results from your request.

A next page token is not returned if there are no more results to display.

To get the next page of results, perform another GetAlarms request and specify the next page token using the pageToken parameter.

VARCHAR