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.
-
#deletion_protection ⇒ Boolean
Indicates if the DB instance has deletion protection enabled.
-
#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.
-
#listener_endpoint ⇒ Types::Endpoint
Specifies the listener connection endpoint for SQL Server Always On.
-
#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 to which the RDS DB instance is replicated as a Read Replica.
-
#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.
319 320 321 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 319 def ca_certificate_identifier data[:ca_certificate_identifier] end |
#certificate ⇒ Certificate?
2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 2793 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.
240 241 242 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 240 def character_set_name data[:character_set_name] end |
#client ⇒ Client
468 469 470 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 468 def client @client end |
#cluster ⇒ DBCluster?
2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 2805 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.
333 334 335 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 333 def data[:copy_tags_to_snapshot] end |
#create(options = {}) ⇒ DBInstance
1396 1397 1398 1399 1400 1401 1402 1403 1404 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 1396 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
1704 1705 1706 1707 1708 1709 1710 1711 1712 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 1704 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
1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 1748 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`.
488 489 490 491 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 488 def data load unless @data @data end |
#data_loaded? ⇒ Boolean
496 497 498 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 496 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.
292 293 294 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 292 def db_cluster_identifier data[:db_cluster_identifier] end |
#db_instance_arn ⇒ String
The Amazon Resource Name (ARN) for the DB instance.
374 375 376 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 374 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.
285 286 287 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 285 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.
313 314 315 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 313 def dbi_resource_id data[:dbi_resource_id] end |
#delete(options = {}) ⇒ DBInstance
1808 1809 1810 1811 1812 1813 1814 1815 1816 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 1808 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 |
#deletion_protection ⇒ Boolean
Indicates if the DB instance has deletion protection enabled. The database can’t be deleted when this value is set to true. For more information, see [ Deleting a DB Instance].
[1]: docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_DeleteInstance.html
455 456 457 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 455 def deletion_protection data[:deletion_protection] end |
#domain_memberships ⇒ Array<Types::DomainMembership>
The Active Directory Domain membership records associated with the DB instance.
326 327 328 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 326 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
436 437 438 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 436 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.
348 349 350 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 348 def enhanced_monitoring_resource_arn data[:enhanced_monitoring_resource_arn] end |
#events(options = {}) ⇒ Event::Collection
2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 2861 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.
399 400 401 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 399 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.
3164 3165 3166 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 3164 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.
227 228 229 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 227 def iops data[:iops] end |
#kms_key_id ⇒ String
If ‘StorageEncrypted` is true, the AWS KMS key identifier for the encrypted DB instance.
305 306 307 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 305 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.
221 222 223 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 221 def license_model data[:license_model] end |
#listener_endpoint ⇒ Types::Endpoint
Specifies the listener connection endpoint for SQL Server Always On.
461 462 463 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 461 def listener_endpoint data[:listener_endpoint] 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
478 479 480 481 482 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 478 def load resp = @client.describe_db_instances(db_instance_identifier: @id) @data = resp.db_instances[0] self end |
#log_files(options = {}) ⇒ DBLogFile::Collection
2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 2910 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
2383 2384 2385 2386 2387 2388 2389 2390 2391 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 2383 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.
340 341 342 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 340 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.
355 356 357 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 355 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.
233 234 235 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 233 def option_group_memberships data[:option_group_memberships] end |
#option_groups ⇒ OptionGroup::Collection
2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 2931 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
2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 2943 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
2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 2999 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.
406 407 408 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 406 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.
414 415 416 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 414 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).
421 422 423 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 421 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.
443 444 445 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 443 def processor_features data[:processor_features] end |
#promote(options = {}) ⇒ DBInstance
2436 2437 2438 2439 2440 2441 2442 2443 2444 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 2436 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] in the *Amazon Aurora User Guide*.
368 369 370 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 368 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.
257 258 259 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 257 def publicly_accessible data[:publicly_accessible] end |
#read_replica_db_cluster_identifiers ⇒ Array<String>
Contains one or more identifiers of Aurora DB clusters to which the RDS DB instance is replicated as a Read Replica. For example, when you create an Aurora Read Replica of an RDS MySQL DB instance, the Aurora MySQL DB cluster for the Aurora Read Replica is shown. This output does not contain information about cross region Aurora Read Replicas.
<note markdown=“1”> Currently, each RDS DB instance can have only one Aurora Read Replica.
</note>
215 216 217 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 215 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
3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 3021 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
2458 2459 2460 2461 2462 2463 2464 2465 2466 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 2458 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
2740 2741 2742 2743 2744 2745 2746 2747 2748 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 2740 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.
247 248 249 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 247 def secondary_availability_zone data[:secondary_availability_zone] end |
#security_groups ⇒ DBSecurityGroup::Collection
3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 3033 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
3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 3118 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?
3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 3139 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.
264 265 266 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 264 def status_infos data[:status_infos] end |
#storage_encrypted ⇒ Boolean
Specifies whether the DB instance is encrypted.
298 299 300 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 298 def storage_encrypted data[:storage_encrypted] end |
#storage_type ⇒ String
Specifies the storage type associated with DB instance.
270 271 272 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 270 def storage_type data[:storage_type] end |
#subnet_group ⇒ DBSubnetGroup?
3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 3151 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
2760 2761 2762 2763 2764 2765 2766 2767 2768 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 2760 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.
277 278 279 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 277 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.
382 383 384 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 382 def timezone data[:timezone] end |
#unsubscribe_from(options = {}) ⇒ EventSubscription
2780 2781 2782 2783 2784 2785 2786 2787 2788 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 2780 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
578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 578 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 |