restoreDbClusterFromSnapshot
Creates a new DB cluster from a DB snapshot or DB cluster snapshot.
The target DB cluster is created from the source snapshot with a default configuration. If you don't specify a security group, the new DB cluster is associated with the default security 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.
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 RestoreDBClusterFromSnapshot 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 an Aurora PostgreSQL DB cluster compatible with PostgreSQL version
// 10. 7 from a DB cluster snapshot named test instance snapshot.
val resp = rdsClient.restoreDbClusterFromSnapshot {
dbClusterIdentifier = "newdbcluster"
snapshotIdentifier = "test-instance-snapshot"
engine = "aurora-postgresql"
engineVersion = "10.7"
}
//sampleEnd
}
fun main() {
//sampleStart
// The following example restores an Aurora DB cluster from a DB cluster snapshot named sample cluster
// snapshot 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.restoreDbClusterFromSnapshot {
dbClusterIdentifier = "restored-cluster"
snapshotIdentifier = "sample-cluster-snapshot"
engine = "aurora-postgresql"
enableVpcNetworking = false
enableInternetAccessGateway = true
enableIamDatabaseAuthentication = true
}
//sampleEnd
}