restoreDbClusterToPointInTime

Restores a DB cluster to an arbitrary point in time. Users can restore to any point in time before LatestRestorableTime for up to BackupRetentionPeriod days. The target DB cluster is created from the source DB cluster with the same configuration as the original DB cluster, except that the new DB cluster is created with the default DB security group. Unless the RestoreType is set to copy-on-write, the restore may occur in a different Availability Zone (AZ) from the original DB cluster. The AZ where RDS restores the DB cluster depends on the AZs in the specified subnet group.

You can use the EnableVPCNetworking and EnableInternetAccessGateway parameters together to restore an Aurora PostgreSQL cluster without VPC networking and with internet-based connectivity. These two parameters must always be specified together. Set EnableVPCNetworking to false to disable the VPC network interface (ENI) for the cluster. EnableInternetAccessGateway enables internet-based connectivity through an internet access gateway. IAM database authentication is required and must be enabled using EnableIAMDatabaseAuthentication. Once the cluster is restored, you need to modify the DB cluster to update MasterUserAuthenticationType to iam-db-auth.

For Aurora, this operation only restores the DB cluster, not the DB instances for that DB cluster. You must invoke the CreateDBInstance operation to create DB instances for the restored DB cluster, specifying the identifier of the restored DB cluster in DBClusterIdentifier. You can create DB instances only after the RestoreDBClusterToPointInTime operation has completed and the DB cluster is available.

For more information on Amazon Aurora DB clusters, see What is Amazon Aurora? in the Amazon Aurora User Guide.

For more information on Multi-AZ DB clusters, see Multi-AZ DB cluster deployments in the Amazon RDS User Guide.

Samples


fun main() { 
   //sampleStart 
   // The following example restores the DB cluster named database 4 to the latest possible time. Using
// copy on write as the restore type restores the new DB cluster as a clone of the source DB cluster.
val resp = rdsClient.restoreDbClusterToPointInTime {
    dbClusterIdentifier = "sample-cluster-clone"
    restoreType = "copy-on-write"
    sourceDbClusterIdentifier = "database-4"
    useLatestRestorableTime = true
} 
   //sampleEnd
}

fun main() { 
   //sampleStart 
   // The following example restores an Aurora DB cluster to the latest possible time without VPC
// networking and with internet based connectivity enabled through an internet access gateway. The
// EnableVPCNetworking and EnableInternetAccessGateway parameters must always be specified together. IAM database
// authentication is required when both parameters are specified.
val resp = rdsClient.restoreDbClusterToPointInTime {
    dbClusterIdentifier = "sample-cluster-restored"
    restoreType = "copy-on-write"
    sourceDbClusterIdentifier = "sample-cluster"
    useLatestRestorableTime = true
    enableVpcNetworking = false
    enableInternetAccessGateway = true
    enableIamDatabaseAuthentication = true
} 
   //sampleEnd
}