cloud_watch_alarm_templates
Creates, updates, deletes or gets a cloud_watch_alarm_template resource or lists cloud_watch_alarm_templates in a region
Overview
| Name | cloud_watch_alarm_templates |
| Type | Resource |
| Description | Definition of AWS::MediaLive::CloudWatchAlarmTemplate Resource Type |
| Id | awscc.medialive.cloud_watch_alarm_templates |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
arn | string | A cloudwatch alarm template's ARN (Amazon Resource Name) |
comparison_operator | string | The comparison operator used to compare the specified statistic and the threshold. |
created_at | string | |
datapoints_to_alarm | number | The number of datapoints within the evaluation period that must be breaching to trigger the alarm. |
description | string | A resource's optional description. |
evaluation_periods | number | The number of periods over which data is compared to the specified threshold. |
group_id | string | A cloudwatch alarm template group's id. AWS provided template groups have ids that start with aws- |
group_identifier | string | A cloudwatch alarm template group's identifier. Can be either be its id or current name. |
id | string | A cloudwatch alarm template's id. AWS provided templates have ids that start with aws- |
identifier | string | |
metric_name | string | The name of the metric associated with the alarm. Must be compatible with targetResourceType. |
modified_at | string | |
name | string | A resource's name. Names must be unique within the scope of a resource type in a specific region. |
period | number | The period, in seconds, over which the specified statistic is applied. |
statistic | string | The statistic to apply to the alarm's metric data. |
tags | object | Represents the tags associated with a resource. |
target_resource_type | string | The resource type this template should dynamically generate cloudwatch metric alarms for. |
threshold | number | The threshold value to compare with the specified statistic. |
treat_missing_data | string | Specifies how missing data points are treated when evaluating the alarm's condition. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
id | string | A cloudwatch alarm template's id. AWS provided templates have ids that start with aws- |
identifier | string | |
region | string | AWS region. |
For more information, see AWS::MediaLive::CloudWatchAlarmTemplate.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | cloud_watch_alarm_templates | INSERT | ComparisonOperator, EvaluationPeriods, MetricName, Name, Period, Statistic, TargetResourceType, Threshold, TreatMissingData, region |
delete_resource | cloud_watch_alarm_templates | DELETE | Identifier, region |
update_resource | cloud_watch_alarm_templates | UPDATE | Identifier, PatchDocument, region |
list_resources | cloud_watch_alarm_templates_list_only | SELECT | region |
get_resource | cloud_watch_alarm_templates | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual cloud_watch_alarm_template.
SELECT
region,
arn,
comparison_operator,
created_at,
datapoints_to_alarm,
description,
evaluation_periods,
group_id,
group_identifier,
id,
identifier,
metric_name,
modified_at,
name,
period,
statistic,
tags,
target_resource_type,
threshold,
treat_missing_data
FROM awscc.medialive.cloud_watch_alarm_templates
WHERE
region = '{{ region }}' AND
Identifier = '{{ identifier }}';
Lists all cloud_watch_alarm_templates in a region.
SELECT
region,
identifier
FROM awscc.medialive.cloud_watch_alarm_templates_list_only
WHERE
region = '{{ region }}';
INSERT example
Use the following StackQL query and manifest file to create a new cloud_watch_alarm_template resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.medialive.cloud_watch_alarm_templates (
ComparisonOperator,
EvaluationPeriods,
MetricName,
Name,
Period,
Statistic,
TargetResourceType,
Threshold,
TreatMissingData,
region
)
SELECT
'{{ comparison_operator }}',
'{{ evaluation_periods }}',
'{{ metric_name }}',
'{{ name }}',
'{{ period }}',
'{{ statistic }}',
'{{ target_resource_type }}',
'{{ threshold }}',
'{{ treat_missing_data }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.medialive.cloud_watch_alarm_templates (
ComparisonOperator,
DatapointsToAlarm,
Description,
EvaluationPeriods,
GroupIdentifier,
MetricName,
Name,
Period,
Statistic,
Tags,
TargetResourceType,
Threshold,
TreatMissingData,
region
)
SELECT
'{{ comparison_operator }}',
'{{ datapoints_to_alarm }}',
'{{ description }}',
'{{ evaluation_periods }}',
'{{ group_identifier }}',
'{{ metric_name }}',
'{{ name }}',
'{{ period }}',
'{{ statistic }}',
'{{ tags }}',
'{{ target_resource_type }}',
'{{ threshold }}',
'{{ treat_missing_data }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: cloud_watch_alarm_template
props:
- name: comparison_operator
value: '{{ comparison_operator }}'
- name: datapoints_to_alarm
value: null
- name: description
value: '{{ description }}'
- name: evaluation_periods
value: null
- name: group_identifier
value: '{{ group_identifier }}'
- name: metric_name
value: '{{ metric_name }}'
- name: name
value: '{{ name }}'
- name: period
value: null
- name: statistic
value: '{{ statistic }}'
- name: tags
value: {}
- name: target_resource_type
value: '{{ target_resource_type }}'
- name: threshold
value: null
- name: treat_missing_data
value: '{{ treat_missing_data }}'
UPDATE example
Use the following StackQL query and manifest file to update a cloud_watch_alarm_template resource, using stack-deploy.
/*+ update */
UPDATE awscc.medialive.cloud_watch_alarm_templates
SET PatchDocument = string('{{ {
"ComparisonOperator": comparison_operator,
"DatapointsToAlarm": datapoints_to_alarm,
"Description": description,
"EvaluationPeriods": evaluation_periods,
"GroupIdentifier": group_identifier,
"MetricName": metric_name,
"Name": name,
"Period": period,
"Statistic": statistic,
"TargetResourceType": target_resource_type,
"Threshold": threshold,
"TreatMissingData": treat_missing_data
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ identifier }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
DELETE example
/*+ delete */
DELETE FROM awscc.medialive.cloud_watch_alarm_templates
WHERE
Identifier = '{{ identifier }}' 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:
| Parameter | Description |
|---|---|
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 cloud_watch_alarm_templates resource, the following permissions are required:
- Create
- Read
- Update
- Delete
- List
medialive:CreateCloudWatchAlarmTemplate,
medialive:GetCloudWatchAlarmTemplate,
medialive:CreateTags
medialive:GetCloudWatchAlarmTemplate
medialive:UpdateCloudWatchAlarmTemplate,
medialive:GetCloudWatchAlarmTemplate,
medialive:CreateTags,
medialive:DeleteTags
medialive:DeleteCloudWatchAlarmTemplate
medialive:ListCloudWatchAlarmTemplates