CloudWatchNetworkMonitor / Client / create_monitor

create_monitor#

CloudWatchNetworkMonitor.Client.create_monitor(**kwargs)#

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.

See also: AWS API Documentation

Request Syntax

response = client.create_monitor(
    monitorName='string',
    probes=[
        {
            'sourceArn': 'string',
            'destination': 'string',
            'destinationPort': 123,
            'protocol': 'TCP'|'ICMP',
            'packetSize': 123,
            'probeTags': {
                'string': 'string'
            }
        },
    ],
    aggregationPeriod=123,
    clientToken='string',
    tags={
        'string': 'string'
    }
)
Parameters:
  • monitorName (string) –

    [REQUIRED]

    The name identifying the monitor. It can contain only letters, underscores (_), or dashes (-), and can be up to 200 characters.

  • probes (list) –

    Displays a list of all of the probes created for a monitor.

    • (dict) –

      Creates a monitor probe.

      • sourceArn (string) – [REQUIRED]

        The ARN of the subnet.

      • destination (string) – [REQUIRED]

        The destination IP address. This must be either IPV4 or IPV6.

      • destinationPort (integer) –

        The port associated with the destination. This is required only if the protocol is TCP and must be a number between 1 and 65536.

      • protocol (string) – [REQUIRED]

        The protocol used for the network traffic between the source and destination. This must be either TCP or ICMP.

      • packetSize (integer) –

        The size of the packets sent between the source and destination. This must be a number between 56 and 8500.

      • probeTags (dict) –

        The list of key-value pairs created and assigned to the monitor.

        • (string) –

          • (string) –

  • aggregationPeriod (integer) – The time, in seconds, that metrics are aggregated and sent to Amazon CloudWatch. Valid values are either 30 or 60. 60 is the default if no period is chosen.

  • clientToken (string) –

    Unique, case-sensitive identifier to ensure the idempotency of the request. Only returned if a client token was provided in the request.

    This field is autopopulated if not provided.

  • tags (dict) –

    The list of key-value pairs created and assigned to the monitor.

    • (string) –

      • (string) –

Return type:

dict

Returns:

Response Syntax

{
    'monitorArn': 'string',
    'monitorName': 'string',
    'state': 'PENDING'|'ACTIVE'|'INACTIVE'|'ERROR'|'DELETING',
    'aggregationPeriod': 123,
    'tags': {
        'string': 'string'
    }
}

Response Structure

  • (dict) –

    • monitorArn (string) –

      The ARN of the monitor.

    • monitorName (string) –

      The name of the monitor.

    • state (string) –

      The state of the monitor.

    • aggregationPeriod (integer) –

      The number of seconds that metrics are aggregated by and sent to Amazon CloudWatch. This will be either 30 or 60.

    • tags (dict) –

      The list of key-value pairs assigned to the monitor.

      • (string) –

        • (string) –

Exceptions

  • CloudWatchNetworkMonitor.Client.exceptions.AccessDeniedException

  • CloudWatchNetworkMonitor.Client.exceptions.ThrottlingException

  • CloudWatchNetworkMonitor.Client.exceptions.ValidationException

  • CloudWatchNetworkMonitor.Client.exceptions.InternalServerException

  • CloudWatchNetworkMonitor.Client.exceptions.ConflictException

  • CloudWatchNetworkMonitor.Client.exceptions.ServiceQuotaExceededException