Skip to content

create_db_shard_group async

create_db_shard_group(
    *,
    config_overrides: Optional[AsyncRDSClientConfig] = None,
    db_shard_group_identifier: Optional[String] = None,
    db_cluster_identifier: Optional[String] = None,
    compute_redundancy: Optional[IntegerOptional] = None,
    max_acu: Optional[DoubleOptional] = None,
    min_acu: Optional[DoubleOptional] = None,
    publicly_accessible: Optional[BooleanOptional] = None,
    tags: Optional[TagList] = None,
) -> DBShardGroup

Creates a new DB shard group for Aurora Limitless Database. You must enable Aurora Limitless Database to create a DB shard group.

Valid for: Aurora DB clusters only

Parameters:

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

    The name of the DB shard group.

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

    The name of the primary DB cluster for the DB shard group.

  • compute_redundancy (Optional[IntegerOptional], default: None ) –

    Specifies whether to create standby standby DB data access shard for the DB shard group. Valid values are the following:

    • 0 - Creates a DB shard group without a standby DB data access shard. This is the default value.

    • 1 - Creates a DB shard group with a standby DB data access shard in a different Availability Zone (AZ).

    • 2 - Creates a DB shard group with two standby DB data access shard in two different AZs.

  • max_acu (Optional[DoubleOptional], default: None ) –

    The maximum capacity of the DB shard group in Aurora capacity units (ACUs).

  • min_acu (Optional[DoubleOptional], default: None ) –

    The minimum capacity of the DB shard group in Aurora capacity units (ACUs).

  • publicly_accessible (Optional[BooleanOptional], default: None ) –

    Specifies whether the DB shard group is publicly accessible.

    When the DB shard group is publicly accessible, its Domain Name System (DNS) endpoint resolves to the private IP address from within the DB shard group's virtual private cloud (VPC). It resolves to the public IP address from outside of the DB shard group's VPC. Access to the DB shard group is ultimately controlled by the security group it uses. That public access is not permitted if the security group assigned to the DB shard group doesn't permit it.

    When the DB shard group isn't publicly accessible, it is an internal DB shard group with a DNS name that resolves to a private IP address.

    Default: The default behavior varies depending on whether DBSubnetGroupName is specified.

    If DBSubnetGroupName isn't specified, and PubliclyAccessible isn't specified, the following applies:

    • If the default VPC in the target Region doesn’t have an internet gateway attached to it, the DB shard group is private.

    • If the default VPC in the target Region has an internet gateway attached to it, the DB shard group is public.

    If DBSubnetGroupName is specified, and PubliclyAccessible isn't specified, the following applies:

    • If the subnets are part of a VPC that doesn’t have an internet gateway attached to it, the DB shard group is private.

    • If the subnets are part of a VPC that has an internet gateway attached to it, the DB shard group is public.

Raises:

