Skip to content

modify_local_gateway_route

modify_local_gateway_route(
    *,
    config_overrides: Optional[EC2ClientConfig] = None,
    destination_cidr_block: Optional[String] = None,
    local_gateway_route_table_id: Optional[LocalGatewayRoutetableId] = None,
    local_gateway_virtual_interface_group_id: Optional[
        LocalGatewayVirtualInterfaceGroupId
    ] = None,
    network_interface_id: Optional[NetworkInterfaceId] = None,
    dry_run: Optional[Boolean] = None,
    destination_prefix_list_id: Optional[PrefixListResourceId] = None,
) -> ModifyLocalGatewayRouteResult

Modifies the specified local gateway route.

Parameters:

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

    The CIDR block used for destination matches. The value that you provide must match the CIDR of an existing route in the table.

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

    The ID of the local gateway route table.

  • local_gateway_virtual_interface_group_id (Optional[LocalGatewayVirtualInterfaceGroupId], default: None ) –

    The ID of the virtual interface group.

  • network_interface_id (Optional[NetworkInterfaceId], default: None ) –

    The ID of the network interface.

  • 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 ) –

    The ID of the prefix list. 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 modify_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,
    local_gateway_virtual_interface_group_id: Optional[
        "capo_ec2.types.local_gateway_virtual_interface_group_id.LocalGatewayVirtualInterfaceGroupId"
    ] = None,
    network_interface_id: Optional[
        "capo_ec2.types.network_interface_id.NetworkInterfaceId"
    ] = 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.modify_local_gateway_route_result.ModifyLocalGatewayRouteResult"
):
    """<p>Modifies the specified local gateway route.</p>

    Args:
        destination_cidr_block: <p>The CIDR block used for destination matches. The value that you provide must match the CIDR of an existing route in the table.</p>
        local_gateway_route_table_id: <p>The ID of the local gateway route table.</p>
        local_gateway_virtual_interface_group_id: <p> The ID of the virtual interface group. </p>
        network_interface_id: <p>The ID of the network interface.</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> The ID of the prefix list. 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.modify_local_gateway_route_request.ModifyLocalGatewayRouteRequest]",
    ) -> OperationResponse[
        "capo_ec2.types.modify_local_gateway_route_result.ModifyLocalGatewayRouteResult"
    ]:
        import capo_ec2._operations.amazon_ec2.modify_local_gateway_route

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ModifyLocalGatewayRoute")
    )
    input_: capo_ec2.types.modify_local_gateway_route_request.ModifyLocalGatewayRouteRequest = {}
    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 local_gateway_virtual_interface_group_id is not None:
        input_["local_gateway_virtual_interface_group_id"] = (
            local_gateway_virtual_interface_group_id
        )
    if network_interface_id is not None:
        input_["network_interface_id"] = network_interface_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