Skip to content

create_monitor async

create_monitor(
    monitor_name: ResourceName,
    local_resources: MonitorLocalResources,
    scope_arn: Arn,
    *,
    config_overrides: Optional[AsyncNetworkFlowMonitorClientConfig] = None,
    remote_resources: Optional[MonitorRemoteResources] = None,
    client_token: Optional[UuidString] = None,
    tags: Optional[TagMap] = None,
) -> CreateMonitorOutput

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.

Parameters:

  • monitor_name (ResourceName) –

    The name of the monitor.

  • local_resources (MonitorLocalResources) –

    The local resources to monitor. A local resource in a workload is the location of the host, or hosts, where the Network Flow Monitor agent is installed. For example, if a workload consists of an interaction between a web service and a backend database (for example, Amazon Dynamo DB), the subnet with the EC2 instance that hosts the web service, which also runs the agent, is the local resource.

    Be aware that all local resources must belong to the current Region.

  • remote_resources (Optional[MonitorRemoteResources], default: None ) –

    The remote resources to monitor. A remote resource is the other endpoint in the bi-directional flow of a workload, with a local resource. For example, Amazon Dynamo DB can be a remote resource.

    When you specify remote resources, be aware that specific combinations of resources are allowed and others are not, including the following constraints:

    • All remote resources that you specify must all belong to a single Region.

    • If you specify Amazon Web Services services as remote resources, any other remote resources that you specify must be in the current Region.

    • When you specify a remote resource for another Region, you can only specify the Region resource type. You cannot specify a subnet, VPC, or Availability Zone in another Region.

    • If you leave the RemoteResources parameter empty, the monitor will include all network flows that terminate in the current Region.

  • scope_arn (Arn) –

    The Amazon Resource Name (ARN) of the scope for the monitor.

  • client_token (Optional[UuidString], default: None ) –

    A unique, case-sensitive string of up to 64 ASCII characters that you specify to make an idempotent API request. Don't reuse the same client token for other API requests.

  • tags (Optional[TagMap], default: None ) –

    The tags for a monitor. You can add a maximum of 200 tags.

Raises:

Source code in docs_src/capo_networkflowmonitor/_services/async_network_flow_monitor.py
async def create_monitor(
    self,
    monitor_name: "capo_networkflowmonitor.types.resource_name.ResourceName",
    local_resources: "capo_networkflowmonitor.types.monitor_local_resources.MonitorLocalResources",
    scope_arn: "capo_networkflowmonitor.types.arn.Arn",
    *,
    config_overrides: Optional[AsyncNetworkFlowMonitorClientConfig] = None,
    remote_resources: Optional[
        "capo_networkflowmonitor.types.monitor_remote_resources.MonitorRemoteResources"
    ] = None,
    client_token: Optional[
        "capo_networkflowmonitor.types.uuid_string.UuidString"
    ] = None,
    tags: Optional["capo_networkflowmonitor.types.tag_map.TagMap"] = None,
) -> "capo_networkflowmonitor.types.create_monitor_output.CreateMonitorOutput":
    """<p>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. </p>

    Args:
        monitor_name: <p>The name of the monitor. </p>
        local_resources: <p>The local resources to monitor. A local resource in a workload is the location of the host, or hosts, where the Network Flow Monitor agent is installed. For example, if a workload consists of an interaction between a web service and a backend database (for example, Amazon Dynamo DB), the subnet with the EC2 instance that hosts the web service, which also runs the agent, is the local resource.</p> <p>Be aware that all local resources must belong to the current Region.</p>
        remote_resources: <p>The remote resources to monitor. A remote resource is the other endpoint in the bi-directional flow of a workload, with a local resource. For example, Amazon Dynamo DB can be a remote resource.</p> <p>When you specify remote resources, be aware that specific combinations of resources are allowed and others are not, including the following constraints:</p> <ul> <li> <p>All remote resources that you specify must all belong to a single Region.</p> </li> <li> <p>If you specify Amazon Web Services services as remote resources, any other remote resources that you specify must be in the current Region.</p> </li> <li> <p>When you specify a remote resource for another Region, you can only specify the <code>Region</code> resource type. You cannot specify a subnet, VPC, or Availability Zone in another Region.</p> </li> <li> <p>If you leave the <code>RemoteResources</code> parameter empty, the monitor will include all network flows that terminate in the current Region.</p> </li> </ul>
        scope_arn: <p>The Amazon Resource Name (ARN) of the scope for the monitor.</p>
        client_token: <p>A unique, case-sensitive string of up to 64 ASCII characters that you specify to make an idempotent API request. Don't reuse the same client token for other API requests.</p>
        tags: <p>The tags for a monitor. You can add a maximum of 200 tags.</p>

    Raises:
        capo_networkflowmonitor.errors.access_denied_exception.AccessDeniedException: <p>You don't have sufficient permission to perform this action.</p>
        capo_networkflowmonitor.errors.conflict_exception.ConflictException: <p>The requested resource is in use.</p>
        capo_networkflowmonitor.errors.internal_server_exception.InternalServerException: <p>An internal error occurred.</p>
        capo_networkflowmonitor.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The request exceeded a service quota.</p>
        capo_networkflowmonitor.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_networkflowmonitor.errors.validation_exception.ValidationException: <p>Invalid request.</p>
        capo_networkflowmonitor.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_networkflowmonitor.types.create_monitor_input.CreateMonitorInput]",
    ) -> AsyncOperationResponse[
        "capo_networkflowmonitor.types.create_monitor_output.CreateMonitorOutput"
    ]:
        import capo_networkflowmonitor._operations.network_flow_monitor.create_monitor

        (
            output,
            http_response,
        ) = await capo_networkflowmonitor._operations.network_flow_monitor.create_monitor.async_create_monitor(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateMonitor")
    )
    input_: capo_networkflowmonitor.types.create_monitor_input.CreateMonitorInput = {
        "monitor_name": monitor_name,
        "local_resources": local_resources,
        "scope_arn": scope_arn,
    }
    if remote_resources is not None:
        input_["remote_resources"] = remote_resources
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token
    if tags is not None:
        input_["tags"] = tags

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output