Class: Aws::RDS::DBInstance
- Inherits:
-
Object
- Object
- Aws::RDS::DBInstance
- Extended by:
- Deprecations
- Defined in:
- lib/aws-sdk-rds/db_instance.rb
Defined Under Namespace
Classes: Collection
Read-Only Attributes collapse
-
#allocated_storage ⇒ Integer
Specifies the allocated storage size specified in gigabytes.
-
#auto_minor_version_upgrade ⇒ Boolean
Indicates that minor version patches are applied automatically.
-
#availability_zone ⇒ String
Specifies the name of the Availability Zone the DB instance is located in.
-
#backup_retention_period ⇒ Integer
Specifies the number of days for which automatic DB snapshots are retained.
-
#ca_certificate_identifier ⇒ String
The identifier of the CA certificate for this DB instance.
-
#character_set_name ⇒ String
If present, specifies the name of the character set that this instance is associated with.
-
#copy_tags_to_snapshot ⇒ Boolean
Specifies whether tags are copied from the DB instance to snapshots of the DB instance.
-
#db_cluster_identifier ⇒ String
If the DB instance is a member of a DB cluster, contains the name of the DB cluster that the DB instance is a member of.
-
#db_instance_arn ⇒ String
The Amazon Resource Name (ARN) for the DB instance.
-
#db_instance_class ⇒ String
Contains the name of the compute and memory capacity class of the DB instance.
-
#db_instance_port ⇒ Integer
Specifies the port that the DB instance listens on.
-
#db_instance_status ⇒ String
Specifies the current state of this database.
-
#db_name ⇒ String
The meaning of this parameter differs according to the database engine you use.
-
#db_parameter_groups ⇒ Array<Types::DBParameterGroupStatus>
Provides the list of DB parameter groups applied to this DB instance.
-
#db_security_groups ⇒ Array<Types::DBSecurityGroupMembership>
Provides List of DB security group elements containing only ‘DBSecurityGroup.Name` and `DBSecurityGroup.Status` subelements.
-
#db_subnet_group ⇒ Types::DBSubnetGroup
Specifies information on the subnet group associated with the DB instance, including the name, description, and subnets in the subnet group.
-
#dbi_resource_id ⇒ String
The region-unique, immutable identifier for the DB instance.
-
#domain_memberships ⇒ Array<Types::DomainMembership>
The Active Directory Domain membership records associated with the DB instance.
-
#endpoint ⇒ Types::Endpoint
Specifies the connection endpoint.
-
#engine ⇒ String
Provides the name of the database engine to be used for this DB instance.
-
#engine_version ⇒ String
Indicates the database engine version.
-
#enhanced_monitoring_resource_arn ⇒ String
The Amazon Resource Name (ARN) of the Amazon CloudWatch Logs log stream that receives the Enhanced Monitoring metrics data for the DB instance.
-
#iam_database_authentication_enabled ⇒ Boolean
True if mapping of AWS Identity and Access Management (IAM) accounts to database accounts is enabled; otherwise false.
- #id ⇒ String (also: #db_instance_identifier)
-
#instance_create_time ⇒ Time
Provides the date and time the DB instance was created.
-
#iops ⇒ Integer
Specifies the Provisioned IOPS (I/O operations per second) value.
-
#kms_key_id ⇒ String
If ‘StorageEncrypted` is true, the KMS key identifier for the encrypted DB instance.
-
#latest_restorable_time ⇒ Time
Specifies the latest time to which a database can be restored with point-in-time restore.
-
#license_model ⇒ String
License model information for this DB instance.
-
#master_username ⇒ String
Contains the master username for the DB instance.
-
#monitoring_interval ⇒ Integer
The interval, in seconds, between points when Enhanced Monitoring metrics are collected for the DB instance.
-
#monitoring_role_arn ⇒ String
The ARN for the IAM role that permits RDS to send Enhanced Monitoring metrics to CloudWatch Logs.
-
#multi_az ⇒ Boolean
Specifies if the DB instance is a Multi-AZ deployment.
-
#option_group_memberships ⇒ Array<Types::OptionGroupMembership>
Provides the list of option group memberships for this DB instance.
-
#pending_modified_values ⇒ Types::PendingModifiedValues
Specifies that changes to the DB instance are pending.
-
#preferred_backup_window ⇒ String
Specifies the daily time range during which automated backups are created if automated backups are enabled, as determined by the ‘BackupRetentionPeriod`.
-
#preferred_maintenance_window ⇒ String
Specifies the weekly time range during which system maintenance can occur, in Universal Coordinated Time (UTC).
-
#promotion_tier ⇒ Integer
A value that specifies the order in which an Aurora Replica is promoted to the primary instance after a failure of the existing primary instance.
-
#publicly_accessible ⇒ Boolean
Specifies the accessibility options for the DB instance.
-
#read_replica_db_cluster_identifiers ⇒ Array<String>
Contains one or more identifiers of Aurora DB clusters that are Read Replicas of this DB instance.
-
#read_replica_db_instance_identifiers ⇒ Array<String>
Contains one or more identifiers of the Read Replicas associated with this DB instance.
-
#read_replica_source_db_instance_identifier ⇒ String
Contains the identifier of the source DB instance if this DB instance is a Read Replica.
-
#secondary_availability_zone ⇒ String
If present, specifies the name of the secondary Availability Zone for a DB instance with multi-AZ support.
-
#status_infos ⇒ Array<Types::DBInstanceStatusInfo>
The status of a Read Replica.
-
#storage_encrypted ⇒ Boolean
Specifies whether the DB instance is encrypted.
-
#storage_type ⇒ String
Specifies the storage type associated with DB instance.
-
#tde_credential_arn ⇒ String
The ARN from the key store with which the instance is associated for TDE encryption.
-
#timezone ⇒ String
The time zone of the DB instance.
-
#vpc_security_groups ⇒ Array<Types::VpcSecurityGroupMembership>
Provides a list of VPC security group elements that the DB instance belongs to.
Actions collapse
- #create(options = {}) ⇒ DBInstance
- #create_read_replica(options = {}) ⇒ DBInstance
- #create_snapshot(options = {}) ⇒ DBSnapshot
- #delete(options = {}) ⇒ DBInstance
- #modify(options = {}) ⇒ DBInstance
- #promote(options = {}) ⇒ DBInstance
- #reboot(options = {}) ⇒ DBInstance
- #restore(options = {}) ⇒ DBInstance
- #subscribe_to(options = {}) ⇒ EventSubscription
- #unsubscribe_from(options = {}) ⇒ EventSubscription
Associations collapse
- #certificate ⇒ Certificate?
- #cluster ⇒ DBCluster?
- #events(options = {}) ⇒ Event::Collection
- #identifiers ⇒ Object deprecated private Deprecated.
- #log_files(options = {}) ⇒ DBLogFile::Collection
- #option_groups ⇒ OptionGroup::Collection
- #parameter_groups ⇒ DBParameterGroup::Collection
- #pending_maintenance_actions(options = {}) ⇒ PendingMaintenanceAction::Collection
- #read_replicas ⇒ DBInstance::Collection
- #security_groups ⇒ DBSecurityGroup::Collection
- #snapshots(options = {}) ⇒ DBSnapshot::Collection
- #source ⇒ DBInstance?
- #subnet_group ⇒ DBSubnetGroup?
Instance Method Summary collapse
- #client ⇒ Client
-
#data ⇒ Types::DBInstance
Returns the data for this DBInstance.
-
#data_loaded? ⇒ Boolean
Returns ‘true` if this resource is loaded.
-
#initialize(*args) ⇒ DBInstance
constructor
A new instance of DBInstance.
-
#load ⇒ self
(also: #reload)
Loads, or reloads #data for the current DBInstance.
Constructor Details
#initialize(id, options = {}) ⇒ DBInstance #initialize(options = {}) ⇒ DBInstance
Returns a new instance of DBInstance.
19 20 21 22 23 24 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 19 def initialize(*args) = Hash === args.last ? args.pop.dup : {} @id = extract_id(args, ) @data = .delete(:data) @client = .delete(:client) || Client.new() end |
Instance Method Details
#allocated_storage ⇒ Integer
Specifies the allocated storage size specified in gigabytes.
91 92 93 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 91 def allocated_storage data.allocated_storage end |
#auto_minor_version_upgrade ⇒ Boolean
Indicates that minor version patches are applied automatically.
187 188 189 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 187 def auto_minor_version_upgrade data.auto_minor_version_upgrade end |
#availability_zone ⇒ String
Specifies the name of the Availability Zone the DB instance is located in.
139 140 141 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 139 def availability_zone data.availability_zone end |
#backup_retention_period ⇒ Integer
Specifies the number of days for which automatic DB snapshots are retained.
112 113 114 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 112 def backup_retention_period data.backup_retention_period end |
#ca_certificate_identifier ⇒ String
The identifier of the CA certificate for this DB instance.
326 327 328 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 326 def ca_certificate_identifier data.ca_certificate_identifier end |
#certificate ⇒ Certificate?
2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 2534 def certificate if data.ca_certificate_identifier Certificate.new( id: data.ca_certificate_identifier, client: @client ) else nil end end |
#character_set_name ⇒ String
If present, specifies the name of the character set that this instance is associated with.
233 234 235 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 233 def character_set_name data.character_set_name end |
#client ⇒ Client
413 414 415 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 413 def client @client end |
#cluster ⇒ DBCluster?
2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 2546 def cluster if data.db_cluster_identifier DBCluster.new( id: data.db_cluster_identifier, client: @client ) else nil end end |
#copy_tags_to_snapshot ⇒ Boolean
Specifies whether tags are copied from the DB instance to snapshots of the DB instance.
340 341 342 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 340 def data. end |
#create(options = {}) ⇒ DBInstance
1273 1274 1275 1276 1277 1278 1279 1280 1281 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 1273 def create( = {}) = .merge(db_instance_identifier: @id) resp = @client.create_db_instance() DBInstance.new( id: resp.data.db_instance.db_instance_identifier, data: resp.data.db_instance, client: @client ) end |
#create_read_replica(options = {}) ⇒ DBInstance
1525 1526 1527 1528 1529 1530 1531 1532 1533 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 1525 def create_read_replica( = {}) = .merge(source_db_instance_identifier: @id) resp = @client.create_db_instance_read_replica() DBInstance.new( id: resp.data.db_instance.db_instance_identifier, data: resp.data.db_instance, client: @client ) end |
#create_snapshot(options = {}) ⇒ DBSnapshot
1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 1564 def create_snapshot( = {}) = .merge(db_instance_identifier: @id) resp = @client.create_db_snapshot() DBSnapshot.new( instance_id: resp.data.db_snapshot.db_instance_identifier, snapshot_id: resp.data.db_snapshot.db_snapshot_identifier, data: resp.data.db_snapshot, client: @client ) end |
#data ⇒ Types::DBInstance
Returns the data for this Aws::RDS::DBInstance. Calls Client#describe_db_instances if #data_loaded? is ‘false`.
433 434 435 436 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 433 def data load unless @data @data end |
#data_loaded? ⇒ Boolean
441 442 443 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 441 def data_loaded? !!@data end |
#db_cluster_identifier ⇒ String
If the DB instance is a member of a DB cluster, contains the name of the DB cluster that the DB instance is a member of.
299 300 301 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 299 def db_cluster_identifier data.db_cluster_identifier end |
#db_instance_arn ⇒ String
The Amazon Resource Name (ARN) for the DB instance.
381 382 383 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 381 def db_instance_arn data.db_instance_arn end |
#db_instance_class ⇒ String
Contains the name of the compute and memory capacity class of the DB instance.
37 38 39 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 37 def db_instance_class data.db_instance_class end |
#db_instance_port ⇒ Integer
Specifies the port that the DB instance listens on. If the DB instance is part of a DB cluster, this can be a different port than the DB cluster port.
292 293 294 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 292 def db_instance_port data.db_instance_port end |
#db_instance_status ⇒ String
Specifies the current state of this database.
50 51 52 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 50 def db_instance_status data.db_instance_status end |
#db_name ⇒ String
The meaning of this parameter differs according to the database engine you use. For example, this value returns MySQL, MariaDB, or PostgreSQL information when returning values from CreateDBInstanceReadReplica since Read Replicas are only supported for these engines.
**MySQL, MariaDB, SQL Server, PostgreSQL**
Contains the name of the initial database of this instance that was provided at create time, if one was specified when the DB instance was created. This same name is returned for the life of the DB instance.
Type: String
Oracle
Contains the Oracle System ID (SID) of the created DB instance. Not shown when the returned parameters do not apply to an Oracle DB instance.
79 80 81 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 79 def db_name data.db_name end |
#db_parameter_groups ⇒ Array<Types::DBParameterGroupStatus>
Provides the list of DB parameter groups applied to this DB instance.
132 133 134 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 132 def db_parameter_groups data.db_parameter_groups end |
#db_security_groups ⇒ Array<Types::DBSecurityGroupMembership>
Provides List of DB security group elements containing only ‘DBSecurityGroup.Name` and `DBSecurityGroup.Status` subelements.
119 120 121 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 119 def db_security_groups data.db_security_groups end |
#db_subnet_group ⇒ Types::DBSubnetGroup
Specifies information on the subnet group associated with the DB instance, including the name, description, and subnets in the subnet group.
147 148 149 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 147 def db_subnet_group data.db_subnet_group end |
#dbi_resource_id ⇒ String
The region-unique, immutable identifier for the DB instance. This identifier is found in AWS CloudTrail log entries whenever the KMS key for the DB instance is accessed.
320 321 322 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 320 def dbi_resource_id data.dbi_resource_id end |
#delete(options = {}) ⇒ DBInstance
1620 1621 1622 1623 1624 1625 1626 1627 1628 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 1620 def delete( = {}) = .merge(db_instance_identifier: @id) resp = @client.delete_db_instance() DBInstance.new( id: resp.data.db_instance.db_instance_identifier, data: resp.data.db_instance, client: @client ) end |
#domain_memberships ⇒ Array<Types::DomainMembership>
The Active Directory Domain membership records associated with the DB instance.
333 334 335 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 333 def domain_memberships data.domain_memberships end |
#endpoint ⇒ Types::Endpoint
Specifies the connection endpoint.
85 86 87 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 85 def endpoint data.endpoint end |
#engine ⇒ String
Provides the name of the database engine to be used for this DB instance.
44 45 46 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 44 def engine data.engine end |
#engine_version ⇒ String
Indicates the database engine version.
181 182 183 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 181 def engine_version data.engine_version end |
#enhanced_monitoring_resource_arn ⇒ String
The Amazon Resource Name (ARN) of the Amazon CloudWatch Logs log stream that receives the Enhanced Monitoring metrics data for the DB instance.
355 356 357 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 355 def enhanced_monitoring_resource_arn data.enhanced_monitoring_resource_arn end |
#events(options = {}) ⇒ Event::Collection
2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 2602 def events( = {}) batches = Enumerator.new do |y| = .merge( source_type: "db-instance", source_identifier: @id ) resp = @client.describe_events() resp.each_page do |page| batch = [] page.data.events.each do |e| batch << Event.new( source_id: e.source_identifier, date: e.date, data: e, client: @client ) end y.yield(batch) end end Event::Collection.new(batches) end |
#iam_database_authentication_enabled ⇒ Boolean
True if mapping of AWS Identity and Access Management (IAM) accounts to database accounts is enabled; otherwise false.
IAM database authentication can be enabled for the following database engines
-
For MySQL 5.6, minor version 5.6.34 or higher
-
For MySQL 5.7, minor version 5.7.16 or higher
-
Aurora 5.6 or higher. To enable IAM database authentication for Aurora, see DBCluster Type.
406 407 408 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 406 def iam_database_authentication_enabled data.iam_database_authentication_enabled end |
#id ⇒ String Also known as: db_instance_identifier
29 30 31 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 29 def id @id end |
#identifiers ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
2907 2908 2909 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 2907 def identifiers { id: @id } end |
#instance_create_time ⇒ Time
Provides the date and time the DB instance was created.
97 98 99 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 97 def instance_create_time data.instance_create_time end |
#iops ⇒ Integer
Specifies the Provisioned IOPS (I/O operations per second) value.
220 221 222 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 220 def iops data.iops end |
#kms_key_id ⇒ String
If ‘StorageEncrypted` is true, the KMS key identifier for the encrypted DB instance.
312 313 314 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 312 def kms_key_id data.kms_key_id end |
#latest_restorable_time ⇒ Time
Specifies the latest time to which a database can be restored with point-in-time restore.
169 170 171 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 169 def latest_restorable_time data.latest_restorable_time end |
#license_model ⇒ String
License model information for this DB instance.
214 215 216 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 214 def license_model data.license_model end |
#load ⇒ self Also known as: reload
Loads, or reloads #data for the current Aws::RDS::DBInstance. Returns ‘self` making it possible to chain methods.
db_instance.reload.data
423 424 425 426 427 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 423 def load resp = @client.describe_db_instances(db_instance_identifier: @id) @data = resp.db_instances[0] self end |
#log_files(options = {}) ⇒ DBLogFile::Collection
2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 2651 def log_files( = {}) batches = Enumerator.new do |y| = .merge(db_instance_identifier: @id) resp = @client.describe_db_log_files() resp.each_page do |page| batch = [] page.data.describe_db_log_files.each do |d| batch << DBLogFile.new( instance_id: @id, name: d.log_file_name, data: d, client: @client ) end y.yield(batch) end end DBLogFile::Collection.new(batches) end |
#master_username ⇒ String
Contains the master username for the DB instance.
56 57 58 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 56 def master_username data.master_username end |
#modify(options = {}) ⇒ DBInstance
2190 2191 2192 2193 2194 2195 2196 2197 2198 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 2190 def modify( = {}) = .merge(db_instance_identifier: @id) resp = @client.modify_db_instance() DBInstance.new( id: resp.data.db_instance.db_instance_identifier, data: resp.data.db_instance, client: @client ) end |
#monitoring_interval ⇒ Integer
The interval, in seconds, between points when Enhanced Monitoring metrics are collected for the DB instance.
347 348 349 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 347 def monitoring_interval data.monitoring_interval end |
#monitoring_role_arn ⇒ String
The ARN for the IAM role that permits RDS to send Enhanced Monitoring metrics to CloudWatch Logs.
362 363 364 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 362 def monitoring_role_arn data.monitoring_role_arn end |
#multi_az ⇒ Boolean
Specifies if the DB instance is a Multi-AZ deployment.
175 176 177 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 175 def multi_az data.multi_az end |
#option_group_memberships ⇒ Array<Types::OptionGroupMembership>
Provides the list of option group memberships for this DB instance.
226 227 228 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 226 def option_group_memberships data.option_group_memberships end |
#option_groups ⇒ OptionGroup::Collection
2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 2672 def option_groups batch = [] data.option_group_memberships.each do |o| batch << OptionGroup.new( name: o.option_group_name, client: @client ) end OptionGroup::Collection.new([batch], size: batch.size) end |
#parameter_groups ⇒ DBParameterGroup::Collection
2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 2684 def parameter_groups batch = [] data.db_parameter_groups.each do |d| batch << DBParameterGroup.new( name: d.db_parameter_group_name, client: @client ) end DBParameterGroup::Collection.new([batch], size: batch.size) end |
#pending_maintenance_actions(options = {}) ⇒ PendingMaintenanceAction::Collection
2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 2740 def pending_maintenance_actions( = {}) batches = Enumerator.new do |y| batch = [] = Aws::Util.deep_merge(, filters: [{ name: "db-instance-id", values: [@id] }]) resp = @client.describe_pending_maintenance_actions() resp.data.pending_maintenance_actions_0.pending_maintenance_action_details.each do |p| batch << PendingMaintenanceAction.new( target_arn: resp.data.pending_maintenance_actions[0].resource_identifier, name: p.action, data: p, client: @client ) end y.yield(batch) end PendingMaintenanceAction::Collection.new(batches) end |
#pending_modified_values ⇒ Types::PendingModifiedValues
Specifies that changes to the DB instance are pending. This element is only included when changes are pending. Specific changes are identified by subelements.
162 163 164 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 162 def pending_modified_values data.pending_modified_values end |
#preferred_backup_window ⇒ String
Specifies the daily time range during which automated backups are created if automated backups are enabled, as determined by the ‘BackupRetentionPeriod`.
105 106 107 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 105 def preferred_backup_window data.preferred_backup_window end |
#preferred_maintenance_window ⇒ String
Specifies the weekly time range during which system maintenance can occur, in Universal Coordinated Time (UTC).
154 155 156 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 154 def preferred_maintenance_window data.preferred_maintenance_window end |
#promote(options = {}) ⇒ DBInstance
2242 2243 2244 2245 2246 2247 2248 2249 2250 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 2242 def promote( = {}) = .merge(db_instance_identifier: @id) resp = @client.promote_read_replica() DBInstance.new( id: resp.data.db_instance.db_instance_identifier, data: resp.data.db_instance, client: @client ) end |
#promotion_tier ⇒ Integer
A value that specifies the order in which an Aurora Replica is promoted to the primary instance after a failure of the existing primary instance. For more information, see [ Fault Tolerance for an Aurora DB Cluster].
[1]: docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Aurora.Managing.html#Aurora.Managing.FaultTolerance
375 376 377 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 375 def promotion_tier data.promotion_tier end |
#publicly_accessible ⇒ Boolean
Specifies the accessibility options for the DB instance. A value of true specifies an Internet-facing instance with a publicly resolvable DNS name, which resolves to a public IP address. A value of false specifies an internal instance with a DNS name that resolves to a private IP address.
Default: The default behavior varies depending on whether a VPC has been requested or not. The following list shows the default behavior in each case.
-
**Default VPC:**true
-
**VPC:**false
If no DB subnet group has been specified as part of the request and the PubliclyAccessible value has not been set, the DB instance will be publicly accessible. If a specific DB subnet group has been specified as part of the request and the PubliclyAccessible value has not been set, the DB instance will be private.
264 265 266 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 264 def publicly_accessible data.publicly_accessible end |
#read_replica_db_cluster_identifiers ⇒ Array<String>
Contains one or more identifiers of Aurora DB clusters that are Read Replicas of this DB instance.
208 209 210 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 208 def read_replica_db_cluster_identifiers data.read_replica_db_cluster_identifiers end |
#read_replica_db_instance_identifiers ⇒ Array<String>
Contains one or more identifiers of the Read Replicas associated with this DB instance.
201 202 203 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 201 def read_replica_db_instance_identifiers data.read_replica_db_instance_identifiers end |
#read_replica_source_db_instance_identifier ⇒ String
Contains the identifier of the source DB instance if this DB instance is a Read Replica.
194 195 196 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 194 def read_replica_source_db_instance_identifier data.read_replica_source_db_instance_identifier end |
#read_replicas ⇒ DBInstance::Collection
2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 2762 def read_replicas batch = [] data.read_replica_db_instance_identifiers.each do |r| batch << DBInstance.new( id: r, client: @client ) end DBInstance::Collection.new([batch], size: batch.size) end |
#reboot(options = {}) ⇒ DBInstance
2264 2265 2266 2267 2268 2269 2270 2271 2272 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 2264 def reboot( = {}) = .merge(db_instance_identifier: @id) resp = @client.reboot_db_instance() DBInstance.new( id: resp.data.db_instance.db_instance_identifier, data: resp.data.db_instance, client: @client ) end |
#restore(options = {}) ⇒ DBInstance
2481 2482 2483 2484 2485 2486 2487 2488 2489 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 2481 def restore( = {}) = .merge(source_db_instance_identifier: @id) resp = @client.restore_db_instance_to_point_in_time() DBInstance.new( id: resp.data.db_instance.db_instance_identifier, data: resp.data.db_instance, client: @client ) end |
#secondary_availability_zone ⇒ String
If present, specifies the name of the secondary Availability Zone for a DB instance with multi-AZ support.
240 241 242 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 240 def secondary_availability_zone data.secondary_availability_zone end |
#security_groups ⇒ DBSecurityGroup::Collection
2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 2774 def security_groups batch = [] data.db_security_groups.each do |d| batch << DBSecurityGroup.new( name: d.db_security_group_name, client: @client ) end DBSecurityGroup::Collection.new([batch], size: batch.size) end |
#snapshots(options = {}) ⇒ DBSnapshot::Collection
2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 2861 def snapshots( = {}) batches = Enumerator.new do |y| = .merge(db_instance_identifier: @id) resp = @client.describe_db_snapshots() resp.each_page do |page| batch = [] page.data.db_snapshots.each do |d| batch << DBSnapshot.new( instance_id: [:db_instance_identifier], snapshot_id: d.db_snapshot_identifier, data: d, client: @client ) end y.yield(batch) end end DBSnapshot::Collection.new(batches) end |
#source ⇒ DBInstance?
2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 2882 def source if data.read_replica_source_db_instance_identifier DBInstance.new( id: data.read_replica_source_db_instance_identifier, client: @client ) else nil end end |
#status_infos ⇒ Array<Types::DBInstanceStatusInfo>
The status of a Read Replica. If the instance is not a Read Replica, this will be blank.
271 272 273 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 271 def status_infos data.status_infos end |
#storage_encrypted ⇒ Boolean
Specifies whether the DB instance is encrypted.
305 306 307 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 305 def storage_encrypted data.storage_encrypted end |
#storage_type ⇒ String
Specifies the storage type associated with DB instance.
277 278 279 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 277 def storage_type data.storage_type end |
#subnet_group ⇒ DBSubnetGroup?
2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 2894 def subnet_group if data.db_subnet_group.db_subnet_group_name DBSubnetGroup.new( name: data.db_subnet_group.db_subnet_group_name, client: @client ) else nil end end |
#subscribe_to(options = {}) ⇒ EventSubscription
2501 2502 2503 2504 2505 2506 2507 2508 2509 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 2501 def subscribe_to( = {}) = .merge(source_identifier: @id) resp = @client.add_source_identifier_to_subscription() EventSubscription.new( name: resp.data.event_subscription.cust_subscription_id, data: resp.data.event_subscription, client: @client ) end |
#tde_credential_arn ⇒ String
The ARN from the key store with which the instance is associated for TDE encryption.
284 285 286 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 284 def tde_credential_arn data.tde_credential_arn end |
#timezone ⇒ String
The time zone of the DB instance. In most cases, the ‘Timezone` element is empty. `Timezone` content appears only for Microsoft SQL Server DB instances that were created with a time zone specified.
389 390 391 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 389 def timezone data.timezone end |
#unsubscribe_from(options = {}) ⇒ EventSubscription
2521 2522 2523 2524 2525 2526 2527 2528 2529 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 2521 def unsubscribe_from( = {}) = .merge(source_identifier: @id) resp = @client.remove_source_identifier_from_subscription() EventSubscription.new( name: resp.data.event_subscription.cust_subscription_id, data: resp.data.event_subscription, client: @client ) end |
#vpc_security_groups ⇒ Array<Types::VpcSecurityGroupMembership>
Provides a list of VPC security group elements that the DB instance belongs to.
126 127 128 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 126 def vpc_security_groups data.vpc_security_groups end |