Skip to content

create_network_insights_path

create_network_insights_path(
    *,
    config_overrides: Optional[EC2ClientConfig] = None,
    source_ip: Optional[IpAddress] = None,
    destination_ip: Optional[IpAddress] = None,
    source: Optional[NetworkInsightsResourceId] = None,
    destination: Optional[NetworkInsightsResourceId] = None,
    protocol: Optional[Protocol] = None,
    destination_port: Optional[Port] = None,
    tag_specifications: Optional[TagSpecificationList] = None,
    dry_run: Optional[Boolean] = None,
    client_token: Optional[String] = None,
    filter_at_source: Optional[PathRequestFilter] = None,
    filter_at_destination: Optional[PathRequestFilter] = None,
) -> CreateNetworkInsightsPathResult

Creates a path to analyze for reachability.

Reachability Analyzer enables you to analyze and debug network reachability between two resources in your virtual private cloud (VPC). For more information, see the Reachability Analyzer Guide.

Parameters:

  • source_ip (Optional[IpAddress], default: None ) –

    The IP address of the source.

  • destination_ip (Optional[IpAddress], default: None ) –

    The IP address of the destination.

  • source (Optional[NetworkInsightsResourceId], default: None ) –

    The ID or ARN of the source. If the resource is in another account, you must specify an ARN.

  • destination (Optional[NetworkInsightsResourceId], default: None ) –

    The ID or ARN of the destination. If the resource is in another account, you must specify an ARN.

  • protocol (Optional[Protocol], default: None ) –

    The protocol.

  • destination_port (Optional[Port], default: None ) –

    The destination port.

  • tag_specifications (Optional[TagSpecificationList], default: None ) –

    The tags to add to the path.

  • dry_run (Optional[Boolean], default: None ) –

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

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

    Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see How to ensure idempotency.

  • filter_at_source (Optional[PathRequestFilter], default: None ) –

    Scopes the analysis to network paths that match specific filters at the source. If you specify this parameter, you can't specify the parameters for the source IP address or the destination port.

  • filter_at_destination (Optional[PathRequestFilter], default: None ) –

    Scopes the analysis to network paths that match specific filters at the destination. If you specify this parameter, you can't specify the parameter for the destination IP address.

Raises:

Source code in docs_src/capo_ec2/_services/ec2.py
def create_network_insights_path(
    self,
    *,
    config_overrides: Optional[EC2ClientConfig] = None,
    source_ip: Optional["capo_ec2.types.ip_address.IpAddress"] = None,
    destination_ip: Optional["capo_ec2.types.ip_address.IpAddress"] = None,
    source: Optional[
        "capo_ec2.types.network_insights_resource_id.NetworkInsightsResourceId"
    ] = None,
    destination: Optional[
        "capo_ec2.types.network_insights_resource_id.NetworkInsightsResourceId"
    ] = None,
    protocol: Optional["capo_ec2.types.protocol.Protocol"] = None,
    destination_port: Optional["capo_ec2.types.port.Port"] = None,
    tag_specifications: Optional[
        "capo_ec2.types.tag_specification_list.TagSpecificationList"
    ] = None,
    dry_run: Optional["capo_ec2.types.boolean.Boolean"] = None,
    client_token: Optional["capo_ec2.types.string.String"] = None,
    filter_at_source: Optional[
        "capo_ec2.types.path_request_filter.PathRequestFilter"
    ] = None,
    filter_at_destination: Optional[
        "capo_ec2.types.path_request_filter.PathRequestFilter"
    ] = None,
) -> "capo_ec2.types.create_network_insights_path_result.CreateNetworkInsightsPathResult":
    """<p>Creates a path to analyze for reachability.</p> <p>Reachability Analyzer enables you to analyze and debug network reachability between two resources in your virtual private cloud (VPC). For more information, see the <a href="https://docs.aws.amazon.com/vpc/latest/reachability/">Reachability Analyzer Guide</a>.</p>

    Args:
        source_ip: <p>The IP address of the source.</p>
        destination_ip: <p>The IP address of the destination.</p>
        source: <p>The ID or ARN of the source. If the resource is in another account, you must specify an ARN.</p>
        destination: <p>The ID or ARN of the destination. If the resource is in another account, you must specify an ARN.</p>
        protocol: <p>The protocol.</p>
        destination_port: <p>The destination port.</p>
        tag_specifications: <p>The tags to add to the path.</p>
        dry_run: <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
        client_token: <p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see <a href="https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html">How to ensure idempotency</a>.</p>
        filter_at_source: <p>Scopes the analysis to network paths that match specific filters at the source. If you specify this parameter, you can't specify the parameters for the source IP address or the destination port.</p>
        filter_at_destination: <p>Scopes the analysis to network paths that match specific filters at the destination. If you specify this parameter, you can't specify the parameter for the destination IP address.</p>

    Raises:
        capo_ec2.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_ec2.types.create_network_insights_path_request.CreateNetworkInsightsPathRequest]",
    ) -> OperationResponse[
        "capo_ec2.types.create_network_insights_path_result.CreateNetworkInsightsPathResult"
    ]:
        import capo_ec2._operations.amazon_ec2.create_network_insights_path

        output, http_response = (
            capo_ec2._operations.amazon_ec2.create_network_insights_path.create_network_insights_path(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateNetworkInsightsPath")
    )
    input_: capo_ec2.types.create_network_insights_path_request.CreateNetworkInsightsPathRequest = {}
    if source_ip is not None:
        input_["source_ip"] = source_ip
    if destination_ip is not None:
        input_["destination_ip"] = destination_ip
    if source is not None:
        input_["source"] = source
    if destination is not None:
        input_["destination"] = destination
    if protocol is not None:
        input_["protocol"] = protocol
    if destination_port is not None:
        input_["destination_port"] = destination_port
    if tag_specifications is not None:
        input_["tag_specifications"] = tag_specifications
    if dry_run is not None:
        input_["dry_run"] = dry_run
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token
    if filter_at_source is not None:
        input_["filter_at_source"] = filter_at_source
    if filter_at_destination is not None:
        input_["filter_at_destination"] = filter_at_destination

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output