Skip to content

create_connection

create_connection(
    bandwidth: ConnectionBandwidth,
    attach_point: AttachPoint,
    environment_id: EnvironmentId,
    *,
    config_overrides: Optional[InterconnectClientConfig] = None,
    description: Optional[ConnectionDescription] = None,
    remote_account: Optional[RemoteAccountIdentifier] = None,
    tags: Optional[TagMap] = None,
    client_token: Optional[str] = None,
) -> CreateConnectionResponse

Initiates the process to create a Connection across the specified Environment.

The Environment dictates the specified partner and location to which the other end of the connection should attach. You can see a list of the available Environments by calling ListEnvironments

The Attach Point specifies where within the AWS Network your connection will logically connect.

After a successful call to this method, the resulting Connection will return an Activation Key which will need to be brought to the specific partner's portal to confirm the Connection on both sides. (See Environment$activationPageUrl for a direct link to the partner portal).

Parameters:

Raises:

Examples:

Create Connection on specific environment

>>> client.create_connection(bandwidth='1Gbps', environment_id='mce-aws-acme-1', remote_account={'identifier': 'PartnerAccountDetails'}, attach_point={'directConnectGateway': '90392BE3-219C-47FD-BBA5-03DF76D2542A'})
Source code in docs_src/capo_interconnect/_services/interconnect.py
def create_connection(
    self,
    bandwidth: "capo_interconnect.types.connection_bandwidth.ConnectionBandwidth",
    attach_point: "capo_interconnect.types.attach_point.AttachPoint",
    environment_id: "capo_interconnect.types.environment_id.EnvironmentId",
    *,
    config_overrides: Optional[InterconnectClientConfig] = None,
    description: Optional[
        "capo_interconnect.types.connection_description.ConnectionDescription"
    ] = None,
    remote_account: Optional[
        "capo_interconnect.types.remote_account_identifier.RemoteAccountIdentifier"
    ] = None,
    tags: Optional["capo_interconnect.types.tag_map.TagMap"] = None,
    client_token: Optional[str] = None,
) -> "capo_interconnect.types.create_connection_response.CreateConnectionResponse":
    """<p>Initiates the process to create a Connection across the specified Environment. </p> <p>The Environment dictates the specified partner and location to which the other end of the connection should attach. You can see a list of the available Environments by calling <a>ListEnvironments</a> </p> <p>The Attach Point specifies where within the AWS Network your connection will logically connect.</p> <p>After a successful call to this method, the resulting <a>Connection</a> will return an Activation Key which will need to be brought to the specific partner's portal to confirm the <a>Connection</a> on both sides. (See <a>Environment$activationPageUrl</a> for a direct link to the partner portal). </p>

    Args:
        description: <p>A description to distinguish this <a>Connection</a>.</p>
        bandwidth: <p>The desired bandwidth of the requested <a>Connection</a> </p>
        attach_point: <p>The Attach Point to which the connection should be associated."</p>
        environment_id: <p>The identifier of the <a>Environment</a> across which this <a>Connection</a> should be created.</p> <p>The available <a>Environment</a> objects can be determined using <a>ListEnvironments</a>.</p>
        remote_account: <p>Account and/or principal identifying information that can be verified by the partner of this specific Environment.</p>
        tags: <p>The tag to associate with the resulting <a>Connection</a>.</p>
        client_token: <p>Idempotency token used for the request.</p>

    Raises:
        capo_interconnect.errors.access_denied_exception.AccessDeniedException: <p>The calling principal is not allowed to access the specified resource, or the resource does not exist.</p>
        capo_interconnect.errors.interconnect_client_exception.InterconnectClientException: <p>The request was denied due to incorrect client supplied parameters.</p>
        capo_interconnect.errors.interconnect_server_exception.InterconnectServerException: <p>The request resulted in an exception internal to the service.</p>
        capo_interconnect.errors.interconnect_validation_exception.InterconnectValidationException: <p>The input fails to satisfy the constraints specified.</p>
        capo_interconnect.errors.resource_not_found_exception.ResourceNotFoundException: <p>The request specifies a resource that does not exist on the server.</p>
        capo_interconnect.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The requested operation would result in the calling principal exceeding their allotted quota.</p>
        capo_interconnect.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_interconnect.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        Create Connection on specific environment

        >>> client.create_connection(bandwidth='1Gbps', environment_id='mce-aws-acme-1', remote_account={'identifier': 'PartnerAccountDetails'}, attach_point={'directConnectGateway': '90392BE3-219C-47FD-BBA5-03DF76D2542A'})
    """

    def _handler(
        req: "OperationRequest[capo_interconnect.types.create_connection_request.CreateConnectionRequest]",
    ) -> OperationResponse[
        "capo_interconnect.types.create_connection_response.CreateConnectionResponse"
    ]:
        import capo_interconnect._operations.interconnect.create_connection

        output, http_response = (
            capo_interconnect._operations.interconnect.create_connection.create_connection(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_output(
        output: "capo_interconnect.types.create_connection_response.CreateConnectionResponse",
    ) -> dict[str, Any]:
        import capo_interconnect.types.create_connection_response

        return capo_interconnect.types.create_connection_response.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("CreateConnection", redact_output=_redact_output),
    )
    input_: capo_interconnect.types.create_connection_request.CreateConnectionRequest = {
        "bandwidth": bandwidth,
        "attach_point": attach_point,
        "environment_id": environment_id,
    }
    if description is not None:
        input_["description"] = description
    if remote_account is not None:
        input_["remote_account"] = remote_account
    if tags is not None:
        input_["tags"] = tags
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token

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