create_cluster
¶
create_cluster(
*,
config_overrides: Optional[DSQLClientConfig] = None,
deletion_protection_enabled: Optional[DeletionProtectionEnabled] = None,
kms_encryption_key: Optional[KmsEncryptionKey] = None,
tags: Optional[TagMap] = None,
client_token: Optional[ClientToken] = None,
multi_region_properties: Optional[MultiRegionProperties] = None,
policy: Optional[PolicyDocument] = None,
bypass_policy_lockout_safety_check: Optional[BypassPolicyLockoutSafetyCheck] = None,
) -> CreateClusterOutput
The CreateCluster API allows you to create both single-Region clusters and multi-Region clusters. With the addition of the multiRegionProperties parameter, you can create a cluster with witness Region support and establish peer relationships with clusters in other Regions during creation.
Creating multi-Region clusters requires additional IAM permissions beyond those needed for single-Region clusters, as detailed in the Required permissions section below.
Required permissions
- dsql:CreateCluster
-
Required to create a cluster.
Resources:
arn:aws:dsql:region:account-id:cluster/* - dsql:TagResource
-
Permission to add tags to a resource.
Resources:
arn:aws:dsql:region:account-id:cluster/* - dsql:PutMultiRegionProperties
-
Permission to configure multi-Region properties for a cluster.
Resources:
arn:aws:dsql:region:account-id:cluster/* - dsql:AddPeerCluster
-
When specifying
multiRegionProperties.clusters, permission to add peer clusters.Resources:
-
Local cluster:
arn:aws:dsql:region:account-id:cluster/* -
Each peer cluster: exact ARN of each specified peer cluster
-
- dsql:PutWitnessRegion
-
When specifying
multiRegionProperties.witnessRegion, permission to set a witness Region. This permission is checked both in the cluster Region and in the witness Region.Resources:
arn:aws:dsql:region:account-id:cluster/*Condition Keys:
dsql:WitnessRegion(matching the specified witness region)
-
The witness Region specified in
multiRegionProperties.witnessRegioncannot be the same as the cluster's Region.
Parameters:
-
deletion_protection_enabled(Optional[DeletionProtectionEnabled], default:None) –If enabled, you can't delete your cluster. You must first disable this property before you can delete your cluster.
-
kms_encryption_key(Optional[KmsEncryptionKey], default:None) –The KMS key that encrypts and protects the data on your cluster. You can specify the ARN, ID, or alias of an existing key or have Amazon Web Services create a default key for you.
-
tags(Optional[TagMap], default:None) –A map of key and value pairs to use to tag your cluster.
-
client_token(Optional[ClientToken], default:None) –A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Idempotency ensures that an API request completes only once. With an idempotent request, if the original request completes successfully, the subsequent retries with the same client token return the result from the original successful request and they have no additional effect.
If you don't specify a client token, the Amazon Web Services SDK automatically generates one.
-
multi_region_properties(Optional[MultiRegionProperties], default:None) –The configuration settings when creating a multi-Region cluster, including the witness region and linked cluster properties.
-
policy(Optional[PolicyDocument], default:None) –An optional resource-based policy document in JSON format that defines access permissions for the cluster.
-
bypass_policy_lockout_safety_check(Optional[BypassPolicyLockoutSafetyCheck], default:None) –An optional field that controls whether to bypass the lockout prevention check. When set to true, this parameter allows you to apply a policy that might lock you out of the cluster. Use with caution.
Raises:
-
AccessDeniedException–You do not have sufficient access to perform this action.
-
InternalServerException–The request processing has failed because of an unknown error, exception or failure.
-
ThrottlingException–The request was denied due to request throttling.
-
ValidationException–The input failed to satisfy the constraints specified by an Amazon Web Services service.
-
ConflictException–The submitted action has conflicts.
-
ServiceQuotaExceededException–The service limit was exceeded.
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
Create Cluster
Source code in docs_src/capo_dsql/_services/dsql.py
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 444 445 446 447 448 449 450 | |