monitors
Creates, updates, deletes or gets a monitor resource or lists monitors in a region
Overview
| Name | monitors |
| Type | Resource |
| Description | Represents a monitor, which defines the monitoring boundaries for measurements that Internet Monitor publishes information about for an application |
| Id | awscc.internetmonitor.monitors |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
created_at | string | The date value in ISO 8601 format. The timezone is always UTC. (YYYY-MM-DDThh:mm:ssZ) |
monitor_arn | string | |
monitor_name | string | |
linked_account_id | string | |
include_linked_accounts | boolean | |
processing_status | string | |
processing_status_info | string | |
resources | array | |
resources_to_add | array | |
resources_to_remove | array | |
status | string | |
tags | array | |
max_city_networks_to_monitor | integer | |
traffic_percentage_to_monitor | integer | |
internet_measurements_log_delivery | object | |
health_events_config | object | |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
monitor_name | string | |
region | string | AWS region. |
For more information, see AWS::InternetMonitor::Monitor.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | monitors | INSERT | MonitorName, region |
delete_resource | monitors | DELETE | Identifier, region |
update_resource | monitors | UPDATE | Identifier, PatchDocument, region |
list_resources | monitors_list_only | SELECT | region |
get_resource | monitors | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual monitor.
SELECT
region,
created_at,
modified_at,
monitor_arn,
monitor_name,
linked_account_id,
include_linked_accounts,
processing_status,
processing_status_info,
resources,
resources_to_add,
resources_to_remove,
status,
tags,
max_city_networks_to_monitor,
traffic_percentage_to_monitor,
internet_measurements_log_delivery,
health_events_config
FROM awscc.internetmonitor.monitors
WHERE
region = '{{ region }}' AND
Identifier = '{{ monitor_name }}';
Lists all monitors in a region.
SELECT
region,
monitor_name
FROM awscc.internetmonitor.monitors_list_only
WHERE
region = '{{ region }}';
INSERT example
Use the following StackQL query and manifest file to create a new monitor resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.internetmonitor.monitors (
MonitorName,
region
)
SELECT
'{{ monitor_name }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.internetmonitor.monitors (
MonitorName,
LinkedAccountId,
IncludeLinkedAccounts,
Resources,
ResourcesToAdd,
ResourcesToRemove,
Status,
Tags,
MaxCityNetworksToMonitor,
TrafficPercentageToMonitor,
InternetMeasurementsLogDelivery,
HealthEventsConfig,
region
)
SELECT
'{{ monitor_name }}',
'{{ linked_account_id }}',
'{{ include_linked_accounts }}',
'{{ resources }}',
'{{ resources_to_add }}',
'{{ resources_to_remove }}',
'{{ status }}',
'{{ tags }}',
'{{ max_city_networks_to_monitor }}',
'{{ traffic_percentage_to_monitor }}',
'{{ internet_measurements_log_delivery }}',
'{{ health_events_config }}',
'{{ 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: monitor
props:
- name: monitor_name
value: '{{ monitor_name }}'
- name: linked_account_id
value: '{{ linked_account_id }}'
- name: include_linked_accounts
value: '{{ include_linked_accounts }}'
- name: resources
value:
- '{{ resources[0] }}'
- name: resources_to_add
value:
- '{{ resources_to_add[0] }}'
- name: resources_to_remove
value:
- '{{ resources_to_remove[0] }}'
- name: status
value: '{{ status }}'
- name: tags
value:
- key: '{{ key }}'
value: '{{ value }}'
- name: max_city_networks_to_monitor
value: '{{ max_city_networks_to_monitor }}'
- name: traffic_percentage_to_monitor
value: '{{ traffic_percentage_to_monitor }}'
- name: internet_measurements_log_delivery
value:
s3_config:
bucket_name: '{{ bucket_name }}'
bucket_prefix: '{{ bucket_prefix }}'
log_delivery_status: '{{ log_delivery_status }}'
- name: health_events_config
value:
availability_score_threshold: null
performance_score_threshold: null
availability_local_health_events_config:
status: '{{ status }}'
health_score_threshold: null
min_traffic_impact: null
performance_local_health_events_config: null
UPDATE example
Use the following StackQL query and manifest file to update a monitor resource, using stack-deploy.
/*+ update */
UPDATE awscc.internetmonitor.monitors
SET PatchDocument = string('{{ {
"LinkedAccountId": linked_account_id,
"IncludeLinkedAccounts": include_linked_accounts,
"Resources": resources,
"ResourcesToAdd": resources_to_add,
"ResourcesToRemove": resources_to_remove,
"Status": status,
"Tags": tags,
"MaxCityNetworksToMonitor": max_city_networks_to_monitor,
"TrafficPercentageToMonitor": traffic_percentage_to_monitor,
"InternetMeasurementsLogDelivery": internet_measurements_log_delivery,
"HealthEventsConfig": health_events_config
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ monitor_name }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
DELETE example
/*+ delete */
DELETE FROM awscc.internetmonitor.monitors
WHERE
Identifier = '{{ monitor_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:
| 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 monitors resource, the following permissions are required:
- Create
- Read
- Update
- Delete
- List
internetmonitor:CreateMonitor,
internetmonitor:GetMonitor,
internetmonitor:TagResource,
internetmonitor:UntagResource,
logs:CreateLogDelivery,
logs:GetLogDelivery,
s3:GetBucketPolicy,
s3:PutBucketPolicy,
s3:ListBucket,
iam:PassRole
internetmonitor:GetMonitor,
internetmonitor:ListTagsForResource,
logs:GetLogDelivery
internetmonitor:CreateMonitor,
internetmonitor:GetMonitor,
internetmonitor:UpdateMonitor,
internetmonitor:TagResource,
internetmonitor:UntagResource,
logs:CreateLogDelivery,
logs:GetLogDelivery,
logs:UpdateLogDelivery,
logs:DeleteLogDelivery,
logs:ListLogDeliveries,
s3:GetBucketPolicy,
s3:PutBucketPolicy,
s3:ListBucket,
iam:PassRole
internetmonitor:UpdateMonitor,
internetmonitor:DeleteMonitor,
internetmonitor:GetMonitor,
logs:DeleteLogDelivery
internetmonitor:ListMonitors,
internetmonitor:GetMonitor,
internetmonitor:ListTagsForResource,
logs:GetLogDelivery