Skip to content

create_route_server_peer async

create_route_server_peer(
    *,
    config_overrides: Optional[AsyncEC2ClientConfig] = None,
    route_server_endpoint_id: Optional[RouteServerEndpointId] = None,
    peer_address: Optional[String] = None,
    bgp_options: Optional[RouteServerBgpOptionsRequest] = None,
    dry_run: Optional[Boolean] = None,
    tag_specifications: Optional[TagSpecificationList] = None,
) -> CreateRouteServerPeerResult

Creates a new BGP peer for a specified route server endpoint.

A route server peer is a session between a route server endpoint and the device deployed in Amazon Web Services (such as a firewall appliance or other network security function running on an EC2 instance). The device must meet these requirements:

  • Have an elastic network interface in the VPC

  • Support BGP (Border Gateway Protocol)

  • Can initiate BGP sessions

For more information see Dynamic routing in your VPC with VPC Route Server in the Amazon VPC User Guide.

Parameters:

  • route_server_endpoint_id (Optional[RouteServerEndpointId], default: None ) –

    The ID of the route server endpoint for which to create a peer.

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

    The IPv4 address of the peer device.

  • bgp_options (Optional[RouteServerBgpOptionsRequest], default: None ) –

    The BGP options for the peer, including ASN (Autonomous System Number) and BFD (Bidrectional Forwarding Detection) settings.

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

    A check for 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.

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

    The tags to apply to the route server peer during creation.

Raises:

Source code in docs_src/capo_ec2/_services/async_ec2.py
async def create_route_server_peer(
    self,
    *,
    config_overrides: Optional[AsyncEC2ClientConfig] = None,
    route_server_endpoint_id: Optional[
        "capo_ec2.types.route_server_endpoint_id.RouteServerEndpointId"
    ] = None,
    peer_address: Optional["capo_ec2.types.string.String"] = None,
    bgp_options: Optional[
        "capo_ec2.types.route_server_bgp_options_request.RouteServerBgpOptionsRequest"
    ] = None,
    dry_run: Optional["capo_ec2.types.boolean.Boolean"] = None,
    tag_specifications: Optional[
        "capo_ec2.types.tag_specification_list.TagSpecificationList"
    ] = None,
) -> "capo_ec2.types.create_route_server_peer_result.CreateRouteServerPeerResult":
    """<p>Creates a new BGP peer for a specified route server endpoint.</p> <p>A route server peer is a session between a route server endpoint and the device deployed in Amazon Web Services (such as a firewall appliance or other network security function running on an EC2 instance). The device must meet these requirements:</p> <ul> <li> <p>Have an elastic network interface in the VPC</p> </li> <li> <p>Support BGP (Border Gateway Protocol)</p> </li> <li> <p>Can initiate BGP sessions</p> </li> </ul> <p>For more information see <a href="https://docs.aws.amazon.com/vpc/latest/userguide/dynamic-routing-route-server.html">Dynamic routing in your VPC with VPC Route Server</a> in the <i>Amazon VPC User Guide</i>.</p>

    Args:
        route_server_endpoint_id: <p>The ID of the route server endpoint for which to create a peer.</p>
        peer_address: <p>The IPv4 address of the peer device.</p>
        bgp_options: <p>The BGP options for the peer, including ASN (Autonomous System Number) and BFD (Bidrectional Forwarding Detection) settings.</p>
        dry_run: <p>A check for 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>
        tag_specifications: <p>The tags to apply to the route server peer during creation.</p>

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

    async def _handler(
        req: "AsyncOperationRequest[capo_ec2.types.create_route_server_peer_request.CreateRouteServerPeerRequest]",
    ) -> AsyncOperationResponse[
        "capo_ec2.types.create_route_server_peer_result.CreateRouteServerPeerResult"
    ]:
        import capo_ec2._operations.amazon_ec2.create_route_server_peer

        (
            output,
            http_response,
        ) = await capo_ec2._operations.amazon_ec2.create_route_server_peer.async_create_route_server_peer(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateRouteServerPeer")
    )
    input_: capo_ec2.types.create_route_server_peer_request.CreateRouteServerPeerRequest = {}
    if route_server_endpoint_id is not None:
        input_["route_server_endpoint_id"] = route_server_endpoint_id
    if peer_address is not None:
        input_["peer_address"] = peer_address
    if bgp_options is not None:
        input_["bgp_options"] = bgp_options
    if dry_run is not None:
        input_["dry_run"] = dry_run
    if tag_specifications is not None:
        input_["tag_specifications"] = tag_specifications

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