Skip to main content

monitors

Creates, updates, deletes, gets or lists a monitors resource.

Overview

Namemonitors
TypeResource
Idaws.networkmonitor.monitors

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
aggregation_periodinteger (int64)The aggregation period for the specified monitor.
created_atstring (date-time)The time and date when the monitor was created.
modified_atstring (date-time)The time and date when the monitor was last modified.
monitor_arnstringThe ARN of the selected monitor. (pattern: <code>arn:.*</code>)
monitor_namestringThe name of the monitor. (pattern: <code>[a-zA-Z0-9_-]+</code>)
probesarrayThe details about each probe associated with that monitor.
statestringLists the status of the state of each monitor. (PENDING, ACTIVE, INACTIVE, ERROR, DELETING)
tagsobjectThe list of key-value pairs assigned to the monitor.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_monitorselectmonitor_name, regionReturns details about a specific monitor. This action requires the monitorName parameter. Run ListMonitors to get a list of monitor names.
list_monitorsselectregionnextToken, maxResults, stateReturns a list of all of your monitors.
create_monitorinsertregion, monitorNameCreates a monitor between a source subnet and destination IP address. Within a monitor you'll create one or more probes that monitor network traffic between your source Amazon Web Services VPC subnets and your destination IP addresses. Each probe then aggregates and sends metrics to Amazon CloudWatch. You can also create a monitor with probes using this command. For each probe, you define the following: source—The subnet IDs where the probes will be created. destination— The target destination IP address for the probe. destinationPort—Required only if the protocol is TCP. protocol—The communication protocol between the source and destination. This will be either TCP or ICMP. packetSize—The size of the packets. This must be a number between 56 and 8500. (Optional) tags —Key-value pairs created and assigned to the probe.
update_monitorupdatemonitor_name, region, aggregationPeriodUpdates the aggregationPeriod for a monitor. Monitors support an aggregationPeriod of either 30 or 60 seconds. This action requires the monitorName and probeId parameter. Run ListMonitors to get a list of monitor names.
delete_monitordeletemonitor_name, regionDeletes a specified monitor. This action requires the monitorName parameter. Run ListMonitors to get a list of monitor names.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
monitor_namestringThe name of the monitor to delete.
regionstringAWS region (default: us-east-1)
maxResultsintegerThe maximum number of results to return with a single call. To retrieve the remaining results, make another call with the returned nextToken value. If MaxResults is given a value larger than 100, only 100 results are returned.
nextTokenstringThe token for the next page of results.
statestringThe list of all monitors and their states.

SELECT examples

Returns details about a specific monitor. This action requires the monitorName parameter. Run ListMonitors to get a list of monitor names.

SELECT
aggregation_period,
created_at,
modified_at,
monitor_arn,
monitor_name,
probes,
state,
tags
FROM aws.networkmonitor.monitors
WHERE monitor_name = '{{ monitor_name }}' -- required
AND region = '{{ region }}' -- required
;

INSERT examples

Creates a monitor between a source subnet and destination IP address. Within a monitor you'll create one or more probes that monitor network traffic between your source Amazon Web Services VPC subnets and your destination IP addresses. Each probe then aggregates and sends metrics to Amazon CloudWatch. You can also create a monitor with probes using this command. For each probe, you define the following: source—The subnet IDs where the probes will be created. destination— The target destination IP address for the probe. destinationPort—Required only if the protocol is TCP. protocol—The communication protocol between the source and destination. This will be either TCP or ICMP. packetSize—The size of the packets. This must be a number between 56 and 8500. (Optional) tags —Key-value pairs created and assigned to the probe.

INSERT INTO aws.networkmonitor.monitors (
monitorName,
probes,
aggregationPeriod,
clientToken,
tags,
region
)
SELECT
'{{ monitorName }}' /* required */,
'{{ probes }}',
{{ aggregationPeriod }},
'{{ clientToken }}',
'{{ tags }}',
'{{ region }}'
RETURNING
aggregation_period,
monitor_arn,
monitor_name,
state,
tags
;

UPDATE examples

Updates the aggregationPeriod for a monitor. Monitors support an aggregationPeriod of either 30 or 60 seconds. This action requires the monitorName and probeId parameter. Run ListMonitors to get a list of monitor names.

UPDATE aws.networkmonitor.monitors
SET
aggregationPeriod = {{ aggregationPeriod }}
WHERE
monitor_name = '{{ monitor_name }}' --required
AND region = '{{ region }}' --required
AND aggregationPeriod = '{{ aggregationPeriod }}' --required
RETURNING
aggregation_period,
monitor_arn,
monitor_name,
state,
tags;

DELETE examples

Deletes a specified monitor. This action requires the monitorName parameter. Run ListMonitors to get a list of monitor names.

DELETE FROM aws.networkmonitor.monitors
WHERE monitor_name = '{{ monitor_name }}' --required
AND region = '{{ region }}' --required
;