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 | awscc.cloudwatch.composite_alarms |
Fields
- get (all properties)
- list (identifiers only)
| 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. |
| Name | Datatype | Description |
|---|---|---|
alarm_name | string | The name of the Composite Alarm |
region | string | AWS region. |
For more information, see AWS::CloudWatch::CompositeAlarm.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | composite_alarms | INSERT | AlarmRule, region |
delete_resource | composite_alarms | DELETE | Identifier, region |
update_resource | composite_alarms | UPDATE | Identifier, PatchDocument, region |
list_resources | composite_alarms_list_only | SELECT | region |
get_resource | composite_alarms | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
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 = 'us-east-1' AND
Identifier = '{{ alarm_name }}';
Lists all composite_alarms in a region.
SELECT
region,
alarm_name
FROM awscc.cloudwatch.composite_alarms_list_only
WHERE
region = 'us-east-1';
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 awscc.cloudwatch.composite_alarms (
AlarmRule,
region
)
SELECT
'{{ alarm_rule }}',
'{{ region }}';
/*+ create */
INSERT INTO awscc.cloudwatch.composite_alarms (
AlarmName,
AlarmRule,
AlarmDescription,
ActionsEnabled,
OKActions,
AlarmActions,
InsufficientDataActions,
ActionsSuppressor,
ActionsSuppressorWaitPeriod,
ActionsSuppressorExtensionPeriod,
Tags,
region
)
SELECT
'{{ 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 }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: composite_alarm
props:
- name: alarm_name
value: '{{ alarm_name }}'
- name: alarm_rule
value: '{{ alarm_rule }}'
- name: alarm_description
value: '{{ alarm_description }}'
- name: actions_enabled
value: '{{ actions_enabled }}'
- name: ok_actions
value:
- '{{ ok_actions[0] }}'
- name: alarm_actions
value:
- '{{ alarm_actions[0] }}'
- name: insufficient_data_actions
value:
- '{{ insufficient_data_actions[0] }}'
- name: actions_suppressor
value: '{{ actions_suppressor }}'
- name: actions_suppressor_wait_period
value: '{{ actions_suppressor_wait_period }}'
- name: actions_suppressor_extension_period
value: '{{ actions_suppressor_extension_period }}'
- name: tags
value:
- key: '{{ key }}'
value: '{{ value }}'
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 }}';
DELETE example
/*+ delete */
DELETE FROM awscc.cloudwatch.composite_alarms
WHERE
Identifier = '{{ alarm_name }}' AND
region = 'us-east-1';
Permissions
To operate on the composite_alarms resource, the following permissions are required:
- Create
- Read
- Update
- Delete
- List
cloudwatch:DescribeAlarms,
cloudwatch:PutCompositeAlarm,
cloudwatch:TagResource
cloudwatch:DescribeAlarms,
cloudwatch:ListTagsForResource
cloudwatch:DescribeAlarms,
cloudwatch:PutCompositeAlarm,
cloudwatch:TagResource,
cloudwatch:UntagResource
cloudwatch:DescribeAlarms,
cloudwatch:DeleteAlarms
cloudwatch:DescribeAlarms