Skip to content

create_transit_gateway_connect async

create_transit_gateway_connect(
    *,
    config_overrides: Optional[AsyncEC2ClientConfig] = None,
    transport_transit_gateway_attachment_id: Optional[
        TransitGatewayAttachmentId
    ] = None,
    options: Optional[CreateTransitGatewayConnectRequestOptions] = None,
    tag_specifications: Optional[TagSpecificationList] = None,
    dry_run: Optional[Boolean] = None,
) -> CreateTransitGatewayConnectResult

Creates a Connect attachment from a specified transit gateway attachment. A Connect attachment is a GRE-based tunnel attachment that you can use to establish a connection between a transit gateway and an appliance.

A Connect attachment uses an existing VPC or Amazon Web Services Direct Connect attachment as the underlying transport mechanism.

Parameters:

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

    The ID of the transit gateway attachment. You can specify a VPC attachment or Amazon Web Services Direct Connect attachment.

  • options (Optional[CreateTransitGatewayConnectRequestOptions], default: None ) –

    The Connect attachment options.

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

    The tags to apply to the Connect attachment.

  • 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(
    self,
    *,
    config_overrides: Optional[AsyncEC2ClientConfig] = None,
    transport_transit_gateway_attachment_id: Optional[
        "capo_ec2.types.transit_gateway_attachment_id.TransitGatewayAttachmentId"
    ] = None,
    options: Optional[
        "capo_ec2.types.create_transit_gateway_connect_request_options.CreateTransitGatewayConnectRequestOptions"
    ] = 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_result.CreateTransitGatewayConnectResult":
    """<p>Creates a Connect attachment from a specified transit gateway attachment. A Connect attachment is a GRE-based tunnel attachment that you can use to establish a connection between a transit gateway and an appliance.</p> <p>A Connect attachment uses an existing VPC or Amazon Web Services Direct Connect attachment as the underlying transport mechanism.</p>

    Args:
        transport_transit_gateway_attachment_id: <p>The ID of the transit gateway attachment. You can specify a VPC attachment or Amazon Web Services Direct Connect attachment.</p>
        options: <p>The Connect attachment options.</p>
        tag_specifications: <p>The tags to apply to the Connect attachment.</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_request.CreateTransitGatewayConnectRequest]",
    ) -> AsyncOperationResponse[
        "capo_ec2.types.create_transit_gateway_connect_result.CreateTransitGatewayConnectResult"
    ]:
        import capo_ec2._operations.amazon_ec2.create_transit_gateway_connect

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateTransitGatewayConnect")
    )
    input_: capo_ec2.types.create_transit_gateway_connect_request.CreateTransitGatewayConnectRequest = {}
    if transport_transit_gateway_attachment_id is not None:
        input_["transport_transit_gateway_attachment_id"] = (
            transport_transit_gateway_attachment_id
        )
    if options is not None:
        input_["options"] = options
    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