Skip to content

delete_local_gateway_route

delete_local_gateway_route(
    *,
    config_overrides: Optional[EC2ClientConfig] = None,
    destination_cidr_block: Optional[String] = None,
    local_gateway_route_table_id: Optional[LocalGatewayRoutetableId] = None,
    dry_run: Optional[Boolean] = None,
    destination_prefix_list_id: Optional[PrefixListResourceId] = None,
) -> DeleteLocalGatewayRouteResult

Deletes the specified route from the specified local gateway route table.

Parameters:

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

    The CIDR range for the route. This must match the CIDR for the route exactly.

  • local_gateway_route_table_id (Optional[LocalGatewayRoutetableId], default: None ) –

    The ID of the local gateway route table.

  • 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.

  • destination_prefix_list_id (Optional[PrefixListResourceId], default: None ) –

    Use a prefix list in place of DestinationCidrBlock. You cannot use DestinationPrefixListId and DestinationCidrBlock in the same request.

Raises:

Source code in docs_src/capo_ec2/_services/ec2.py
def delete_local_gateway_route(
    self,
    *,
    config_overrides: Optional[EC2ClientConfig] = None,
    destination_cidr_block: Optional["capo_ec2.types.string.String"] = None,
    local_gateway_route_table_id: Optional[
        "capo_ec2.types.local_gateway_routetable_id.LocalGatewayRoutetableId"
    ] = None,
    dry_run: Optional["capo_ec2.types.boolean.Boolean"] = None,
    destination_prefix_list_id: Optional[
        "capo_ec2.types.prefix_list_resource_id.PrefixListResourceId"
    ] = None,
) -> (
    "capo_ec2.types.delete_local_gateway_route_result.DeleteLocalGatewayRouteResult"
):
    """<p>Deletes the specified route from the specified local gateway route table.</p>

    Args:
        destination_cidr_block: <p>The CIDR range for the route. This must match the CIDR for the route exactly.</p>
        local_gateway_route_table_id: <p>The ID of the local gateway route table.</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>
        destination_prefix_list_id: <p> Use a prefix list in place of <code>DestinationCidrBlock</code>. You cannot use <code>DestinationPrefixListId</code> and <code>DestinationCidrBlock</code> in the same request. </p>

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

    def _handler(
        req: "OperationRequest[capo_ec2.types.delete_local_gateway_route_request.DeleteLocalGatewayRouteRequest]",
    ) -> OperationResponse[
        "capo_ec2.types.delete_local_gateway_route_result.DeleteLocalGatewayRouteResult"
    ]:
        import capo_ec2._operations.amazon_ec2.delete_local_gateway_route

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteLocalGatewayRoute")
    )
    input_: capo_ec2.types.delete_local_gateway_route_request.DeleteLocalGatewayRouteRequest = {}
    if destination_cidr_block is not None:
        input_["destination_cidr_block"] = destination_cidr_block
    if local_gateway_route_table_id is not None:
        input_["local_gateway_route_table_id"] = local_gateway_route_table_id
    if dry_run is not None:
        input_["dry_run"] = dry_run
    if destination_prefix_list_id is not None:
        input_["destination_prefix_list_id"] = destination_prefix_list_id

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