Source code in docs_src/capo_rds/_services/async_rds.py
async def create_db_shard_group(
    self,
    *,
    config_overrides: Optional[AsyncRDSClientConfig] = None,
    db_shard_group_identifier: Optional["capo_rds.types.string.String"] = None,
    db_cluster_identifier: Optional["capo_rds.types.string.String"] = None,
    compute_redundancy: Optional[
        "capo_rds.types.integer_optional.IntegerOptional"
    ] = None,
    max_acu: Optional["capo_rds.types.double_optional.DoubleOptional"] = None,
    min_acu: Optional["capo_rds.types.double_optional.DoubleOptional"] = None,
    publicly_accessible: Optional[
        "capo_rds.types.boolean_optional.BooleanOptional"
    ] = None,
    tags: Optional["capo_rds.types.tag_list.TagList"] = None,
) -> "capo_rds.types.db_shard_group.DBShardGroup":
    """<p>Creates a new DB shard group for Aurora Limitless Database. You must enable Aurora Limitless Database to create a DB shard group.</p> <p>Valid for: Aurora DB clusters only</p>

    Args:
        db_shard_group_identifier: <p>The name of the DB shard group.</p>
        db_cluster_identifier: <p>The name of the primary DB cluster for the DB shard group.</p>
        compute_redundancy: <p>Specifies whether to create standby standby DB data access shard for the DB shard group. Valid values are the following:</p> <ul> <li> <p>0 - Creates a DB shard group without a standby DB data access shard. This is the default value.</p> </li> <li> <p>1 - Creates a DB shard group with a standby DB data access shard in a different Availability Zone (AZ).</p> </li> <li> <p>2 - Creates a DB shard group with two standby DB data access shard in two different AZs.</p> </li> </ul>
        max_acu: <p>The maximum capacity of the DB shard group in Aurora capacity units (ACUs).</p>
        min_acu: <p>The minimum capacity of the DB shard group in Aurora capacity units (ACUs).</p>
        publicly_accessible: <p>Specifies whether the DB shard group is publicly accessible.</p> <p>When the DB shard group is publicly accessible, its Domain Name System (DNS) endpoint resolves to the private IP address from within the DB shard group's virtual private cloud (VPC). It resolves to the public IP address from outside of the DB shard group's VPC. Access to the DB shard group is ultimately controlled by the security group it uses. That public access is not permitted if the security group assigned to the DB shard group doesn't permit it.</p> <p>When the DB shard group isn't publicly accessible, it is an internal DB shard group with a DNS name that resolves to a private IP address.</p> <p>Default: The default behavior varies depending on whether <code>DBSubnetGroupName</code> is specified.</p> <p>If <code>DBSubnetGroupName</code> isn't specified, and <code>PubliclyAccessible</code> isn't specified, the following applies:</p> <ul> <li> <p>If the default VPC in the target Region doesn’t have an internet gateway attached to it, the DB shard group is private.</p> </li> <li> <p>If the default VPC in the target Region has an internet gateway attached to it, the DB shard group is public.</p> </li> </ul> <p>If <code>DBSubnetGroupName</code> is specified, and <code>PubliclyAccessible</code> isn't specified, the following applies:</p> <ul> <li> <p>If the subnets are part of a VPC that doesn’t have an internet gateway attached to it, the DB shard group is private.</p> </li> <li> <p>If the subnets are part of a VPC that has an internet gateway attached to it, the DB shard group is public.</p> </li> </ul>

    Raises:
        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_shard_group_already_exists_fault.DBShardGroupAlreadyExistsFault: <p>The specified DB shard group name must be unique in your Amazon Web Services account in the specified Amazon Web Services Region.</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_vpc_network_state_fault.InvalidVPCNetworkStateFault: <p>The DB subnet group doesn't cover all Availability Zones after it's created because of users' change.</p>
        capo_rds.errors.max_db_shard_group_limit_reached.MaxDBShardGroupLimitReached: <p>The maximum number of DB shard groups for your Amazon Web Services account in the specified Amazon Web Services Region has been reached.</p>
        capo_rds.errors.network_type_not_supported.NetworkTypeNotSupported: <p>The network type is invalid for the DB instance. Valid nework type values are <code>IPV4</code> and <code>DUAL</code>.</p>
        capo_rds.errors.unsupported_db_engine_version_fault.UnsupportedDBEngineVersionFault: <p>The specified DB engine version isn't supported for Aurora Limitless Database.</p>
        capo_rds.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_rds.types.create_db_shard_group_message.CreateDBShardGroupMessage]",
    ) -> AsyncOperationResponse["capo_rds.types.db_shard_group.DBShardGroup"]:
        import capo_rds._operations.amazon_rd_sv19.create_db_shard_group

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateDBShardGroup")
    )
    input_: capo_rds.types.create_db_shard_group_message.CreateDBShardGroupMessage = {}
    if db_shard_group_identifier is not None:
        input_["db_shard_group_identifier"] = db_shard_group_identifier
    if db_cluster_identifier is not None:
        input_["db_cluster_identifier"] = db_cluster_identifier
    if compute_redundancy is not None:
        input_["compute_redundancy"] = compute_redundancy
    if max_acu is not None:
        input_["max_acu"] = max_acu
    if min_acu is not None:
        input_["min_acu"] = min_acu
    if publicly_accessible is not None:
        input_["publicly_accessible"] = publicly_accessible
    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