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 gibibytes.
-
#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 AWS Region-unique, immutable identifier for the DB instance.
-
#domain_memberships ⇒ Array<Types::DomainMembership>
The Active Directory Domain membership records associated with the DB instance.
-
#enabled_cloudwatch_logs_exports ⇒ Array<String>
A list of log types that this DB instance is configured to export to CloudWatch Logs.
-
#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, and 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 AWS 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 Amazon 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.
-
#performance_insights_enabled ⇒ Boolean
True if Performance Insights is enabled for the DB instance, and otherwise false.
-
#performance_insights_kms_key_id ⇒ String
The AWS KMS key identifier for encryption of Performance Insights data.
-
#performance_insights_retention_period ⇒ Integer
The amount of time, in days, to retain Performance Insights data.
-
#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).
-
#processor_features ⇒ Array<Types::ProcessorFeature>
The number of CPU cores and the number of threads per core for the DB instance class of the DB instance.
-
#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.
-
#wait_until(options = {}, &block) ⇒ Resource
deprecated
Deprecated.
Use [Aws::RDS::Client] #wait_until instead
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 gibibytes.
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.
312 313 314 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 312 def ca_certificate_identifier data[:ca_certificate_identifier] end |
#certificate ⇒ Certificate?
2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 2695 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
443 444 445 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 443 def client @client end |
#cluster ⇒ DBCluster?
2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 2707 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.
326 327 328 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 326 def data[:copy_tags_to_snapshot] end |
#create(options = {}) ⇒ DBInstance
1360 1361 1362 1363 1364 1365 1366 1367 1368 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 1360 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
1652 1653 1654 1655 1656 1657 1658 1659 1660 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 1652 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
1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 1696 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`.
463 464 465 466 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 463 def data load unless @data @data end |
#data_loaded? ⇒ Boolean
471 472 473 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 471 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.
285 286 287 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 285 def db_cluster_identifier data[:db_cluster_identifier] end |
#db_instance_arn ⇒ String
The Amazon Resource Name (ARN) for the DB instance.
367 368 369 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 367 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.
278 279 280 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 278 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 AWS Region-unique, immutable identifier for the DB instance. This identifier is found in AWS CloudTrail log entries whenever the AWS KMS key for the DB instance is accessed.
306 307 308 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 306 def dbi_resource_id data[:dbi_resource_id] end |
#delete(options = {}) ⇒ DBInstance
1752 1753 1754 1755 1756 1757 1758 1759 1760 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 1752 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.
319 320 321 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 319 def domain_memberships data[:domain_memberships] end |
#enabled_cloudwatch_logs_exports ⇒ Array<String>
A list of log types that this DB instance is configured to export to CloudWatch Logs.
Log types vary by DB engine. For information about the log types for each DB engine, see [Amazon RDS Database Log Files] in the *Amazon RDS User Guide.*
[1]: docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_LogAccess.html
429 430 431 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 429 def enabled_cloudwatch_logs_exports data[:enabled_cloudwatch_logs_exports] 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.
341 342 343 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 341 def enhanced_monitoring_resource_arn data[:enhanced_monitoring_resource_arn] end |
#events(options = {}) ⇒ Event::Collection
2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 2763 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, and 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.
392 393 394 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 392 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.
3063 3064 3065 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 3063 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 AWS KMS key identifier for the encrypted DB instance.
298 299 300 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 298 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
453 454 455 456 457 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 453 def load resp = @client.describe_db_instances(db_instance_identifier: @id) @data = resp.db_instances[0] self end |
#log_files(options = {}) ⇒ DBLogFile::Collection
2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 2812 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
2318 2319 2320 2321 2322 2323 2324 2325 2326 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 2318 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.
333 334 335 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 333 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 Amazon CloudWatch Logs.
348 349 350 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 348 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
2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 2833 def option_groups batch = [] data[:option_group_memberships].each do |d| batch << OptionGroup.new( name: d[:option_group_name], client: @client ) end OptionGroup::Collection.new([batch], size: batch.size) end |
#parameter_groups ⇒ DBParameterGroup::Collection
2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 2845 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
2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 2901 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 |
#performance_insights_enabled ⇒ Boolean
True if Performance Insights is enabled for the DB instance, and otherwise false.
399 400 401 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 399 def performance_insights_enabled data[:performance_insights_enabled] end |
#performance_insights_kms_key_id ⇒ String
The AWS KMS key identifier for encryption of Performance Insights data. The KMS key ID is the Amazon Resource Name (ARN), KMS key identifier, or the KMS key alias for the KMS encryption key.
407 408 409 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 407 def performance_insights_kms_key_id data[:performance_insights_kms_key_id] end |
#performance_insights_retention_period ⇒ Integer
The amount of time, in days, to retain Performance Insights data. Valid values are 7 or 731 (2 years).
414 415 416 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 414 def performance_insights_retention_period data[:performance_insights_retention_period] 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 |
#processor_features ⇒ Array<Types::ProcessorFeature>
The number of CPU cores and the number of threads per core for the DB instance class of the DB instance.
436 437 438 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 436 def processor_features data[:processor_features] end |
#promote(options = {}) ⇒ DBInstance
2371 2372 2373 2374 2375 2376 2377 2378 2379 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 2371 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
361 362 363 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 361 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.
250 251 252 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 250 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
2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 2923 def read_replicas batch = [] data[:read_replica_db_instance_identifiers].each do |d| batch << DBInstance.new( id: d, client: @client ) end DBInstance::Collection.new([batch], size: batch.size) end |
#reboot(options = {}) ⇒ DBInstance
2393 2394 2395 2396 2397 2398 2399 2400 2401 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 2393 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
2642 2643 2644 2645 2646 2647 2648 2649 2650 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 2642 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
2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 2935 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
3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 3017 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?
3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 3038 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 is blank.
257 258 259 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 257 def status_infos data[:status_infos] end |
#storage_encrypted ⇒ Boolean
Specifies whether the DB instance is encrypted.
291 292 293 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 291 def storage_encrypted data[:storage_encrypted] end |
#storage_type ⇒ String
Specifies the storage type associated with DB instance.
263 264 265 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 263 def storage_type data[:storage_type] end |
#subnet_group ⇒ DBSubnetGroup?
3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 3050 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
2662 2663 2664 2665 2666 2667 2668 2669 2670 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 2662 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.
270 271 272 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 270 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.
375 376 377 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 375 def timezone data[:timezone] end |
#unsubscribe_from(options = {}) ⇒ EventSubscription
2682 2683 2684 2685 2686 2687 2688 2689 2690 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 2682 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 |
#wait_until(options = {}, &block) ⇒ Resource
Use [Aws::RDS::Client] #wait_until instead
The waiting operation is performed on a copy. The original resource remains unchanged
Waiter polls an API operation until a resource enters a desired state.
## Basic Usage
Waiter will polls until it is successful, it fails by entering a terminal state, or until a maximum number of attempts are made.
# polls in a loop until condition is true
resource.wait_until() {|resource| condition}
## Example
instance.wait_until(max_attempts:10, delay:5) {|instance| instance.state.name == 'running' }
## Configuration
You can configure the maximum number of polling attempts, and the delay (in seconds) between each polling attempt. The waiting condition is set by passing a block to #wait_until:
# poll for ~25 seconds
resource.wait_until(max_attempts:5,delay:5) {|resource|...}
## Callbacks
You can be notified before each polling attempt and before each delay. If you throw ‘:success` or `:failure` from these callbacks, it will terminate the waiter.
started_at = Time.now
# poll for 1 hour, instead of a number of attempts
proc = Proc.new do |attempts, response|
throw :failure if Time.now - started_at > 3600
end
# disable max attempts
instance.wait_until(before_wait:proc, max_attempts:nil) {...}
## Handling Errors
When a waiter is successful, it returns the Resource. When a waiter fails, it raises an error.
begin
resource.wait_until(...)
rescue Aws::Waiters::Errors::WaiterFailed
# resource did not enter the desired state in time
end
attempts attempt in seconds invoked before each attempt invoked before each wait
553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 553 def wait_until( = {}, &block) self_copy = self.dup attempts = 0 [:max_attempts] = 10 unless .key?(:max_attempts) [:delay] ||= 10 [:poller] = Proc.new do attempts += 1 if block.call(self_copy) [:success, self_copy] else self_copy.reload unless attempts == [:max_attempts] :retry end end Aws::Waiters::Waiter.new().wait({}) end |