Skip to content

create_local_gateway_virtual_interface

create_local_gateway_virtual_interface(
    *,
    config_overrides: Optional[EC2ClientConfig] = None,
    local_gateway_virtual_interface_group_id: Optional[
        LocalGatewayVirtualInterfaceGroupId
    ] = None,
    outpost_lag_id: Optional[OutpostLagId] = None,
    vlan: Optional[Integer] = None,
    local_address: Optional[String] = None,
    peer_address: Optional[String] = None,
    peer_bgp_asn: Optional[Integer] = None,
    tag_specifications: Optional[TagSpecificationList] = None,
    dry_run: Optional[Boolean] = None,
    peer_bgp_asn_extended: Optional[Long] = None,
) -> CreateLocalGatewayVirtualInterfaceResult

Create a virtual interface for a local gateway.

Parameters:

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

    The ID of the local gateway virtual interface group.

  • outpost_lag_id (Optional[OutpostLagId], default: None ) –

    References the Link Aggregation Group (LAG) that connects the Outpost to on-premises network devices.

  • vlan (Optional[Integer], default: None ) –

    The virtual local area network (VLAN) used for the local gateway virtual interface.

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

    The IP address assigned to the local gateway virtual interface on the Outpost side. Only IPv4 is supported.

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

    The peer IP address for the local gateway virtual interface. Only IPv4 is supported.

  • peer_bgp_asn (Optional[Integer], default: None ) –

    The Autonomous System Number (ASN) of the Border Gateway Protocol (BGP) peer.

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

    The tags to apply to a resource when the local gateway virtual interface is being created.

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

  • peer_bgp_asn_extended (Optional[Long], default: None ) –

    The extended 32-bit ASN of the BGP peer for use with larger ASN values.

Raises:

Source code in docs_src/capo_ec2/_services/ec2.py
def create_local_gateway_virtual_interface(
    self,
    *,
    config_overrides: Optional[EC2ClientConfig] = None,
    local_gateway_virtual_interface_group_id: Optional[
        "capo_ec2.types.local_gateway_virtual_interface_group_id.LocalGatewayVirtualInterfaceGroupId"
    ] = None,
    outpost_lag_id: Optional["capo_ec2.types.outpost_lag_id.OutpostLagId"] = None,
    vlan: Optional["capo_ec2.types.integer.Integer"] = None,
    local_address: Optional["capo_ec2.types.string.String"] = None,
    peer_address: Optional["capo_ec2.types.string.String"] = None,
    peer_bgp_asn: Optional["capo_ec2.types.integer.Integer"] = None,
    tag_specifications: Optional[
        "capo_ec2.types.tag_specification_list.TagSpecificationList"
    ] = None,
    dry_run: Optional["capo_ec2.types.boolean.Boolean"] = None,
    peer_bgp_asn_extended: Optional["capo_ec2.types.long.Long"] = None,
) -> "capo_ec2.types.create_local_gateway_virtual_interface_result.CreateLocalGatewayVirtualInterfaceResult":
    """<p>Create a virtual interface for a local gateway. </p>

    Args:
        local_gateway_virtual_interface_group_id: <p>The ID of the local gateway virtual interface group.</p>
        outpost_lag_id: <p>References the Link Aggregation Group (LAG) that connects the Outpost to on-premises network devices.</p>
        vlan: <p>The virtual local area network (VLAN) used for the local gateway virtual interface.</p>
        local_address: <p>The IP address assigned to the local gateway virtual interface on the Outpost side. Only IPv4 is supported.</p>
        peer_address: <p>The peer IP address for the local gateway virtual interface. Only IPv4 is supported.</p>
        peer_bgp_asn: <p>The Autonomous System Number (ASN) of the Border Gateway Protocol (BGP) peer.</p>
        tag_specifications: <p>The tags to apply to a resource when the local gateway virtual interface is being created. </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>
        peer_bgp_asn_extended: <p>The extended 32-bit ASN of the BGP peer for use with larger ASN values.</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_local_gateway_virtual_interface_request.CreateLocalGatewayVirtualInterfaceRequest]",
    ) -> OperationResponse[
        "capo_ec2.types.create_local_gateway_virtual_interface_result.CreateLocalGatewayVirtualInterfaceResult"
    ]:
        import capo_ec2._operations.amazon_ec2.create_local_gateway_virtual_interface

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateLocalGatewayVirtualInterface")
    )
    input_: capo_ec2.types.create_local_gateway_virtual_interface_request.CreateLocalGatewayVirtualInterfaceRequest = {}
    if local_gateway_virtual_interface_group_id is not None:
        input_["local_gateway_virtual_interface_group_id"] = (
            local_gateway_virtual_interface_group_id
        )
    if outpost_lag_id is not None:
        input_["outpost_lag_id"] = outpost_lag_id
    if vlan is not None:
        input_["vlan"] = vlan
    if local_address is not None:
        input_["local_address"] = local_address
    if peer_address is not None:
        input_["peer_address"] = peer_address
    if peer_bgp_asn is not None:
        input_["peer_bgp_asn"] = peer_bgp_asn
    if tag_specifications is not None:
        input_["tag_specifications"] = tag_specifications
    if dry_run is not None:
        input_["dry_run"] = dry_run
    if peer_bgp_asn_extended is not None:
        input_["peer_bgp_asn_extended"] = peer_bgp_asn_extended

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