Skip to content

create_db_cluster_endpoint async

create_db_cluster_endpoint(
    *,
    config_overrides: Optional[AsyncRDSClientConfig] = None,
    db_cluster_identifier: Optional[String] = None,
    db_cluster_endpoint_identifier: Optional[String] = None,
    endpoint_type: Optional[String] = None,
    static_members: Optional[StringList] = None,
    excluded_members: Optional[StringList] = None,
    tags: Optional[TagList] = None,
) -> DBClusterEndpoint

Creates a new custom endpoint and associates it with an Amazon Aurora DB cluster.

This action applies only to Aurora DB clusters.

Parameters:

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

    The DB cluster identifier of the DB cluster associated with the endpoint. This parameter is stored as a lowercase string.

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

    The identifier to use for the new endpoint. This parameter is stored as a lowercase string.

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

    The type of the endpoint, one of: READER, WRITER, ANY.

  • static_members (Optional[StringList], default: None ) –

    List of DB instance identifiers that are part of the custom endpoint group.

  • excluded_members (Optional[StringList], default: None ) –

    List of DB instance identifiers that aren't part of the custom endpoint group. All other eligible instances are reachable through the custom endpoint. This parameter is relevant only if the list of static members is empty.

  • tags (Optional[TagList], default: None ) –

    The tags to be assigned to the Amazon RDS resource.

Raises:

Examples:

To create a custom DB cluster endpoint The following example creates a custom DB cluster endpoint and associate it with the specified Aurora DB cluster.

>>> await client.create_db_cluster_endpoint(db_cluster_identifier='mydbcluster', db_cluster_endpoint_identifier='mycustomendpoint', endpoint_type='reader', static_members=['dbinstance1', 'dbinstance2'])
Source code in docs_src/capo_rds/_services/async_rds.py
async def create_db_cluster_endpoint(
    self,
    *,
    config_overrides: Optional[AsyncRDSClientConfig] = None,
    db_cluster_identifier: Optional["capo_rds.types.string.String"] = None,
    db_cluster_endpoint_identifier: Optional["capo_rds.types.string.String"] = None,
    endpoint_type: Optional["capo_rds.types.string.String"] = None,
    static_members: Optional["capo_rds.types.string_list.StringList"] = None,
    excluded_members: Optional["capo_rds.types.string_list.StringList"] = None,
    tags: Optional["capo_rds.types.tag_list.TagList"] = None,
) -> "capo_rds.types.db_cluster_endpoint.DBClusterEndpoint":
    """<p>Creates a new custom endpoint and associates it with an Amazon Aurora DB cluster.</p> <note> <p>This action applies only to Aurora DB clusters.</p> </note>

    Args:
        db_cluster_identifier: <p>The DB cluster identifier of the DB cluster associated with the endpoint. This parameter is stored as a lowercase string.</p>
        db_cluster_endpoint_identifier: <p>The identifier to use for the new endpoint. This parameter is stored as a lowercase string.</p>
        endpoint_type: <p>The type of the endpoint, one of: <code>READER</code>, <code>WRITER</code>, <code>ANY</code>.</p>
        static_members: <p>List of DB instance identifiers that are part of the custom endpoint group.</p>
        excluded_members: <p>List of DB instance identifiers that aren't part of the custom endpoint group. All other eligible instances are reachable through the custom endpoint. This parameter is relevant only if the list of static members is empty.</p>
        tags: <p>The tags to be assigned to the Amazon RDS resource.</p>

    Raises:
        capo_rds.errors.db_cluster_endpoint_already_exists_fault.DBClusterEndpointAlreadyExistsFault: <p>The specified custom endpoint can't be created because it already exists.</p>
        capo_rds.errors.db_cluster_endpoint_quota_exceeded_fault.DBClusterEndpointQuotaExceededFault: <p>The cluster already has the maximum number of custom endpoints.</p>
        capo_rds.errors.db_cluster_not_found_fault.DBClusterNotFoundFault: <p> <code>DBClusterIdentifier</code> doesn't refer to an existing DB cluster.</p>
        capo_rds.errors.db_instance_not_found_fault.DBInstanceNotFoundFault: <p> <code>DBInstanceIdentifier</code> doesn't refer to an existing DB instance.</p>
        capo_rds.errors.invalid_db_cluster_state_fault.InvalidDBClusterStateFault: <p>The requested operation can't be performed while the cluster is in this state.</p>
        capo_rds.errors.invalid_db_instance_state_fault.InvalidDBInstanceStateFault: <p>The DB instance isn't in a valid state.</p>
        capo_rds.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To create a custom DB cluster endpoint
        The following example creates a custom DB cluster endpoint and associate it with the specified Aurora DB cluster.

        >>> await client.create_db_cluster_endpoint(db_cluster_identifier='mydbcluster', db_cluster_endpoint_identifier='mycustomendpoint', endpoint_type='reader', static_members=['dbinstance1', 'dbinstance2'])
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_rds.types.create_db_cluster_endpoint_message.CreateDBClusterEndpointMessage]",
    ) -> AsyncOperationResponse[
        "capo_rds.types.db_cluster_endpoint.DBClusterEndpoint"
    ]:
        import capo_rds._operations.amazon_rd_sv19.create_db_cluster_endpoint

        (
            output,
            http_response,
        ) = await capo_rds._operations.amazon_rd_sv19.create_db_cluster_endpoint.async_create_db_cluster_endpoint(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateDBClusterEndpoint")
    )
    input_: capo_rds.types.create_db_cluster_endpoint_message.CreateDBClusterEndpointMessage = {}
    if db_cluster_identifier is not None:
        input_["db_cluster_identifier"] = db_cluster_identifier
    if db_cluster_endpoint_identifier is not None:
        input_["db_cluster_endpoint_identifier"] = db_cluster_endpoint_identifier
    if endpoint_type is not None:
        input_["endpoint_type"] = endpoint_type
    if static_members is not None:
        input_["static_members"] = static_members
    if excluded_members is not None:
        input_["excluded_members"] = excluded_members
    if tags is not None:
        input_["tags"] = tags

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