create_cluster
async
¶
create_cluster(
cluster_name: str,
auth_type: Auth,
admin_user_name: str,
admin_user_password: Password,
shard_capacity: int,
shard_count: int,
*,
config_overrides: Optional[AsyncDocDBElasticClientConfig] = None,
vpc_security_group_ids: Optional[StringList] = None,
subnet_ids: Optional[StringList] = None,
kms_key_id: Optional[str] = None,
client_token: Optional[str] = None,
preferred_maintenance_window: Optional[str] = None,
tags: Optional[TagMap] = None,
backup_retention_period: Optional[int] = None,
preferred_backup_window: Optional[str] = None,
shard_instance_count: Optional[int] = None,
) -> CreateClusterOutput
Creates a new Amazon DocumentDB elastic cluster and returns its cluster structure.
Parameters:
-
cluster_name(str) –The name of the new elastic cluster. This parameter is stored as a lowercase string.
Constraints:
-
Must contain from 1 to 63 letters, numbers, or hyphens.
-
The first character must be a letter.
-
Cannot end with a hyphen or contain two consecutive hyphens.
Example:
my-cluster -
-
auth_type(Auth) –The authentication type used to determine where to fetch the password used for accessing the elastic cluster. Valid types are
PLAIN_TEXTorSECRET_ARN. -
admin_user_name(str) –The name of the Amazon DocumentDB elastic clusters administrator.
Constraints:
-
Must be from 1 to 63 letters or numbers.
-
The first character must be a letter.
-
Cannot be a reserved word.
-
-
admin_user_password(Password) –The password for the Amazon DocumentDB elastic clusters administrator. The password can contain any printable ASCII characters.
Constraints:
-
Must contain from 8 to 100 characters.
-
Cannot contain a forward slash (/), double quote ("), or the "at" symbol (@).
-
-
shard_capacity(int) –The number of vCPUs assigned to each elastic cluster shard. Maximum is 64. Allowed values are 2, 4, 8, 16, 32, 64.
-
shard_count(int) –The number of shards assigned to the elastic cluster. Maximum is 32.
-
vpc_security_group_ids(Optional[StringList], default:None) –A list of EC2 VPC security groups to associate with the new elastic cluster.
-
subnet_ids(Optional[StringList], default:None) –The Amazon EC2 subnet IDs for the new elastic cluster.
-
kms_key_id(Optional[str], default:None) –The KMS key identifier to use to encrypt the new elastic cluster.
The KMS key identifier is the Amazon Resource Name (ARN) for the KMS encryption key. If you are creating a cluster using the same Amazon account that owns this KMS encryption key, you can use the KMS key alias instead of the ARN as the KMS encryption key.
If an encryption key is not specified, Amazon DocumentDB uses the default encryption key that KMS creates for your account. Your account has a different default encryption key for each Amazon Region.
-
client_token(Optional[str], default:None) –The client token for the elastic cluster.
-
preferred_maintenance_window(Optional[str], default:None) –The weekly time range during which system maintenance can occur, in Universal Coordinated Time (UTC).
Format:
ddd:hh24:mi-ddd:hh24:miDefault: a 30-minute window selected at random from an 8-hour block of time for each Amazon Web Services Region, occurring on a random day of the week.
Valid days: Mon, Tue, Wed, Thu, Fri, Sat, Sun
Constraints: Minimum 30-minute window.
-
tags(Optional[TagMap], default:None) –The tags to be assigned to the new elastic cluster.
-
backup_retention_period(Optional[int], default:None) –The number of days for which automatic snapshots are retained.
-
preferred_backup_window(Optional[str], default:None) –The daily time range during which automated backups are created if automated backups are enabled, as determined by the
backupRetentionPeriod. -
shard_instance_count(Optional[int], default:None) –The number of replica instances applying to all shards in the elastic cluster. A
shardInstanceCountvalue of 1 means there is one writer instance, and any additional instances are replicas that can be used for reads and to improve availability.
Raises:
-
AccessDeniedException–An exception that occurs when there are not sufficient permissions to perform an action.
-
ConflictException–There was an access conflict.
-
InternalServerException–There was an internal server error.
-
ServiceQuotaExceededException–The service quota for the action was exceeded.
-
ThrottlingException–ThrottlingException will be thrown when request was denied due to request throttling.
-
ValidationException–A structure defining a validation exception.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_docdb_elastic/_services/async_doc_db_elastic.py
330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 | |