Skip to content

create_transit_gateway_connect_peer async

create_transit_gateway_connect_peer(
    *,
    config_overrides: Optional[AsyncEC2ClientConfig] = None,
    transit_gateway_attachment_id: Optional[TransitGatewayAttachmentId] = None,
    transit_gateway_address: Optional[String] = None,
    peer_address: Optional[String] = None,
    bgp_options: Optional[TransitGatewayConnectRequestBgpOptions] = None,
    inside_cidr_blocks: Optional[InsideCidrBlocksStringList] = None,
    tag_specifications: Optional[TagSpecificationList] = None,
    dry_run: Optional[Boolean] = None,
) -> CreateTransitGatewayConnectPeerResult

Creates a Connect peer for a specified transit gateway Connect attachment between a transit gateway and an appliance.

The peer address and transit gateway address must be the same IP address family (IPv4 or IPv6).

For more information, see Connect peers in the Amazon Web Services Transit Gateways Guide.

Parameters:

  • transit_gateway_attachment_id (Optional[TransitGatewayAttachmentId], default: None ) –

    The ID of the Connect attachment.

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

    The peer IP address (GRE outer IP address) on the transit gateway side of the Connect peer, which must be specified from a transit gateway CIDR block. If not specified, Amazon automatically assigns the first available IP address from the transit gateway CIDR block.

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

    The peer IP address (GRE outer IP address) on the appliance side of the Connect peer.

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

    The BGP options for the Connect peer.

  • inside_cidr_blocks (Optional[InsideCidrBlocksStringList], default: None ) –

    The range of inside IP addresses that are used for BGP peering. You must specify a size /29 IPv4 CIDR block from the 169.254.0.0/16 range. The first address from the range must be configured on the appliance as the BGP IP address. You can also optionally specify a size /125 IPv6 CIDR block from the fd00::/8 range.

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

    The tags to apply to the Connect peer.

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

Raises:

Source code in docs_src/capo_ec2/_services/async_ec2.py
async def create_transit_gateway_connect_peer(
    self,
    *,
    config_overrides: Optional[AsyncEC2ClientConfig] = None,
    transit_gateway_attachment_id: Optional[
        "capo_ec2.types.transit_gateway_attachment_id.TransitGatewayAttachmentId"
    ] = None,
    transit_gateway_address: Optional["capo_ec2.types.string.String"] = None,
    peer_address: Optional["capo_ec2.types.string.String"] = None,
    bgp_options: Optional[
        "capo_ec2.types.transit_gateway_connect_request_bgp_options.TransitGatewayConnectRequestBgpOptions"
    ] = None,
    inside_cidr_blocks: Optional[
        "capo_ec2.types.inside_cidr_blocks_string_list.InsideCidrBlocksStringList"
    ] = None,
    tag_specifications: Optional[
        "capo_ec2.types.tag_specification_list.TagSpecificationList"
    ] = None,
    dry_run: Optional["capo_ec2.types.boolean.Boolean"] = None,
) -> "capo_ec2.types.create_transit_gateway_connect_peer_result.CreateTransitGatewayConnectPeerResult":
    """<p>Creates a Connect peer for a specified transit gateway Connect attachment between a transit gateway and an appliance.</p> <p>The peer address and transit gateway address must be the same IP address family (IPv4 or IPv6).</p> <p>For more information, see <a href="https://docs.aws.amazon.com/vpc/latest/tgw/tgw-connect.html#tgw-connect-peer">Connect peers</a> in the <i>Amazon Web Services Transit Gateways Guide</i>.</p>

    Args:
        transit_gateway_attachment_id: <p>The ID of the Connect attachment.</p>
        transit_gateway_address: <p>The peer IP address (GRE outer IP address) on the transit gateway side of the Connect peer, which must be specified from a transit gateway CIDR block. If not specified, Amazon automatically assigns the first available IP address from the transit gateway CIDR block.</p>
        peer_address: <p>The peer IP address (GRE outer IP address) on the appliance side of the Connect peer.</p>
        bgp_options: <p>The BGP options for the Connect peer.</p>
        inside_cidr_blocks: <p>The range of inside IP addresses that are used for BGP peering. You must specify a size /29 IPv4 CIDR block from the <code>169.254.0.0/16</code> range. The first address from the range must be configured on the appliance as the BGP IP address. You can also optionally specify a size /125 IPv6 CIDR block from the <code>fd00::/8</code> range.</p>
        tag_specifications: <p>The tags to apply to the Connect peer.</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>

    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_transit_gateway_connect_peer_request.CreateTransitGatewayConnectPeerRequest]",
    ) -> AsyncOperationResponse[
        "capo_ec2.types.create_transit_gateway_connect_peer_result.CreateTransitGatewayConnectPeerResult"
    ]:
        import capo_ec2._operations.amazon_ec2.create_transit_gateway_connect_peer

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateTransitGatewayConnectPeer")
    )
    input_: capo_ec2.types.create_transit_gateway_connect_peer_request.CreateTransitGatewayConnectPeerRequest = {}
    if transit_gateway_attachment_id is not None:
        input_["transit_gateway_attachment_id"] = transit_gateway_attachment_id
    if transit_gateway_address is not None:
        input_["transit_gateway_address"] = transit_gateway_address
    if peer_address is not None:
        input_["peer_address"] = peer_address
    if bgp_options is not None:
        input_["bgp_options"] = bgp_options
    if inside_cidr_blocks is not None:
        input_["inside_cidr_blocks"] = inside_cidr_blocks
    if tag_specifications is not None:
        input_["tag_specifications"] = tag_specifications
    if dry_run is not None:
        input_["dry_run"] = dry_run

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