Skip to content

delete_connection async

delete_connection(
    endpoint_arn: String,
    replication_instance_arn: String,
    *,
    config_overrides: Optional[AsyncDatabaseMigrationServiceClientConfig] = None,
) -> DeleteConnectionResponse

Deletes the connection between a replication instance and an endpoint.

Parameters:

  • endpoint_arn (String) –

    The Amazon Resource Name (ARN) string that uniquely identifies the endpoint.

  • replication_instance_arn (String) –

    The Amazon Resource Name (ARN) of the replication instance.

Raises:

Examples:

Delete Connection Deletes the connection between the replication instance and the endpoint.

>>> await client.delete_connection(replication_instance_arn='arn:aws:dms:us-east-1:123456789012:rep:6UTDJGBOUS3VI3SUWA66XFJCJQ', endpoint_arn='arn:aws:dms:us-east-1:123456789012:endpoint:RAAR3R22XSH46S3PWLC3NJAWKM')
Source code in docs_src/capo_database_migration_service/_services/async_database_migration_service.py
async def delete_connection(
    self,
    endpoint_arn: "capo_database_migration_service.types.string.String",
    replication_instance_arn: "capo_database_migration_service.types.string.String",
    *,
    config_overrides: Optional[AsyncDatabaseMigrationServiceClientConfig] = None,
) -> "capo_database_migration_service.types.delete_connection_response.DeleteConnectionResponse":
    """<p>Deletes the connection between a replication instance and an endpoint.</p>

    Args:
        endpoint_arn: <p>The Amazon Resource Name (ARN) string that uniquely identifies the endpoint.</p>
        replication_instance_arn: <p>The Amazon Resource Name (ARN) of the replication instance.</p>

    Raises:
        capo_database_migration_service.errors.access_denied_fault.AccessDeniedFault: <p>DMS was denied access to the endpoint. Check that the role is correctly configured.</p>
        capo_database_migration_service.errors.invalid_resource_state_fault.InvalidResourceStateFault: <p>The resource is in a state that prevents it from being used for database migration.</p>
        capo_database_migration_service.errors.resource_not_found_fault.ResourceNotFoundFault: <p>The resource could not be found.</p>
        capo_database_migration_service.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        Delete Connection
        Deletes the connection between the replication instance and the endpoint.

        >>> await client.delete_connection(replication_instance_arn='arn:aws:dms:us-east-1:123456789012:rep:6UTDJGBOUS3VI3SUWA66XFJCJQ', endpoint_arn='arn:aws:dms:us-east-1:123456789012:endpoint:RAAR3R22XSH46S3PWLC3NJAWKM')
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_database_migration_service.types.delete_connection_message.DeleteConnectionMessage]",
    ) -> AsyncOperationResponse[
        "capo_database_migration_service.types.delete_connection_response.DeleteConnectionResponse"
    ]:
        import capo_database_migration_service._operations.amazon_dm_sv20160101.delete_connection

        (
            output,
            http_response,
        ) = await capo_database_migration_service._operations.amazon_dm_sv20160101.delete_connection.async_delete_connection(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteConnection")
    )
    input_: capo_database_migration_service.types.delete_connection_message.DeleteConnectionMessage = {
        "endpoint_arn": endpoint_arn,
        "replication_instance_arn": replication_instance_arn,
    }

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