AWS CLI version 2, the latest major version of AWS CLI, is now stable and recommended for general use. To view this page for the AWS CLI version 2, click here. For more information see the AWS CLI version 2 installation instructions and migration guide.
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
See also: AWS API Documentation
create-db-shard-group
--db-shard-group-identifier <value>
--db-cluster-identifier <value>
[--compute-redundancy <value>]
--max-acu <value>
[--min-acu <value>]
[--publicly-accessible | --no-publicly-accessible]
[--tags <value>]
[--cli-input-json <value>]
[--generate-cli-skeleton <value>]
[--debug]
[--endpoint-url <value>]
[--no-verify-ssl]
[--no-paginate]
[--output <value>]
[--query <value>]
[--profile <value>]
[--region <value>]
[--version <value>]
[--color <value>]
[--no-sign-request]
[--ca-bundle <value>]
[--cli-read-timeout <value>]
[--cli-connect-timeout <value>]
--db-shard-group-identifier
(string)
The name of the DB shard group.
--db-cluster-identifier
(string)
The name of the primary DB cluster for the DB shard group.
--compute-redundancy
(integer)
Specifies whether to create standby DB shard groups for the DB shard group. Valid values are the following:
- 0 - Creates a DB shard group without a standby DB shard group. This is the default value.
- 1 - Creates a DB shard group with a standby DB shard group in a different Availability Zone (AZ).
- 2 - Creates a DB shard group with two standby DB shard groups in two different AZs.
--max-acu
(double)
The maximum capacity of the DB shard group in Aurora capacity units (ACUs).
--min-acu
(double)
The minimum capacity of the DB shard group in Aurora capacity units (ACUs).
--publicly-accessible
| --no-publicly-accessible
(boolean)
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, andPubliclyAccessible
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, andPubliclyAccessible
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.
--tags
(list)
A list of tags.
For more information, see Tagging Amazon RDS resources in the Amazon RDS User Guide or Tagging Amazon Aurora and Amazon RDS resources in the Amazon Aurora User Guide .
(structure)
Metadata assigned to an Amazon RDS resource consisting of a key-value pair.
For more information, see Tagging Amazon RDS resources in the Amazon RDS User Guide or Tagging Amazon Aurora and Amazon RDS resources in the Amazon Aurora User Guide .
Key -> (string)
A key is the required name of the tag. The string value can be from 1 to 128 Unicode characters in length and can't be prefixed withaws:
orrds:
. The string can only contain only the set of Unicode letters, digits, white-space, '_', '.', ':', '/', '=', '+', '-', '@' (Java regex: "^([\p{L}\p{Z}\p{N}_.:/=+\-@]*)$").Value -> (string)
A value is the optional value of the tag. The string value can be from 1 to 256 Unicode characters in length and can't be prefixed withaws:
orrds:
. The string can only contain only the set of Unicode letters, digits, white-space, '_', '.', ':', '/', '=', '+', '-', '@' (Java regex: "^([\p{L}\p{Z}\p{N}_.:/=+\-@]*)$").
Shorthand Syntax:
Key=string,Value=string ...
JSON Syntax:
[
{
"Key": "string",
"Value": "string"
}
...
]
--cli-input-json
(string)
Performs service operation based on the JSON string provided. The JSON string follows the format provided by --generate-cli-skeleton
. If other arguments are provided on the command line, the CLI values will override the JSON-provided values. It is not possible to pass arbitrary binary values using a JSON-provided value as the string will be taken literally.
--generate-cli-skeleton
(string)
Prints a JSON skeleton to standard output without sending an API request. If provided with no value or the value input
, prints a sample input JSON that can be used as an argument for --cli-input-json
. If provided with the value output
, it validates the command inputs and returns a sample output JSON for that command.
--debug
(boolean)
Turn on debug logging.
--endpoint-url
(string)
Override command's default URL with the given URL.
--no-verify-ssl
(boolean)
By default, the AWS CLI uses SSL when communicating with AWS services. For each SSL connection, the AWS CLI will verify SSL certificates. This option overrides the default behavior of verifying SSL certificates.
--no-paginate
(boolean)
Disable automatic pagination. If automatic pagination is disabled, the AWS CLI will only make one call, for the first page of results.
--output
(string)
The formatting style for command output.
--query
(string)
A JMESPath query to use in filtering the response data.
--profile
(string)
Use a specific profile from your credential file.
--region
(string)
The region to use. Overrides config/env settings.
--version
(string)
Display the version of this tool.
--color
(string)
Turn on/off color output.
--no-sign-request
(boolean)
Do not sign requests. Credentials will not be loaded if this argument is provided.
--ca-bundle
(string)
The CA certificate bundle to use when verifying SSL certificates. Overrides config/env settings.
--cli-read-timeout
(int)
The maximum socket read time in seconds. If the value is set to 0, the socket read will be blocking and not timeout. The default value is 60 seconds.
--cli-connect-timeout
(int)
The maximum socket connect time in seconds. If the value is set to 0, the socket connect will be blocking and not timeout. The default value is 60 seconds.
To use the following examples, you must have the AWS CLI installed and configured. See the Getting started guide in the AWS CLI User Guide for more information.
Unless otherwise stated, all examples have unix-like quotation rules. These examples will need to be adapted to your terminal's quoting rules. See Using quotation marks with strings in the AWS CLI User Guide .
Example 1: To create an Aurora PostgreSQL primary DB cluster
The following create-db-cluster
example creates an Aurora PostgreSQL SQL primary DB cluster that's compatible with Aurora Serverless v2 and Aurora Limitless Database.
aws rds create-db-cluster \
--db-cluster-identifier my-sv2-cluster \
--engine aurora-postgresql \
--engine-version 15.2-limitless \
--storage-type aurora-iopt1 \
--serverless-v2-scaling-configuration MinCapacity=2,MaxCapacity=16 \
--enable-limitless-database \
--master-username myuser \
--master-user-password mypassword \
--enable-cloudwatch-logs-exports postgresql
Output:
{
"DBCluster": {
"AllocatedStorage": 1,
"AvailabilityZones": [
"us-east-2b",
"us-east-2c",
"us-east-2a"
],
"BackupRetentionPeriod": 1,
"DBClusterIdentifier": "my-sv2-cluster",
"DBClusterParameterGroup": "default.aurora-postgresql15",
"DBSubnetGroup": "default",
"Status": "creating",
"Endpoint": "my-sv2-cluster.cluster-cekycexample.us-east-2.rds.amazonaws.com",
"ReaderEndpoint": "my-sv2-cluster.cluster-ro-cekycexample.us-east-2.rds.amazonaws.com",
"MultiAZ": false,
"Engine": "aurora-postgresql",
"EngineVersion": "15.2-limitless",
"Port": 5432,
"MasterUsername": "myuser",
"PreferredBackupWindow": "06:05-06:35",
"PreferredMaintenanceWindow": "mon:08:25-mon:08:55",
"ReadReplicaIdentifiers": [],
"DBClusterMembers": [],
"VpcSecurityGroups": [
{
"VpcSecurityGroupId": "sg-########",
"Status": "active"
}
],
"HostedZoneId": "Z2XHWR1EXAMPLE",
"StorageEncrypted": false,
"DbClusterResourceId": "cluster-XYEDT6ML6FHIXH4Q2J1EXAMPLE",
"DBClusterArn": "arn:aws:rds:us-east-2:123456789012:cluster:my-sv2-cluster",
"AssociatedRoles": [],
"IAMDatabaseAuthenticationEnabled": false,
"ClusterCreateTime": "2024-02-19T16:24:07.771000+00:00",
"EnabledCloudwatchLogsExports": [
"postgresql"
],
"EngineMode": "provisioned",
"DeletionProtection": false,
"HttpEndpointEnabled": false,
"CopyTagsToSnapshot": false,
"CrossAccountClone": false,
"DomainMemberships": [],
"TagList": [],
"StorageType": "aurora-iopt1",
"AutoMinorVersionUpgrade": true,
"ServerlessV2ScalingConfiguration": {
"MinCapacity": 2.0,
"MaxCapacity": 16.0
},
"NetworkType": "IPV4",
"IOOptimizedNextAllowedModificationTime": "2024-03-21T16:24:07.781000+00:00",
"LimitlessDatabase": {
"Status": "not-in-use",
"MinRequiredACU": 96.0
}
}
}
Example 2: To create the primary (writer) DB instance
The following create-db-instance
example creates an Aurora Serverless v2 primary (writer) DB instance. When you use the console to create a DB cluster, Amazon RDS automatically creates the writer DB instance for your DB cluster. However, when you use the AWS CLI to create a DB cluster, you must explicitly create the writer DB instance for your DB cluster using the create-db-instance
AWS CLI command.
aws rds create-db-instance \
--db-instance-identifier my-sv2-instance \
--db-cluster-identifier my-sv2-cluster \
--engine aurora-postgresql \
--db-instance-class db.serverless
Output:
{
"DBInstance": {
"DBInstanceIdentifier": "my-sv2-instance",
"DBInstanceClass": "db.serverless",
"Engine": "aurora-postgresql",
"DBInstanceStatus": "creating",
"MasterUsername": "myuser",
"AllocatedStorage": 1,
"PreferredBackupWindow": "06:05-06:35",
"BackupRetentionPeriod": 1,
"DBSecurityGroups": [],
"VpcSecurityGroups": [
{
"VpcSecurityGroupId": "sg-########",
"Status": "active"
}
],
"DBParameterGroups": [
{
"DBParameterGroupName": "default.aurora-postgresql15",
"ParameterApplyStatus": "in-sync"
}
],
"DBSubnetGroup": {
"DBSubnetGroupName": "default",
"DBSubnetGroupDescription": "default",
"VpcId": "vpc-########",
"SubnetGroupStatus": "Complete",
"Subnets": [
{
"SubnetIdentifier": "subnet-########",
"SubnetAvailabilityZone": {
"Name": "us-east-2c"
},
"SubnetOutpost": {},
"SubnetStatus": "Active"
},
{
"SubnetIdentifier": "subnet-########",
"SubnetAvailabilityZone": {
"Name": "us-east-2a"
},
"SubnetOutpost": {},
"SubnetStatus": "Active"
},
{
"SubnetIdentifier": "subnet-########",
"SubnetAvailabilityZone": {
"Name": "us-east-2b"
},
"SubnetOutpost": {},
"SubnetStatus": "Active"
}
]
},
"PreferredMaintenanceWindow": "fri:09:01-fri:09:31",
"PendingModifiedValues": {
"PendingCloudwatchLogsExports": {
"LogTypesToEnable": [
"postgresql"
]
}
},
"MultiAZ": false,
"EngineVersion": "15.2-limitless",
"AutoMinorVersionUpgrade": true,
"ReadReplicaDBInstanceIdentifiers": [],
"LicenseModel": "postgresql-license",
"OptionGroupMemberships": [
{
"OptionGroupName": "default:aurora-postgresql-15",
"Status": "in-sync"
}
],
"PubliclyAccessible": false,
"StorageType": "aurora-iopt1",
"DbInstancePort": 0,
"DBClusterIdentifier": "my-sv2-cluster",
"StorageEncrypted": false,
"DbiResourceId": "db-BIQTE3B3K3RM7M74SK5EXAMPLE",
"CACertificateIdentifier": "rds-ca-rsa2048-g1",
"DomainMemberships": [],
"CopyTagsToSnapshot": false,
"MonitoringInterval": 0,
"PromotionTier": 1,
"DBInstanceArn": "arn:aws:rds:us-east-2:123456789012:db:my-sv2-instance",
"IAMDatabaseAuthenticationEnabled": false,
"PerformanceInsightsEnabled": false,
"DeletionProtection": false,
"AssociatedRoles": [],
"TagList": [],
"CustomerOwnedIpEnabled": false,
"BackupTarget": "region",
"NetworkType": "IPV4",
"StorageThroughput": 0,
"CertificateDetails": {
"CAIdentifier": "rds-ca-rsa2048-g1"
},
"DedicatedLogVolume": false
}
}
Example 3: To create the DB shard group
The following create-db-shard-group
example creates a DB shard group in your Aurora PostgreSQL primary DB cluster.
aws rds create-db-shard-group \
--db-shard-group-identifier my-db-shard-group \
--db-cluster-identifier my-sv2-cluster \
--max-acu 768
Output:
{
"DBShardGroupResourceId": "shardgroup-a6e3a0226aa243e2ac6c7a1234567890",
"DBShardGroupIdentifier": "my-db-shard-group",
"DBClusterIdentifier": "my-sv2-cluster",
"MaxACU": 768.0,
"ComputeRedundancy": 0,
"Status": "creating",
"PubliclyAccessible": false,
"Endpoint": "my-sv2-cluster.limitless-cekycexample.us-east-2.rds.amazonaws.com"
}
For more information, see Using Aurora Serverless v2 in the Amazon Aurora User Guide.
DBShardGroupResourceId -> (string)
The Amazon Web Services Region-unique, immutable identifier for the DB shard group.
DBShardGroupIdentifier -> (string)
The name of the DB shard group.
DBClusterIdentifier -> (string)
The name of the primary DB cluster for the DB shard group.
MaxACU -> (double)
The maximum capacity of the DB shard group in Aurora capacity units (ACUs).
MinACU -> (double)
The minimum capacity of the DB shard group in Aurora capacity units (ACUs).
ComputeRedundancy -> (integer)
Specifies whether to create standby DB shard groups for the DB shard group. Valid values are the following:
- 0 - Creates a DB shard group without a standby DB shard group. This is the default value.
- 1 - Creates a DB shard group with a standby DB shard group in a different Availability Zone (AZ).
- 2 - Creates a DB shard group with two standby DB shard groups in two different AZs.
Status -> (string)
The status of the DB shard group.
PubliclyAccessible -> (boolean)
Indicates 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 isn't 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.
For more information, see CreateDBShardGroup .
This setting is only for Aurora Limitless Database.
Endpoint -> (string)
The connection endpoint for the DB shard group.
DBShardGroupArn -> (string)
The Amazon Resource Name (ARN) for the DB shard group.
TagList -> (list)
A list of tags.
For more information, see Tagging Amazon RDS resources in the Amazon RDS User Guide or Tagging Amazon Aurora and Amazon RDS resources in the Amazon Aurora User Guide .
(structure)
Metadata assigned to an Amazon RDS resource consisting of a key-value pair.
For more information, see Tagging Amazon RDS resources in the Amazon RDS User Guide or Tagging Amazon Aurora and Amazon RDS resources in the Amazon Aurora User Guide .
Key -> (string)
A key is the required name of the tag. The string value can be from 1 to 128 Unicode characters in length and can't be prefixed withaws:
orrds:
. The string can only contain only the set of Unicode letters, digits, white-space, '_', '.', ':', '/', '=', '+', '-', '@' (Java regex: "^([\p{L}\p{Z}\p{N}_.:/=+\-@]*)$").Value -> (string)
A value is the optional value of the tag. The string value can be from 1 to 256 Unicode characters in length and can't be prefixed withaws:
orrds:
. The string can only contain only the set of Unicode letters, digits, white-space, '_', '.', ':', '/', '=', '+', '-', '@' (Java regex: "^([\p{L}\p{Z}\p{N}_.:/=+\-@]*)$").