composite_alarms
Creates, updates, deletes or gets a composite_alarm
resource or lists composite_alarms
in a region
Overview
Name | composite_alarms |
Type | Resource |
Description | The AWS::CloudWatch::CompositeAlarm type specifies an alarm which aggregates the states of other Alarms (Metric or Composite Alarms) as defined by the AlarmRule expression |
Id | aws.cloudwatch.composite_alarms |
Fields
Name | Datatype | Description |
---|---|---|
arn | string | Amazon Resource Name (ARN) of the alarm |
alarm_name | string | The name of the Composite Alarm |
alarm_rule | string | Expression which aggregates the state of other Alarms (Metric or Composite Alarms) |
alarm_description | string | The description of the alarm |
actions_enabled | boolean | Indicates whether actions should be executed during any changes to the alarm state. The default is TRUE. |
ok_actions | array | The 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_actions | array | The 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_actions | array | The 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_suppressor | string | Actions 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_period | integer | Actions will be suppressed if ExtensionPeriod is active. The length of time that actions are suppressed is in seconds. |
actions_suppressor_extension_period | integer | Actions will be suppressed if WaitPeriod is active. The length of time that actions are suppressed is in seconds. |
tags | array | A list of key-value pairs to associate with the composite alarm. You can associate as many as 50 tags with an alarm. |
region | string | AWS region. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | AlarmRule, region |
delete_resource | DELETE | data__Identifier, region |
update_resource | UPDATE | data__Identifier, data__PatchDocument, region |
list_resources | SELECT | region |
get_resource | SELECT | data__Identifier, region |
SELECT
examples
Gets all composite_alarms
in a region.
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 aws.cloudwatch.composite_alarms
WHERE region = 'us-east-1';
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 aws.cloudwatch.composite_alarms
WHERE region = 'us-east-1' AND data__Identifier = '<AlarmName>';
INSERT
example
Use the following StackQL query and manifest file to create a new composite_alarm
resource, using stack-deploy
.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO aws.cloudwatch.composite_alarms (
AlarmRule,
region
)
SELECT
'{{ AlarmRule }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.cloudwatch.composite_alarms (
AlarmName,
AlarmRule,
AlarmDescription,
ActionsEnabled,
OKActions,
AlarmActions,
InsufficientDataActions,
ActionsSuppressor,
ActionsSuppressorWaitPeriod,
ActionsSuppressorExtensionPeriod,
Tags,
region
)
SELECT
'{{ AlarmName }}',
'{{ AlarmRule }}',
'{{ AlarmDescription }}',
'{{ ActionsEnabled }}',
'{{ OKActions }}',
'{{ AlarmActions }}',
'{{ InsufficientDataActions }}',
'{{ ActionsSuppressor }}',
'{{ ActionsSuppressorWaitPeriod }}',
'{{ ActionsSuppressorExtensionPeriod }}',
'{{ Tags }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: composite_alarm
props:
- name: AlarmName
value: '{{ AlarmName }}'
- name: AlarmRule
value: '{{ AlarmRule }}'
- name: AlarmDescription
value: '{{ AlarmDescription }}'
- name: ActionsEnabled
value: '{{ ActionsEnabled }}'
- name: OKActions
value:
- '{{ OKActions[0] }}'
- name: AlarmActions
value:
- '{{ AlarmActions[0] }}'
- name: InsufficientDataActions
value:
- '{{ InsufficientDataActions[0] }}'
- name: ActionsSuppressor
value: '{{ ActionsSuppressor }}'
- name: ActionsSuppressorWaitPeriod
value: '{{ ActionsSuppressorWaitPeriod }}'
- name: ActionsSuppressorExtensionPeriod
value: '{{ ActionsSuppressorExtensionPeriod }}'
- name: Tags
value:
- Key: '{{ Key }}'
Value: '{{ Value }}'
DELETE
example
/*+ delete */
DELETE FROM aws.cloudwatch.composite_alarms
WHERE data__Identifier = '<AlarmName>'
AND region = 'us-east-1';
Permissions
To operate on the composite_alarms
resource, the following permissions are required:
Create
cloudwatch:DescribeAlarms,
cloudwatch:PutCompositeAlarm,
cloudwatch:TagResource
Read
cloudwatch:DescribeAlarms,
cloudwatch:ListTagsForResource
Update
cloudwatch:DescribeAlarms,
cloudwatch:PutCompositeAlarm,
cloudwatch:TagResource,
cloudwatch:UntagResource
Delete
cloudwatch:DescribeAlarms,
cloudwatch:DeleteAlarms
List
cloudwatch:DescribeAlarms