AWS SDK Version 3 for .NET
API Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

Creates a new DB instance from a DB snapshot. The target database is created from the source database restore point with most of the source's original configuration, including the default security group and DB parameter group. By default, the new DB instance is created as a Single-AZ deployment, except when the instance is a SQL Server instance that has an option group associated with mirroring. In this case, the instance becomes a Multi-AZ deployment, not a Single-AZ deployment.

If you want to replace your original DB instance with the new, restored DB instance, then rename your original DB instance before you call the RestoreDBInstanceFromDBSnapshot operation. RDS doesn't allow two DB instances with the same name. After you have renamed your original DB instance with a different identifier, then you can pass the original name of the DB instance as the DBInstanceIdentifier in the call to the RestoreDBInstanceFromDBSnapshot operation. The result is that you replace the original DB instance with the DB instance created from the snapshot.

If you are restoring from a shared manual DB snapshot, the DBSnapshotIdentifier must be the ARN of the shared DB snapshot.

This command doesn't apply to Aurora MySQL and Aurora PostgreSQL. For Aurora, use RestoreDBClusterFromSnapshot.

Note:

This is an asynchronous operation using the standard naming convention for .NET 4.5 or higher. For .NET 3.5 the operation is implemented as a pair of methods using the standard naming convention of BeginRestoreDBInstanceFromDBSnapshot and EndRestoreDBInstanceFromDBSnapshot.

Namespace: Amazon.RDS
Assembly: AWSSDK.RDS.dll
Version: 3.x.y.z

Syntax

C#
public virtual Task<RestoreDBInstanceFromDBSnapshotResponse> RestoreDBInstanceFromDBSnapshotAsync(
         RestoreDBInstanceFromDBSnapshotRequest request,
         CancellationToken cancellationToken
)

Parameters

request
Type: Amazon.RDS.Model.RestoreDBInstanceFromDBSnapshotRequest

Container for the necessary parameters to execute the RestoreDBInstanceFromDBSnapshot service method.

cancellationToken
Type: System.Threading.CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Return Value


The response from the RestoreDBInstanceFromDBSnapshot service method, as returned by RDS.

Exceptions

ExceptionCondition
AuthorizationNotFoundException The specified CIDR IP range or Amazon EC2 security group might not be authorized for the specified DB security group. Or, RDS might not be authorized to perform necessary actions using IAM on your behalf.
BackupPolicyNotFoundException
CertificateNotFoundException CertificateIdentifier doesn't refer to an existing certificate.
DBClusterSnapshotNotFoundException DBClusterSnapshotIdentifier doesn't refer to an existing DB cluster snapshot.
DBInstanceAlreadyExistsException The user already has a DB instance with the given identifier.
DBParameterGroupNotFoundException DBParameterGroupName doesn't refer to an existing DB parameter group.
DBSecurityGroupNotFoundException DBSecurityGroupName doesn't refer to an existing DB security group.
DBSnapshotNotFoundException DBSnapshotIdentifier doesn't refer to an existing DB snapshot.
DBSubnetGroupDoesNotCoverEnoughAZsException Subnets in the DB subnet group should cover at least two Availability Zones unless there is only one Availability Zone.
DBSubnetGroupNotFoundException DBSubnetGroupName doesn't refer to an existing DB subnet group.
DomainNotFoundException Domain doesn't refer to an existing Active Directory domain.
InstanceQuotaExceededException The request would result in the user exceeding the allowed number of DB instances.
InsufficientDBInstanceCapacityException The specified DB instance class isn't available in the specified Availability Zone.
InvalidDBSnapshotStateException The state of the DB snapshot doesn't allow deletion.
InvalidRestoreException Cannot restore from VPC backup to non-VPC DB instance.
InvalidSubnetException The requested subnet is invalid, or multiple subnets were requested that are not all in a common VPC.
InvalidVPCNetworkStateException The DB subnet group doesn't cover all Availability Zones after it's created because of users' change.
KMSKeyNotAccessibleException An error occurred accessing an Amazon Web Services KMS key.
NetworkTypeNotSupportedException The network type is invalid for the DB instance. Valid nework type values are IPV4 and DUAL.
OptionGroupNotFoundException The specified option group could not be found.
ProvisionedIopsNotAvailableInAZException Provisioned IOPS not available in the specified Availability Zone.
StorageQuotaExceededException The request would result in the user exceeding the allowed amount of storage available across all DB instances.
StorageTypeNotSupportedException The specified StorageType can't be associated with the DB instance.
TenantDatabaseQuotaExceededException You attempted to create more tenant databases than are permitted in your Amazon Web Services account.

Version Information

.NET Core App:
Supported in: 3.1

.NET Standard:
Supported in: 2.0

.NET Framework:
Supported in: 4.5

See Also