restore_db_cluster_to_point_in_time
¶
restore_db_cluster_to_point_in_time(
*,
config_overrides: Optional[DocDBClientConfig] = None,
db_cluster_identifier: Optional[String] = None,
restore_type: Optional[String] = None,
source_db_cluster_identifier: Optional[String] = None,
restore_to_time: Optional[TStamp] = None,
use_latest_restorable_time: Optional[Boolean] = 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,
serverless_v2_scaling_configuration: Optional[
ServerlessV2ScalingConfiguration
] = None,
storage_type: Optional[String] = None,
network_type: Optional[String] = None,
copy_tags_to_snapshot: Optional[BooleanOptional] = None,
) -> RestoreDBClusterToPointInTimeResult
Restores a cluster to an arbitrary point in time. Users can restore to any point in time before LatestRestorableTime for up to BackupRetentionPeriod days. The target cluster is created from the source cluster with the same configuration as the original cluster, except that the new cluster is created with the default security group.
Parameters:
-
db_cluster_identifier(Optional[String], default:None) –The name of the new cluster to be created.
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.
-
-
restore_type(Optional[String], default:None) –The type of restore to be performed. You can specify one of the following values:
-
full-copy- The new DB cluster is restored as a full copy of the source DB cluster. -
copy-on-write- The new DB cluster is restored as a clone of the source DB cluster.
Constraints: You can't specify
copy-on-writeif the engine version of the source DB cluster is earlier than 1.11.If you don't specify a
RestoreTypevalue, then the new DB cluster is restored as a full copy of the source DB cluster. -
-
source_db_cluster_identifier(Optional[String], default:None) –The identifier of the source cluster from which to restore.
Constraints:
-
Must match the identifier of an existing
DBCluster.
-
-
restore_to_time(Optional[TStamp], default:None) –The date and time to restore the cluster to.
Valid values: A time in Universal Coordinated Time (UTC) format.
Constraints:
-
Must be before the latest restorable time for the instance.
-
Must be specified if the
UseLatestRestorableTimeparameter is not provided. -
Cannot be specified if the
UseLatestRestorableTimeparameter istrue. -
Cannot be specified if the
RestoreTypeparameter iscopy-on-write.
Example:
2015-03-07T23:45:00Z -
-
use_latest_restorable_time(Optional[Boolean], default:None) –A value that is set to
trueto restore the cluster to the latest restorable backup time, andfalseotherwise.Default:
falseConstraints: Cannot be specified if the
RestoreToTimeparameter is provided. -
port(Optional[IntegerOptional], default:None) –The port number on which the new cluster accepts connections.
Constraints: Must be a value from
1150to65535.Default: The default port for the engine.
-
db_subnet_group_name(Optional[String], default:None) –The subnet group name 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 VPC security groups that the new cluster belongs 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 an encrypted cluster.
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.
You can restore to a new cluster and encrypt the new cluster with an KMS key that is different from the KMS key used to encrypt the source cluster. The new DB cluster is encrypted with the KMS key identified by the
KmsKeyIdparameter.If you do not specify a value for the
KmsKeyIdparameter, then the following occurs:-
If the cluster is encrypted, then the restored cluster is encrypted using the KMS key that was used to encrypt the source cluster.
-
If the cluster is not encrypted, then the restored cluster is not encrypted.
If
DBClusterIdentifierrefers to a cluster that is not encrypted, then the restore request is rejected. -
-
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. -
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.
-
DBClusterNotFoundFault–DBClusterIdentifierdoesn't refer to an existing cluster. -
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. -
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.
-
InvalidDBClusterStateFault–The cluster isn't in a valid 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
4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 | |