restore_db_cluster_from_snapshot
¶
restore_db_cluster_from_snapshot(
*,
config_overrides: Optional[DocDBClientConfig] = 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,
vpc_security_group_ids: Optional[VpcSecurityGroupIdList] = None,
tags: Optional[TagList] = None,
kms_key_id: Optional[String] = None,
enable_cloudwatch_logs_exports: Optional[LogTypeList] = None,
deletion_protection: Optional[BooleanOptional] = None,
db_cluster_parameter_group_name: Optional[String] = None,
serverless_v2_scaling_configuration: Optional[
ServerlessV2ScalingConfiguration
] = None,
storage_type: Optional[String] = None,
network_type: Optional[String] = None,
copy_tags_to_snapshot: Optional[BooleanOptional] = None,
) -> RestoreDBClusterFromSnapshotResult
Creates a new cluster from a snapshot or cluster snapshot.
If a snapshot is specified, the target cluster is created from the source DB snapshot with a default configuration and default security group.
If a cluster snapshot is specified, the target cluster is created from the source cluster restore point with the same configuration as the original source DB cluster, except that the new cluster is created with the default security group.
Parameters:
-
availability_zones(Optional[AvailabilityZones], default:None) –Provides the list of Amazon 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 cluster to create from the snapshot or cluster snapshot. This parameter isn't case sensitive.
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-snapshot-id -
-
snapshot_identifier(Optional[String], default:None) –The identifier for the snapshot or cluster snapshot to restore from.
You can use either the name or the Amazon Resource Name (ARN) to specify a cluster snapshot. However, you can use only the ARN to specify a snapshot.
Constraints:
-
Must match the identifier of an existing snapshot.
-
-
engine(Optional[String], default:None) –The database engine to use for the new 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 cluster.
-
port(Optional[IntegerOptional], default:None) –The port number on which the new cluster accepts connections.
Constraints: Must be a value from
1150to65535.Default: The same port as the original cluster.
-
db_subnet_group_name(Optional[String], default:None) –The name of the subnet group to use for the new cluster.
Constraints: If provided, must match the name of an existing
DBSubnetGroup.Example:
mySubnetgroup -
vpc_security_group_ids(Optional[VpcSecurityGroupIdList], default:None) –A list of virtual private cloud (VPC) security groups that the new cluster will belong to.
-
tags(Optional[TagList], default:None) –The tags to be assigned to the restored cluster.
-
kms_key_id(Optional[String], default:None) –The KMS key identifier to use when restoring an encrypted cluster from a DB snapshot or cluster snapshot.
The KMS key identifier is the Amazon Resource Name (ARN) for the KMS encryption key. If you are restoring a cluster with the same Amazon Web Services account that owns the KMS encryption key used to encrypt the new 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 occurs:-
If the snapshot or cluster snapshot in
SnapshotIdentifieris encrypted, then the restored cluster is encrypted using the KMS key that was used to encrypt the snapshot or the cluster snapshot. -
If the snapshot or the cluster snapshot in
SnapshotIdentifieris not encrypted, then the restored DB cluster is not encrypted.
-
-
enable_cloudwatch_logs_exports(Optional[LogTypeList], default:None) –A list of log types that must be enabled for exporting to Amazon CloudWatch Logs.
-
deletion_protection(Optional[BooleanOptional], default:None) –Specifies whether this cluster can be deleted. If
DeletionProtectionis enabled, the cluster cannot be deleted unless it is modified andDeletionProtectionis disabled.DeletionProtectionprotects clusters from being accidentally deleted. -
db_cluster_parameter_group_name(Optional[String], default:None) –The name of the DB cluster parameter group to associate with this DB cluster.
Type: String. Required: No.
If this argument is omitted, the default DB cluster parameter group is used. If supplied, must match the name of an existing default DB cluster parameter group. The string must consist of from 1 to 255 letters, numbers or hyphens. Its first character must be a letter, and it cannot end with a hyphen or contain two consecutive hyphens.
-
serverless_v2_scaling_configuration(Optional[ServerlessV2ScalingConfiguration], default:None) –Contains the scaling configuration of an Amazon DocumentDB Serverless cluster.
-
storage_type(Optional[String], default:None) –The storage type to associate with the DB cluster.
For information on storage types for Amazon DocumentDB clusters, see Cluster storage configurations in the Amazon DocumentDB Developer Guide.
Valid values for storage type -
standard | iopt1Default value is
standard -
network_type(Optional[String], default:None) –The network type of the cluster.
The network type is determined by the
DBSubnetGroupspecified for the cluster. ADBSubnetGroupcan support only the IPv4 protocol or the IPv4 and the IPv6 protocols (DUAL).For more information, see DocumentDB clusters in a VPC in the Amazon DocumentDB Developer Guide.
Valid Values:
IPV4|DUAL -
copy_tags_to_snapshot(Optional[BooleanOptional], default:None) –Specifies whether to copy all tags from the restored DB cluster to snapshots of the restored DB cluster. The default is not to copy them.
Raises:
-
DBClusterAlreadyExistsFault–You already have a cluster with the given identifier.
-
DBClusterQuotaExceededFault–The cluster can't be created because you have reached the maximum allowed quota of clusters.
-
DBClusterSnapshotNotFoundFault–DBClusterSnapshotIdentifierdoesn't refer to an existing cluster snapshot. -
DBSnapshotNotFoundFault–DBSnapshotIdentifierdoesn't refer to an existing snapshot. -
DBSubnetGroupNotFoundFault–DBSubnetGroupNamedoesn't refer to an existing subnet group. -
InsufficientDBClusterCapacityFault–The cluster doesn't have enough capacity for the current operation.
-
InsufficientStorageClusterCapacityFault–There is not enough storage available for the current action. You might be able to resolve this error by updating your subnet group to use different Availability Zones that have more storage available.
-
InvalidDBClusterSnapshotStateFault–The provided value isn't a valid cluster snapshot state.
-
InvalidDBSnapshotStateFault–The state of the snapshot doesn't allow deletion.
-
InvalidRestoreFault–You cannot restore from a virtual private cloud (VPC) backup to a non-VPC DB instance.
-
InvalidSubnet–The requested subnet is not valid, or multiple subnets were requested that are not all in a common virtual private cloud (VPC).
-
InvalidVPCNetworkStateFault–The subnet group doesn't cover all Availability Zones after it is created because of changes that were made.
-
KMSKeyNotAccessibleFault–An error occurred when accessing an KMS key.
-
NetworkTypeNotSupported–The network type is not supported by either
DBSubnetGroupor the DB engine version. -
StorageQuotaExceededFault–The request would cause you to exceed the allowed amount of storage available across all instances.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_docdb/_services/doc_db.py
3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 | |