RestoreDBClusterFromSnapshotCommand

Creates a new DB cluster from a DB snapshot or DB cluster snapshot.

If a DB snapshot is specified, the target DB cluster is created from the source DB snapshot with a default configuration and default security group.

If a DB cluster snapshot is specified, the target DB cluster is created from the source DB cluster restore point with the same configuration as the original source DB cluster, except that the new DB cluster is created with the default security group.

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { NeptuneClient, RestoreDBClusterFromSnapshotCommand } from "@aws-sdk/client-neptune"; // ES Modules import
// const { NeptuneClient, RestoreDBClusterFromSnapshotCommand } = require("@aws-sdk/client-neptune"); // CommonJS import
const client = new NeptuneClient(config);
const input = { // RestoreDBClusterFromSnapshotMessage
  AvailabilityZones: [ // AvailabilityZones
    "STRING_VALUE",
  ],
  DBClusterIdentifier: "STRING_VALUE", // required
  SnapshotIdentifier: "STRING_VALUE", // required
  Engine: "STRING_VALUE", // required
  EngineVersion: "STRING_VALUE",
  Port: Number("int"),
  DBSubnetGroupName: "STRING_VALUE",
  DatabaseName: "STRING_VALUE",
  OptionGroupName: "STRING_VALUE",
  VpcSecurityGroupIds: [ // VpcSecurityGroupIdList
    "STRING_VALUE",
  ],
  Tags: [ // TagList
    { // Tag
      Key: "STRING_VALUE",
      Value: "STRING_VALUE",
    },
  ],
  KmsKeyId: "STRING_VALUE",
  EnableIAMDatabaseAuthentication: true || false,
  EnableCloudwatchLogsExports: [ // LogTypeList
    "STRING_VALUE",
  ],
  DBClusterParameterGroupName: "STRING_VALUE",
  DeletionProtection: true || false,
  CopyTagsToSnapshot: true || false,
  ServerlessV2ScalingConfiguration: { // ServerlessV2ScalingConfiguration
    MinCapacity: Number("double"),
    MaxCapacity: Number("double"),
  },
  StorageType: "STRING_VALUE",
};
const command = new RestoreDBClusterFromSnapshotCommand(input);
const response = await client.send(command);
// { // RestoreDBClusterFromSnapshotResult
//   DBCluster: { // DBCluster
//     AllocatedStorage: Number("int"),
//     AvailabilityZones: [ // AvailabilityZones
//       "STRING_VALUE",
//     ],
//     BackupRetentionPeriod: Number("int"),
//     CharacterSetName: "STRING_VALUE",
//     DatabaseName: "STRING_VALUE",
//     DBClusterIdentifier: "STRING_VALUE",
//     DBClusterParameterGroup: "STRING_VALUE",
//     DBSubnetGroup: "STRING_VALUE",
//     Status: "STRING_VALUE",
//     PercentProgress: "STRING_VALUE",
//     EarliestRestorableTime: new Date("TIMESTAMP"),
//     Endpoint: "STRING_VALUE",
//     ReaderEndpoint: "STRING_VALUE",
//     MultiAZ: true || false,
//     Engine: "STRING_VALUE",
//     EngineVersion: "STRING_VALUE",
//     LatestRestorableTime: new Date("TIMESTAMP"),
//     Port: Number("int"),
//     MasterUsername: "STRING_VALUE",
//     DBClusterOptionGroupMemberships: [ // DBClusterOptionGroupMemberships
//       { // DBClusterOptionGroupStatus
//         DBClusterOptionGroupName: "STRING_VALUE",
//         Status: "STRING_VALUE",
//       },
//     ],
//     PreferredBackupWindow: "STRING_VALUE",
//     PreferredMaintenanceWindow: "STRING_VALUE",
//     ReplicationSourceIdentifier: "STRING_VALUE",
//     ReadReplicaIdentifiers: [ // ReadReplicaIdentifierList
//       "STRING_VALUE",
//     ],
//     DBClusterMembers: [ // DBClusterMemberList
//       { // DBClusterMember
//         DBInstanceIdentifier: "STRING_VALUE",
//         IsClusterWriter: true || false,
//         DBClusterParameterGroupStatus: "STRING_VALUE",
//         PromotionTier: Number("int"),
//       },
//     ],
//     VpcSecurityGroups: [ // VpcSecurityGroupMembershipList
//       { // VpcSecurityGroupMembership
//         VpcSecurityGroupId: "STRING_VALUE",
//         Status: "STRING_VALUE",
//       },
//     ],
//     HostedZoneId: "STRING_VALUE",
//     StorageEncrypted: true || false,
//     KmsKeyId: "STRING_VALUE",
//     DbClusterResourceId: "STRING_VALUE",
//     DBClusterArn: "STRING_VALUE",
//     AssociatedRoles: [ // DBClusterRoles
//       { // DBClusterRole
//         RoleArn: "STRING_VALUE",
//         Status: "STRING_VALUE",
//         FeatureName: "STRING_VALUE",
//       },
//     ],
//     IAMDatabaseAuthenticationEnabled: true || false,
//     CloneGroupId: "STRING_VALUE",
//     ClusterCreateTime: new Date("TIMESTAMP"),
//     CopyTagsToSnapshot: true || false,
//     EnabledCloudwatchLogsExports: [ // LogTypeList
//       "STRING_VALUE",
//     ],
//     PendingModifiedValues: { // ClusterPendingModifiedValues
//       PendingCloudwatchLogsExports: { // PendingCloudwatchLogsExports
//         LogTypesToEnable: [
//           "STRING_VALUE",
//         ],
//         LogTypesToDisable: [
//           "STRING_VALUE",
//         ],
//       },
//       DBClusterIdentifier: "STRING_VALUE",
//       IAMDatabaseAuthenticationEnabled: true || false,
//       EngineVersion: "STRING_VALUE",
//       BackupRetentionPeriod: Number("int"),
//       StorageType: "STRING_VALUE",
//       AllocatedStorage: Number("int"),
//       Iops: Number("int"),
//     },
//     DeletionProtection: true || false,
//     CrossAccountClone: true || false,
//     AutomaticRestartTime: new Date("TIMESTAMP"),
//     ServerlessV2ScalingConfiguration: { // ServerlessV2ScalingConfigurationInfo
//       MinCapacity: Number("double"),
//       MaxCapacity: Number("double"),
//     },
//     GlobalClusterIdentifier: "STRING_VALUE",
//     IOOptimizedNextAllowedModificationTime: new Date("TIMESTAMP"),
//     StorageType: "STRING_VALUE",
//   },
// };

RestoreDBClusterFromSnapshotCommand Input

Parameter
Type
Description
DBClusterIdentifier
Required
string | undefined

The name of the DB cluster to create from the DB snapshot or DB cluster snapshot. This parameter isn't case-sensitive.

Constraints:

  • Must contain from 1 to 63 letters, numbers, or hyphens

  • First character must be a letter

  • Cannot end with a hyphen or contain two consecutive hyphens

Example: my-snapshot-id

Engine
Required
string | undefined

The database engine to use for the new DB cluster.

Default: The same as source

Constraint: Must be compatible with the engine of the source

SnapshotIdentifier
Required
string | undefined

The identifier for the DB snapshot or DB cluster snapshot to restore from.

You can use either the name or the Amazon Resource Name (ARN) to specify a DB cluster snapshot. However, you can use only the ARN to specify a DB snapshot.

Constraints:

  • Must match the identifier of an existing Snapshot.

AvailabilityZones
string[] | undefined

Provides the list of EC2 Availability Zones that instances in the restored DB cluster can be created in.

CopyTagsToSnapshot
boolean | undefined

If set to true, tags are copied to any snapshot of the restored DB cluster that is created.

DBClusterParameterGroupName
string | undefined

The name of the DB cluster parameter group to associate with the new DB cluster.

Constraints:

  • If supplied, must match the name of an existing DBClusterParameterGroup.

DBSubnetGroupName
string | undefined

The name of the DB subnet group to use for the new DB cluster.

Constraints: If supplied, must match the name of an existing DBSubnetGroup.

Example: mySubnetgroup

DatabaseName
string | undefined

Not supported.

DeletionProtection
boolean | undefined

A value that indicates whether the DB cluster has deletion protection enabled. The database can't be deleted when deletion protection is enabled. By default, deletion protection is disabled.

EnableCloudwatchLogsExports
string[] | undefined

The list of logs that the restored DB cluster is to export to Amazon CloudWatch Logs.

EnableIAMDatabaseAuthentication
boolean | undefined

True to enable mapping of Amazon Identity and Access Management (IAM) accounts to database accounts, and otherwise false.

Default: false

EngineVersion
string | undefined

The version of the database engine to use for the new DB cluster.

KmsKeyId
string | undefined

The Amazon KMS key identifier to use when restoring an encrypted DB cluster from a DB snapshot or DB cluster snapshot.

The KMS key identifier is the Amazon Resource Name (ARN) for the KMS encryption key. If you are restoring a DB cluster with the same Amazon account that owns the KMS encryption key used to encrypt the new DB 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 KmsKeyId parameter, then the following will occur:

  • If the DB snapshot or DB cluster snapshot in SnapshotIdentifier is encrypted, then the restored DB cluster is encrypted using the KMS key that was used to encrypt the DB snapshot or DB cluster snapshot.

  • If the DB snapshot or DB cluster snapshot in SnapshotIdentifier is not encrypted, then the restored DB cluster is not encrypted.

OptionGroupName
string | undefined

(Not supported by Neptune)

Port
number | undefined

The port number on which the new DB cluster accepts connections.

Constraints: Value must be 1150-65535

Default: The same port as the original DB cluster.

ServerlessV2ScalingConfiguration
ServerlessV2ScalingConfiguration | undefined

Contains the scaling configuration of a Neptune Serverless DB cluster.

For more information, see Using Amazon Neptune Serverless  in the Amazon Neptune User Guide.

StorageType
string | undefined

Specifies the storage type to be associated with the DB cluster.

Valid values: standard, iopt1

Default: standard

Tags
Tag[] | undefined

The tags to be assigned to the restored DB cluster.

VpcSecurityGroupIds
string[] | undefined

A list of VPC security groups that the new DB cluster will belong to.

RestoreDBClusterFromSnapshotCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
DBCluster
DBCluster | undefined

Contains the details of an Amazon Neptune DB cluster.

This data type is used as a response element in the DescribeDBClusters.

Throws

Name
Fault
Details
DBClusterAlreadyExistsFault
client

User already has a DB cluster with the given identifier.

DBClusterParameterGroupNotFoundFault
client

DBClusterParameterGroupName does not refer to an existing DB Cluster parameter group.

DBClusterQuotaExceededFault
client

User attempted to create a new DB cluster and the user has already reached the maximum allowed DB cluster quota.

DBClusterSnapshotNotFoundFault
client

DBClusterSnapshotIdentifier does not refer to an existing DB cluster snapshot.

DBSnapshotNotFoundFault
client

DBSnapshotIdentifier does not refer to an existing DB snapshot.

DBSubnetGroupNotFoundFault
client

DBSubnetGroupName does not refer to an existing DB subnet group.

InsufficientDBClusterCapacityFault
client

The DB cluster does not have enough capacity for the current operation.

InsufficientStorageClusterCapacityFault
client

There is insufficient storage available for the current action. You may be able to resolve this error by updating your subnet group to use different Availability Zones that have more storage available.

InvalidDBClusterSnapshotStateFault
client

The supplied value is not a valid DB cluster snapshot state.

InvalidDBSnapshotStateFault
client

The state of the DB snapshot does not allow deletion.

InvalidRestoreFault
client

Cannot restore from vpc backup to non-vpc DB instance.

InvalidSubnet
client

The requested subnet is invalid, or multiple subnets were requested that are not all in a common VPC.

InvalidVPCNetworkStateFault
client

DB subnet group does not cover all Availability Zones after it is created because users' change.

KMSKeyNotAccessibleFault
client

Error accessing KMS key.

OptionGroupNotFoundFault
client

The designated option group could not be found.

StorageQuotaExceededFault
client

Request would result in user exceeding the allowed amount of storage available across all DB instances.

NeptuneServiceException
Base exception class for all service exceptions from Neptune service.