Skip to main content

composite_alarms

Creates, updates, deletes or gets a composite_alarm resource or lists composite_alarms in a region

Overview

Namecomposite_alarms
TypeResource
DescriptionThe AWS::CloudWatch::CompositeAlarm type specifies an alarm which aggregates the states of other Alarms (Metric or Composite Alarms) as defined by the AlarmRule expression
Idawscc.cloudwatch.composite_alarms

Fields

NameDatatypeDescription
arnstringAmazon Resource Name (ARN) of the alarm
alarm_namestringThe name of the Composite Alarm
alarm_rulestringExpression which aggregates the state of other Alarms (Metric or Composite Alarms)
alarm_descriptionstringThe description of the alarm
actions_enabledbooleanIndicates whether actions should be executed during any changes to the alarm state. The default is TRUE.
ok_actionsarrayThe actions to execute when this alarm transitions to the OK state from any other state. Each action is specified as an Amazon Resource Name (ARN).
alarm_actionsarrayThe list of actions to execute when this alarm transitions into an ALARM state from any other state. Specify each action as an Amazon Resource Name (ARN).
insufficient_data_actionsarrayThe actions to execute when this alarm transitions to the INSUFFICIENT_DATA state from any other state. Each action is specified as an Amazon Resource Name (ARN).
actions_suppressorstringActions will be suppressed if the suppressor alarm is in the ALARM state. ActionsSuppressor can be an AlarmName or an Amazon Resource Name (ARN) from an existing alarm.
actions_suppressor_wait_periodintegerActions will be suppressed if ExtensionPeriod is active. The length of time that actions are suppressed is in seconds.
actions_suppressor_extension_periodintegerActions will be suppressed if WaitPeriod is active. The length of time that actions are suppressed is in seconds.
tagsarrayA list of key-value pairs to associate with the composite alarm. You can associate as many as 50 tags with an alarm.
regionstringAWS region.

For more information, see AWS::CloudWatch::CompositeAlarm.

Methods

NameResourceAccessible byRequired Params
create_resourcecomposite_alarmsINSERTAlarmRule, region
delete_resourcecomposite_alarmsDELETEIdentifier, region
update_resourcecomposite_alarmsUPDATEIdentifier, PatchDocument, region
list_resourcescomposite_alarms_list_onlySELECTregion
get_resourcecomposite_alarmsSELECTIdentifier, region

SELECT examples

Gets all properties from an individual composite_alarm.

SELECT
region,
arn,
alarm_name,
alarm_rule,
alarm_description,
actions_enabled,
ok_actions,
alarm_actions,
insufficient_data_actions,
actions_suppressor,
actions_suppressor_wait_period,
actions_suppressor_extension_period,
tags
FROM awscc.cloudwatch.composite_alarms
WHERE
region = '{{ region }}' AND
Identifier = '{{ alarm_name }}';

INSERT example

Use the following StackQL query and manifest file to create a new composite_alarm resource, using stack-deploy.

/*+ create */
INSERT INTO awscc.cloudwatch.composite_alarms (
AlarmRule,
region
)
SELECT
'{{ alarm_rule }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

UPDATE example

Use the following StackQL query and manifest file to update a composite_alarm resource, using stack-deploy.

/*+ update */
UPDATE awscc.cloudwatch.composite_alarms
SET PatchDocument = string('{{ {
"AlarmRule": alarm_rule,
"AlarmDescription": alarm_description,
"ActionsEnabled": actions_enabled,
"OKActions": ok_actions,
"AlarmActions": alarm_actions,
"InsufficientDataActions": insufficient_data_actions,
"ActionsSuppressor": actions_suppressor,
"ActionsSuppressorWaitPeriod": actions_suppressor_wait_period,
"ActionsSuppressorExtensionPeriod": actions_suppressor_extension_period,
"Tags": tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ alarm_name }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

DELETE example

/*+ delete */
DELETE FROM awscc.cloudwatch.composite_alarms
WHERE
Identifier = '{{ alarm_name }}' AND
region = '{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

Additional Parameters

Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:

ParameterDescription
ClientToken
A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.
A client token is valid for 36 hours once used.
After that, a resource request with the same client token is treated as a new request.
If you do not specify a client token, one is generated for inclusion in the request.
RoleArn
The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.
If you do not specify a role, a temporary session is created using your AWS user credentials.
TypeVersionId
For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used.

Permissions

To operate on the composite_alarms resource, the following permissions are required:

cloudwatch:DescribeAlarms,
cloudwatch:PutCompositeAlarm,
cloudwatch:TagResource