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 gibibytes (GiB).

Returns:

  • (Integer)

    Specifies the allocated storage size in gibibytes (GiB).

#availability_zonesArray<String> (readonly)

Provides the list of Availability Zones (AZs) where instances in the DB cluster snapshot can be restored.

Returns:

  • (Array<String>)

    Provides the list of Availability Zones (AZs) where instances in the DB cluster snapshot can be restored.

#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.

#tag_listArray<Types::Tag> (readonly)

A list of tags. For more information, see Tagging Amazon RDS Resources in the Amazon RDS User Guide.

Returns:

#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 isn\'t case-sensitive.

    Constraints:

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

    • First character must be a letter.

    • Can\'t end with a hyphen or contain two consecutive hyphens.

    Example: my-cluster-snapshot2

  • :kms_key_id (String)

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

    If you copy an unencrypted DB cluster snapshot and specify a value for the KmsKeyId parameter, an error is returned.

  • :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. Don\'t specify PreSignedUrl when you are copying an encrypted DB cluster snapshot in the same AWS Region.

    The pre-signed URL must be a valid request for the CopyDBClusterSnapshot 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 is to 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.

    If you are using an AWS SDK tool or the AWS CLI, you can specify SourceRegion (or --source-region for the AWS CLI) instead of specifying PreSignedUrl manually. Specifying SourceRegion autogenerates a pre-signed URL that is a valid request for the operation that can be executed in the source AWS Region.

  • :copy_tags (Boolean)

    A value that indicates whether to copy all tags from the source DB cluster snapshot to the target DB cluster snapshot. By default, tags are not copied.

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

    A list of tags. For more information, see Tagging Amazon RDS Resources in the Amazon RDS User Guide.

  • :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 isn\'t 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 you can retrieve the remaining results.

    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,
  backtrack_window: 1,
  enable_cloudwatch_logs_exports: ["String"],
  engine_mode: "String",
  scaling_configuration: {
    min_capacity: 1,
    max_capacity: 1,
    auto_pause: false,
    seconds_until_auto_pause: 1,
    timeout_action: "String",
  },
  db_cluster_parameter_group_name: "String",
  deletion_protection: false,
  copy_tags_to_snapshot: false,
  domain: "String",
  domain_iam_role_name: "String",
})

Basic usage

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

Options Hash (options):

  • :availability_zones (Array<String>)

    Provides the list of Availability Zones (AZs) where instances in the restored DB cluster can be created.

  • :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 63 letters, numbers, or hyphens

    • First character must be a letter

    • Can\'t 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.

    To list all of the available engine versions for aurora (for MySQL 5.6-compatible Aurora), use the following command:

    aws rds describe-db-engine-versions --engine aurora --query "DBEngineVersions[].EngineVersion"

    To list all of the available engine versions for aurora-mysql (for MySQL 5.7-compatible Aurora), use the following command:

    aws rds describe-db-engine-versions --engine aurora-mysql --query "DBEngineVersions[].EngineVersion"

    To list all of the available engine versions for aurora-postgresql, use the following command:

    aws rds describe-db-engine-versions --engine aurora-postgresql --query "DBEngineVersions[].EngineVersion"

    If you aren\'t using the default engine version, then you must specify the engine version.

    Aurora MySQL

    Example: 5.6.10a, 5.6.mysql_aurora.1.19.2, 5.7.12, 5.7.mysql_aurora.2.04.5

    Aurora PostgreSQL

    Example: 9.6.3, 10.7

  • :port (Integer)

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

    Constraints: This 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 DB subnet group.

    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 don\'t specify a value for the KmsKeyId parameter, then the following occurs:

    • 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 isn\'t encrypted, then the restored DB cluster isn\'t encrypted.

  • :enable_iam_database_authentication (Boolean)

    A value that indicates whether to enable mapping of AWS Identity and Access Management (IAM) accounts to database accounts. By default, mapping is disabled.

    For more information, see IAM Database Authentication in the Amazon Aurora User Guide.

  • :backtrack_window (Integer)

    The target backtrack window, in seconds. To disable backtracking, set this value to 0.

    Currently, Backtrack is only supported for Aurora MySQL DB clusters.

    Default: 0

    Constraints:

    • If specified, this value must be set to a number from 0 to 259,200 (72 hours).

    ^

  • :enable_cloudwatch_logs_exports (Array<String>)

    The list of logs that the restored DB cluster is to export to Amazon CloudWatch Logs. The values in the list depend on the DB engine being used. For more information, see Publishing Database Logs to Amazon CloudWatch Logs in the Amazon Aurora User Guide.

  • :engine_mode (String)

    The DB engine mode of the DB cluster, either provisioned, serverless, parallelquery, global, or multimaster.

    For more information, see CreateDBCluster.

  • :scaling_configuration (Types::ScalingConfiguration)

    For DB clusters in serverless DB engine mode, the scaling properties of the DB cluster.

  • :db_cluster_parameter_group_name (String)

    The name of the DB cluster parameter group to associate with this DB cluster. If this argument is omitted, the default DB cluster parameter group for the specified engine is used.

    Constraints:

    • If supplied, must match the name of an existing default DB cluster parameter group.

    • Must be 1 to 255 letters, numbers, or hyphens.

    • First character must be a letter.

    • Can\'t end with a hyphen or contain two consecutive hyphens.

  • :deletion_protection (Boolean)

    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.

  • :copy_tags_to_snapshot (Boolean)

    A value that indicates whether to copy all tags from the restored DB cluster to snapshots of the restored DB cluster. The default is not to copy them.

  • :domain (String)

    Specify the Active Directory directory ID to restore the DB cluster in. The domain must be created prior to this operation. Currently, only MySQL, Microsoft SQL Server, Oracle, and PostgreSQL DB instances can be created in an Active Directory Domain.

    For more information, see Kerberos Authentication in the Amazon RDS User Guide.

  • :domain_iam_role_name (String)

    Specify the name of the IAM role to be used when making API calls to the Directory Service.

Returns:

See Also: