You are viewing documentation for version 2 of the AWS SDK for Ruby. Version 3 documentation can be found here.

Class: Aws::RDS::DBClusterSnapshot

Inherits:
Aws::Resources::Resource show all
Defined in:
(unknown)

Instance Attribute Summary collapse

Attributes inherited from Aws::Resources::Resource

#client, #identifiers

Instance Method Summary collapse

Methods inherited from Aws::Resources::Resource

add_data_attribute, add_identifier, #data, data_attributes, #data_loaded?, identifiers, #load, #wait_until

Methods included from Aws::Resources::OperationMethods

#add_batch_operation, #add_operation, #batch_operation, #batch_operation_names, #batch_operations, #operation, #operation_names, #operations

Constructor Details

#initialize(cluster_id, snapshot_id, options = {}) ⇒ Object #initialize(options = {}) ⇒ Object

Overloads:

  • #initialize(cluster_id, snapshot_id, options = {}) ⇒ Object

    Parameters:

    • cluster_id (String)
    • snapshot_id (String)

    Options Hash (options):

    • :client (Client)

      When `:client is not given, the options hash is used to construct a new Client object.

  • #initialize(options = {}) ⇒ Object

    Options Hash (options):

    • :cluster_id (required, String)
    • :snapshot_id (required, String)
    • :client (Client)

      When `:client is not given, the options hash is used to construct a new Client object.

Instance Attribute Details

#allocated_storageInteger (readonly)

Specifies the allocated storage size in gigabytes (GB).

Returns:

  • (Integer)

    Specifies the allocated storage size in gigabytes (GB).

#availability_zonesArray<String> (readonly)

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

Returns:

  • (Array<String>)

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

#cluster_create_timeTime (readonly)

Specifies the time when the DB cluster was created, in Universal Coordinated Time (UTC).

Returns:

  • (Time)

    Specifies the time when the DB cluster was created, in Universal Coordinated Time (UTC).

#cluster_idString (readonly)

Returns:

  • (String)

#db_cluster_identifierString (readonly)

Specifies the DB cluster identifier of the DB cluster that this DB cluster snapshot was created from.

Returns:

  • (String)

    Specifies the DB cluster identifier of the DB cluster that this DB cluster snapshot was created from.

#db_cluster_snapshot_arnString (readonly)

The Amazon Resource Name (ARN) for the DB cluster snapshot.

Returns:

  • (String)

    The Amazon Resource Name (ARN) for the DB cluster snapshot.

#db_cluster_snapshot_identifierString (readonly)

Specifies the identifier for the DB cluster snapshot.

Returns:

  • (String)

    Specifies the identifier for the DB cluster snapshot.

#engineString (readonly)

Specifies the name of the database engine.

Returns:

  • (String)

    Specifies the name of the database engine.

#engine_versionString (readonly)

Provides the version of the database engine for this DB cluster snapshot.

Returns:

  • (String)

    Provides the version of the database engine for this DB cluster snapshot.

#iam_database_authentication_enabledBoolean (readonly)

True if mapping of AWS Identity and Access Management (IAM) accounts to database accounts is enabled, and otherwise false.

Returns:

  • (Boolean)

    True if mapping of AWS Identity and Access Management (IAM) accounts to database accounts is enabled, and otherwise false.

#kms_key_idString (readonly)

If StorageEncrypted is true, the AWS KMS key identifier for the encrypted DB cluster snapshot.

Returns:

  • (String)

    If StorageEncrypted is true, the AWS KMS key identifier for the encrypted DB cluster snapshot.

#license_modelString (readonly)

Provides the license model information for this DB cluster snapshot.

Returns:

  • (String)

    Provides the license model information for this DB cluster snapshot.

#master_usernameString (readonly)

Provides the master username for the DB cluster snapshot.

Returns:

  • (String)

    Provides the master username for the DB cluster snapshot.

#percent_progressInteger (readonly)

Specifies the percentage of the estimated data that has been transferred.

Returns:

  • (Integer)

    Specifies the percentage of the estimated data that has been transferred.

#portInteger (readonly)

Specifies the port that the DB cluster was listening on at the time of the snapshot.

Returns:

  • (Integer)

    Specifies the port that the DB cluster was listening on at the time of the snapshot.

#snapshot_create_timeTime (readonly)

Provides the time when the snapshot was taken, in Universal Coordinated Time (UTC).

Returns:

  • (Time)

    Provides the time when the snapshot was taken, in Universal Coordinated Time (UTC).

#snapshot_idString (readonly)

Returns:

  • (String)

#snapshot_typeString (readonly)

Provides the type of the DB cluster snapshot.

Returns:

  • (String)

    Provides the type of the DB cluster snapshot.

#source_db_cluster_snapshot_arnString (readonly)

If the DB cluster snapshot was copied from a source DB cluster snapshot, the Amazon Resource Name (ARN) for the source DB cluster snapshot, otherwise, a null value.

Returns:

  • (String)

    If the DB cluster snapshot was copied from a source DB cluster snapshot, the Amazon Resource Name (ARN) for the source DB cluster snapshot, otherwise, a null value.

#statusString (readonly)

Specifies the status of this DB cluster snapshot.

Returns:

  • (String)

    Specifies the status of this DB cluster snapshot.

#storage_encryptedBoolean (readonly)

Specifies whether the DB cluster snapshot is encrypted.

Returns:

  • (Boolean)

    Specifies whether the DB cluster snapshot is encrypted.

#vpc_idString (readonly)

Provides the VPC ID associated with the DB cluster snapshot.

Returns:

  • (String)

    Provides the VPC ID associated with the DB cluster snapshot.

Instance Method Details

#clusterDBCluster

Returns:

See Also:

#copy(options = {}) ⇒ DBClusterSnapshot

Examples:

Request syntax example with placeholder values


dbclustersnapshot.copy({
  target_db_cluster_snapshot_identifier: "String", # required
  kms_key_id: "String",
  pre_signed_url: "String",
  copy_tags: false,
  tags: [
    {
      key: "String",
      value: "String",
    },
  ],
  destination_region: "String",
  source_region: "String",
})

Basic usage

dbclustersnapshot = dbclustersnapshot.copy(options)
dbclustersnapshot.snapshot_id
#=> "dbclustersnapshot-snapshot-id"

Options Hash (options):

  • :target_db_cluster_snapshot_identifier (required, String)

    The identifier of the new DB cluster snapshot to create from the source DB cluster snapshot. This parameter is not 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-cluster-snapshot2

  • :kms_key_id (String)

    The AWS AWS KMS key ID for an encrypted DB cluster snapshot. The KMS key ID is the Amazon Resource Name (ARN), KMS key identifier, or the KMS key alias for the KMS encryption key.

    If you copy an unencrypted DB cluster snapshot and specify a value for the KmsKeyId parameter, Amazon RDS encrypts the target DB cluster snapshot using the specified KMS encryption key.

    If you copy an encrypted DB cluster snapshot from your AWS account, you can specify a value for KmsKeyId to encrypt the copy with a new KMS encryption key. If you don\'t specify a value for KmsKeyId, then the copy of the DB cluster snapshot is encrypted with the same KMS key as the source DB cluster snapshot.

    If you copy an encrypted DB cluster snapshot that is shared from another AWS account, then you must specify a value for KmsKeyId.

    To copy an encrypted DB cluster snapshot to another AWS Region, you must set KmsKeyId to the KMS key ID you want to use to encrypt the copy of the DB cluster snapshot in the destination AWS Region. KMS encryption keys are specific to the AWS Region that they are created in, and you can\'t use encryption keys from one AWS Region in another AWS Region.

  • :pre_signed_url (String)

    The URL that contains a Signature Version 4 signed request for the CopyDBClusterSnapshot API action in the AWS Region that contains the source DB cluster snapshot to copy. The PreSignedUrl parameter must be used when copying an encrypted DB cluster snapshot from another AWS Region.

    The pre-signed URL must be a valid request for the CopyDBSClusterSnapshot API action that can be executed in the source AWS Region that contains the encrypted DB cluster snapshot to be copied. The pre-signed URL request must contain the following parameter values:

    • KmsKeyId - The AWS KMS key identifier for the key to use to encrypt the copy of the DB cluster snapshot in the destination AWS Region. This is the same identifier for both the CopyDBClusterSnapshot action that is called in the destination AWS Region, and the action contained in the pre-signed URL.

    • DestinationRegion - The name of the AWS Region that the DB cluster snapshot will be created in.

    • SourceDBClusterSnapshotIdentifier - The DB cluster snapshot identifier for the encrypted DB cluster snapshot to be copied. This identifier must be in the Amazon Resource Name (ARN) format for the source AWS Region. For example, if you are copying an encrypted DB cluster snapshot from the us-west-2 AWS Region, then your SourceDBClusterSnapshotIdentifier looks like the following example: arn:aws:rds:us-west-2:123456789012:cluster-snapshot:aurora-cluster1-snapshot-20161115.

    To learn how to generate a Signature Version 4 signed request, see Authenticating Requests: Using Query Parameters (AWS Signature Version 4) and Signature Version 4 Signing Process.

  • :copy_tags (Boolean)

    True to copy all tags from the source DB cluster snapshot to the target DB cluster snapshot, and otherwise false. The default is false.

  • :tags (Array<Types::Tag>)

    A list of tags. For more information, see Tagging Amazon RDS Resources.

  • :destination_region (String)
  • :source_region (String)

    The region which you are copying an encrypted snapshot from.

    This is a required paramter that allows SDK to compute a pre-signed Url and populate PreSignedURL parameter on your behalf.

