restore_db_cluster_from_snapshot
¶
restore_db_cluster_from_snapshot(
*,
config_overrides: Optional[NeptuneClientConfig] = None,
availability_zones: Optional[AvailabilityZones] = None,
db_cluster_identifier: Optional[String] = None,
snapshot_identifier: Optional[String] = None,
engine: Optional[String] = None,
engine_version: Optional[String] = None,
port: Optional[IntegerOptional] = None,
db_subnet_group_name: Optional[String] = None,
database_name: Optional[String] = None,
option_group_name: Optional[String] = None,
vpc_security_group_ids: Optional[VpcSecurityGroupIdList] = None,
tags: Optional[TagList] = None,
kms_key_id: Optional[String] = None,
enable_iam_database_authentication: Optional[BooleanOptional] = None,
enable_cloudwatch_logs_exports: Optional[LogTypeList] = None,
db_cluster_parameter_group_name: Optional[String] = None,
deletion_protection: Optional[BooleanOptional] = None,
copy_tags_to_snapshot: Optional[BooleanOptional] = None,
serverless_v2_scaling_configuration: Optional[
ServerlessV2ScalingConfiguration
] = None,
storage_type: Optional[String] = None,
network_type: Optional[String] = None,
) -> RestoreDBClusterFromSnapshotResult
Creates a new DB cluster from a DB snapshot or DB cluster snapshot.
If a DB snapshot is specified, the target DB cluster is created from the source DB snapshot with a default configuration and default security group.
If a DB cluster snapshot is specified, the target DB cluster is created from the source DB cluster restore point with the same configuration as the original source DB cluster, except that the new DB cluster is created with the default security group.
Parameters:
-
availability_zones(Optional[AvailabilityZones], default:None) –Provides the list of EC2 Availability Zones that instances in the restored DB cluster can be created in.
-
db_cluster_identifier(Optional[String], default:None) –The name of the DB cluster to create from the DB snapshot or DB cluster snapshot. This parameter isn't case-sensitive.
Constraints:
-
Must contain from 1 to 63 letters, numbers, or hyphens
-
First character must be a letter
-
Cannot end with a hyphen or contain two consecutive hyphens
Example:
my-snapshot-id -
-
snapshot_identifier(Optional[String], default:None) –The identifier for the DB snapshot or DB cluster snapshot to restore from.
You can use either the name or the Amazon Resource Name (ARN) to specify a DB cluster snapshot. However, you can use only the ARN to specify a DB snapshot.
Constraints:
-
Must match the identifier of an existing Snapshot.
-
-
engine(Optional[String], default:None) –The database engine to use for the new DB cluster.
Default: The same as source
Constraint: Must be compatible with the engine of the source
-
engine_version(Optional[String], default:None) –The version of the database engine to use for the new DB cluster.
-
port(Optional[IntegerOptional], default:None) –The port number on which the new DB cluster accepts connections.
Constraints: Value must be
1150-65535Default: The same port as the original DB cluster.
-
db_subnet_group_name(Optional[String], default:None) –The name of the DB subnet group to use for the new DB cluster.
Constraints: If supplied, must match the name of an existing DBSubnetGroup.
Example:
mySubnetgroup -
database_name(Optional[String], default:None) –Not supported.
-
option_group_name(Optional[String], default:None) –(Not supported by Neptune)
-
vpc_security_group_ids(Optional[VpcSecurityGroupIdList], default:None) –A list of VPC security groups that the new DB cluster will belong to.
-
tags(Optional[TagList], default:None) –The tags to be assigned to the restored DB cluster.
-
kms_key_id(Optional[String], default:None) –The Amazon KMS key identifier to use when restoring an encrypted DB cluster from a DB snapshot or DB cluster snapshot.
The KMS key identifier is the Amazon Resource Name (ARN) for the KMS encryption key. If you are restoring a DB cluster with the same Amazon account that owns the KMS encryption key used to encrypt the new DB cluster, then you can use the KMS key alias instead of the ARN for the KMS encryption key.
If you do not specify a value for the
KmsKeyIdparameter, then the following will occur:-
If the DB snapshot or DB cluster snapshot in
SnapshotIdentifieris encrypted, then the restored DB cluster is encrypted using the KMS key that was used to encrypt the DB snapshot or DB cluster snapshot. -
If the DB snapshot or DB cluster snapshot in
SnapshotIdentifieris not encrypted, then the restored DB cluster is not encrypted.
-
-
enable_iam_database_authentication(Optional[BooleanOptional], default:None) –True to enable mapping of Amazon Identity and Access Management (IAM) accounts to database accounts, and otherwise false.
Default:
false -
enable_cloudwatch_logs_exports(Optional[LogTypeList], default:None) –The list of logs that the restored DB cluster is to export to Amazon CloudWatch Logs.
-
db_cluster_parameter_group_name(Optional[String], default:None) –The name of the DB cluster parameter group to associate with the new DB cluster.
Constraints:
-
If supplied, must match the name of an existing DBClusterParameterGroup.
-
-
deletion_protection(Optional[BooleanOptional], default:None) –A value that indicates whether the DB cluster has deletion protection enabled. The database can't be deleted when deletion protection is enabled. By default, deletion protection is disabled.
-
copy_tags_to_snapshot(Optional[BooleanOptional], default:None) –If set to
true, tags are copied to any snapshot of the restored DB cluster that is created. -
serverless_v2_scaling_configuration(Optional[ServerlessV2ScalingConfiguration], default:None) –Contains the scaling configuration of a Neptune Serverless DB cluster.
For more information, see Using Amazon Neptune Serverless in the Amazon Neptune User Guide.
-
storage_type(Optional[String], default:None) –Specifies the storage type to be associated with the DB cluster.
Valid values:
standard,iopt1Default:
standard -
network_type(Optional[String], default:None) –The network type of the DB cluster.
Valid Values:
-
IPV4– ( the default ) The DB cluster uses only IPv4 addresses for communication. -
DUAL– The DB cluster uses both IPv4 and IPv6 addresses for communication. The DB subnet group associated with the cluster must support IPv6.
-
Raises:
-
DBClusterAlreadyExistsFault–User already has a DB cluster with the given identifier.
-
DBClusterParameterGroupNotFoundFault–DBClusterParameterGroupName does not refer to an existing DB Cluster parameter group.
-
DBClusterQuotaExceededFault–User attempted to create a new DB cluster and the user has already reached the maximum allowed DB cluster quota.
-
DBClusterSnapshotNotFoundFault–DBClusterSnapshotIdentifier does not refer to an existing DB cluster snapshot.
-
DBSnapshotNotFoundFault–DBSnapshotIdentifier does not refer to an existing DB snapshot.
-
DBSubnetGroupNotFoundFault–DBSubnetGroupName does not refer to an existing DB subnet group.
-
InsufficientDBClusterCapacityFault–The DB cluster does not have enough capacity for the current operation.
-
InsufficientStorageClusterCapacityFault–There is insufficient storage available for the current action. You may be able to resolve this error by updating your subnet group to use different Availability Zones that have more storage available.
-
InvalidDBClusterSnapshotStateFault–The supplied value is not a valid DB cluster snapshot state.
-
InvalidDBSnapshotStateFault–The state of the DB snapshot does not allow deletion.
-
InvalidRestoreFault–Cannot restore from vpc backup to non-vpc DB instance.
-
InvalidSubnet–The requested subnet is invalid, or multiple subnets were requested that are not all in a common VPC.
-
InvalidVPCNetworkStateFault–DB subnet group does not cover all Availability Zones after it is created because users' change.
-
KMSKeyNotAccessibleFault–Error accessing KMS key.
-
NetworkTypeNotSupportedFault–The specified NetworkType is not supported for the DB cluster, DB subnet group, or orderable DB instance option.
-
OptionGroupNotFoundFault–The designated option group could not be found.
-
StorageQuotaExceededFault–Request would result in user exceeding the allowed amount of storage available across all DB instances.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_neptune/_services/neptune.py
5321 5322 5323 5324 5325 5326 5327 5328 5329 5330 5331 5332 5333 5334 5335 5336 5337 5338 5339 5340 5341 5342 5343 5344 5345 5346 5347 5348 5349 5350 5351 5352 5353 5354 5355 5356 5357 5358 5359 5360 5361 5362 5363 5364 5365 5366 5367 5368 5369 5370 5371 5372 5373 5374 5375 5376 5377 5378 5379 5380 5381 5382 5383 5384 5385 5386 5387 5388 5389 5390 5391 5392 5393 5394 5395 5396 5397 5398 5399 5400 5401 5402 5403 5404 5405 5406 5407 5408 5409 5410 5411 5412 5413 5414 5415 5416 5417 5418 5419 5420 5421 5422 5423 5424 5425 5426 5427 5428 5429 5430 5431 5432 5433 5434 5435 5436 5437 5438 5439 5440 5441 5442 5443 5444 5445 5446 5447 5448 5449 5450 5451 5452 5453 5454 5455 5456 5457 5458 5459 5460 5461 5462 5463 5464 5465 5466 5467 5468 5469 5470 5471 5472 5473 5474 5475 5476 | |