monitors
Creates, updates, deletes, gets or lists a monitors resource.
Overview
| Name | monitors |
| Type | Resource |
| Id | aws.networkflowmonitor.monitors |
Fields
The following fields are returned by SELECT queries:
- get_monitor
- list_monitors
| Name | Datatype | Description |
|---|---|---|
created_at | string (date-time) | The date and time when the monitor was created. |
local_resources | array | The local resources to monitor. A local resource in a workload is the location of the hosts where the Network Flow Monitor agent is installed. |
modified_at | string (date-time) | The date and time when the monitor was last modified. |
monitor_arn | string | The Amazon Resource Name (ARN) of the monitor. (pattern: <code>arn:.*</code>) |
monitor_name | string | The name of the monitor. (pattern: <code>[a-zA-Z0-9_.-]+</code>) |
monitor_status | string | The status of a monitor. The status can be one of the following PENDING: The monitor is in the process of being created. ACTIVE: The monitor is active. INACTIVE: The monitor is inactive. ERROR: Monitor creation failed due to an error. DELETING: The monitor is in the process of being deleted. (PENDING, ACTIVE, INACTIVE, ERROR, DELETING) |
remote_resources | array | The remote resources to monitor. A remote resource is the other endpoint specified for the network flow of a workload, with a local resource. For example, Amazon Dynamo DB can be a remote resource. |
tags | object | The tags for a monitor. |
| Name | Datatype | Description |
|---|---|---|
monitor_arn | string | The Amazon Resource Name (ARN) of the monitor. (pattern: <code>arn:.*</code>) |
monitor_name | string | The name of the monitor. (pattern: <code>[a-zA-Z0-9_.-]+</code>) |
monitor_status | string | The status of a monitor. The status can be one of the following PENDING: The monitor is in the process of being created. ACTIVE: The monitor is active. INACTIVE: The monitor is inactive. ERROR: Monitor creation failed due to an error. DELETING: The monitor is in the process of being deleted. (PENDING, ACTIVE, INACTIVE, ERROR, DELETING) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_monitor | select | monitor_name, region | Gets information about a monitor in Network Flow Monitor based on a monitor name. The information returned includes the Amazon Resource Name (ARN), create time, modified time, resources included in the monitor, and status information. | |
list_monitors | select | region | nextToken, maxResults, monitorStatus | List all monitors in an account. Optionally, you can list only monitors that have a specific status, by using the STATUS parameter. |
create_monitor | insert | region, monitorName, localResources, scopeArn | Create a monitor for specific network flows between local and remote resources, so that you can monitor network performance for one or several of your workloads. For each monitor, Network Flow Monitor publishes detailed end-to-end performance metrics and a network health indicator (NHI) that informs you whether there were Amazon Web Services network issues for one or more of the network flows tracked by a monitor, during a time period that you choose. | |
update_monitor | update | monitor_name, region | Update a monitor to add or remove local or remote resources. | |
delete_monitor | delete | monitor_name, region | Deletes a monitor in Network Flow Monitor. | |
start_query_monitor_top_contributors | exec | monitor_name, region, startTime, endTime, metricName, destinationCategory | Create a query that you can use with the Network Flow Monitor query interface to return the top contributors for a monitor. Specify the monitor that you want to create the query for. The call returns a query ID that you can use with GetQueryResultsMonitorTopContributors to run the query and return the top contributors for a specific monitor. Top contributors in Network Flow Monitor are network flows with the highest values for a specific metric type. Top contributors can be across all workload insights, for a given scope, or for a specific monitor. Use the applicable APIs for the top contributors that you want to be returned. | |
stop_query_monitor_top_contributors | exec | monitor_name, query_id, region | Stop a top contributors query for a monitor. Specify the query that you want to stop by providing a query ID and a monitor name. Top contributors in Network Flow Monitor are network flows with the highest values for a specific metric type. Top contributors can be across all workload insights, for a given scope, or for a specific monitor. Use the applicable call for the top contributors that you want to be returned. |
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.
| Name | Datatype | Description |
|---|---|---|
monitor_name | string | The name of the monitor. |
query_id | string | The identifier for the query. A query ID is an internally-generated identifier for a specific query returned from an API call to create a query. |
region | string | AWS region (default: us-east-1) |
maxResults | integer | The number of query results that you want to return with this call. |
monitorStatus | string | The status of a monitor. The status can be one of the following PENDING: The monitor is in the process of being created. ACTIVE: The monitor is active. INACTIVE: The monitor is inactive. ERROR: Monitor creation failed due to an error. DELETING: The monitor is in the process of being deleted. |
nextToken | string | The token for the next set of results. You receive this token from a previous call. |
SELECT examples
- get_monitor
- list_monitors
Gets information about a monitor in Network Flow Monitor based on a monitor name. The information returned includes the Amazon Resource Name (ARN), create time, modified time, resources included in the monitor, and status information.
SELECT
created_at,
local_resources,
modified_at,
monitor_arn,
monitor_name,
monitor_status,
remote_resources,
tags
FROM aws.networkflowmonitor.monitors
WHERE monitor_name = '{{ monitor_name }}' -- required
AND region = '{{ region }}' -- required
;
List all monitors in an account. Optionally, you can list only monitors that have a specific status, by using the STATUS parameter.
SELECT
monitor_arn,
monitor_name,
monitor_status
FROM aws.networkflowmonitor.monitors
WHERE region = '{{ region }}' -- required
AND nextToken = '{{ nextToken }}'
AND maxResults = '{{ maxResults }}'
AND monitorStatus = '{{ monitorStatus }}'
;
INSERT examples
- create_monitor
- Manifest
Create a monitor for specific network flows between local and remote resources, so that you can monitor network performance for one or several of your workloads. For each monitor, Network Flow Monitor publishes detailed end-to-end performance metrics and a network health indicator (NHI) that informs you whether there were Amazon Web Services network issues for one or more of the network flows tracked by a monitor, during a time period that you choose.
INSERT INTO aws.networkflowmonitor.monitors (
monitorName,
localResources,
remoteResources,
scopeArn,
clientToken,
tags,
region
)
SELECT
'{{ monitorName }}' /* required */,
'{{ localResources }}' /* required */,
'{{ remoteResources }}',
'{{ scopeArn }}' /* required */,
'{{ clientToken }}',
'{{ tags }}',
'{{ region }}'
RETURNING
created_at,
local_resources,
modified_at,
monitor_arn,
monitor_name,
monitor_status,
remote_resources,
tags
;
# Description fields are for documentation purposes
- name: monitors
props:
- name: region
value: "{{ region }}"
description: Required parameter for the monitors resource.
- name: monitorName
value: "{{ monitorName }}"
- name: localResources
value:
- type_: "{{ type_ }}"
identifier: "{{ identifier }}"
- name: remoteResources
value:
- type_: "{{ type_ }}"
identifier: "{{ identifier }}"
- name: scopeArn
value: "{{ scopeArn }}"
- name: clientToken
value: "{{ clientToken }}"
- name: tags
value: "{{ tags }}"
UPDATE examples
- update_monitor
Update a monitor to add or remove local or remote resources.
UPDATE aws.networkflowmonitor.monitors
SET
localResourcesToAdd = '{{ localResourcesToAdd }}',
localResourcesToRemove = '{{ localResourcesToRemove }}',
remoteResourcesToAdd = '{{ remoteResourcesToAdd }}',
remoteResourcesToRemove = '{{ remoteResourcesToRemove }}',
clientToken = '{{ clientToken }}'
WHERE
monitor_name = '{{ monitor_name }}' --required
AND region = '{{ region }}' --required
RETURNING
created_at,
local_resources,
modified_at,
monitor_arn,
monitor_name,
monitor_status,
remote_resources,
tags;
DELETE examples
- delete_monitor
Deletes a monitor in Network Flow Monitor.
DELETE FROM aws.networkflowmonitor.monitors
WHERE monitor_name = '{{ monitor_name }}' --required
AND region = '{{ region }}' --required
;
Lifecycle Methods
- start_query_monitor_top_contributors
- stop_query_monitor_top_contributors
Create a query that you can use with the Network Flow Monitor query interface to return the top contributors for a monitor. Specify the monitor that you want to create the query for. The call returns a query ID that you can use with GetQueryResultsMonitorTopContributors to run the query and return the top contributors for a specific monitor. Top contributors in Network Flow Monitor are network flows with the highest values for a specific metric type. Top contributors can be across all workload insights, for a given scope, or for a specific monitor. Use the applicable APIs for the top contributors that you want to be returned.
EXEC aws.networkflowmonitor.monitors.start_query_monitor_top_contributors
@monitor_name='{{ monitor_name }}' --required,
@region='{{ region }}' --required
@@json=
'{
"startTime": "{{ startTime }}",
"endTime": "{{ endTime }}",
"metricName": "{{ metricName }}",
"destinationCategory": "{{ destinationCategory }}",
"limit": {{ limit }}
}'
;
Stop a top contributors query for a monitor. Specify the query that you want to stop by providing a query ID and a monitor name. Top contributors in Network Flow Monitor are network flows with the highest values for a specific metric type. Top contributors can be across all workload insights, for a given scope, or for a specific monitor. Use the applicable call for the top contributors that you want to be returned.
EXEC aws.networkflowmonitor.monitors.stop_query_monitor_top_contributors
@monitor_name='{{ monitor_name }}' --required,
@query_id='{{ query_id }}' --required,
@region='{{ region }}' --required
;