Returns:

See Also:

#create(options = {}) ⇒ DBClusterSnapshot

Examples:

Request syntax example with placeholder values


dbclustersnapshot.create({
  tags: [
    {
      key: "String",
      value: "String",
    },
  ],
})

Basic usage

dbclustersnapshot = dbclustersnapshot.create(options)
dbclustersnapshot.snapshot_id
#=> "dbclustersnapshot-snapshot-id"

Options Hash (options):

  • :tags (Array<Types::Tag>)

    The tags to be assigned to the DB cluster snapshot.

Returns:

See Also:

#deleteDBClusterSnapshot

Examples:

Request syntax example with placeholder values


dbclustersnapshot.delete()

Basic usage

dbclustersnapshot = dbclustersnapshot.delete(options)
dbclustersnapshot.snapshot_id
#=> "dbclustersnapshot-snapshot-id"

Returns:

See Also:

#events(options = {}) ⇒ Collection<Event>

Returns a Collection of Event resources. No API requests are made until you call an enumerable method on the collection. Client#describe_events will be called multiple times until every Event has been yielded.

Examples:

Request syntax example with placeholder values


dbclustersnapshot.events({
  start_time: Time.now,
  end_time: Time.now,
  duration: 1,
  event_categories: ["String"],
  filters: [
    {
      name: "String", # required
      values: ["String"], # required
    },
  ],
  max_records: 1,
  marker: "String",
})

Enumerating Event resources.

dbclustersnapshot.events.each do |event|
  # yields each event
end

Enumerating Event resources with a limit.

dbclustersnapshot.events.limit(10).each do |event|
  # yields at most 10 events
end

Options Hash (options):

  • :start_time (Time)

    The beginning of the time interval to retrieve events for, specified in ISO 8601 format. For more information about ISO 8601, go to the ISO8601 Wikipedia page.

    Example: 2009-07-08T18:00Z

  • :end_time (Time)

    The end of the time interval for which to retrieve events, specified in ISO 8601 format. For more information about ISO 8601, go to the ISO8601 Wikipedia page.

    Example: 2009-07-08T18:00Z

  • :duration (Integer)

    The number of minutes to retrieve events for.

    Default: 60

  • :event_categories (Array<String>)

    A list of event categories that trigger notifications for a event notification subscription.

  • :filters (Array<Types::Filter>)

    This parameter is not currently supported.

  • :max_records (Integer)

    The maximum number of records to include in the response. If more records exist than the specified MaxRecords value, a pagination token called a marker is included in the response so that the remaining results can be retrieved.

    Default: 100

    Constraints: Minimum 20, maximum 100.

  • :marker (String)

    An optional pagination token provided by a previous DescribeEvents request. If this parameter is specified, the response includes only records beyond the marker, up to the value specified by MaxRecords.

Returns:

See Also:

#restore(options = {}) ⇒ DBCluster

Examples:

Request syntax example with placeholder values


dbclustersnapshot.restore({
  availability_zones: ["String"],
  db_cluster_identifier: "String", # required
  engine: "String", # required
  engine_version: "String",
  port: 1,
  db_subnet_group_name: "String",
  database_name: "String",
  option_group_name: "String",
  vpc_security_group_ids: ["String"],
  tags: [
    {
      key: "String",
      value: "String",
    },
  ],
  kms_key_id: "String",
  enable_iam_database_authentication: false,
})

Basic usage

dbcluster = dbclustersnapshot.restore(options)
dbcluster.id
#=> "dbcluster-id"

Options Hash (options):

  • :availability_zones (Array<String>)

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

  • :db_cluster_identifier (required, String)

    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 255 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)

    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

  • :engine_version (String)

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

  • :port (Integer)

    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.

  • :db_subnet_group_name (String)

    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

  • :database_name (String)

    The database name for the restored DB cluster.

  • :option_group_name (String)

    The name of the option group to use for the restored DB cluster.

  • :vpc_security_group_ids (Array<String>)

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

  • :tags (Array<Types::Tag>)

    The tags to be assigned to the restored DB cluster.

  • :kms_key_id (String)

    The AWS 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 AWS 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.

  • :enable_iam_database_authentication (Boolean)

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

    Default: false

Returns:

See Also: