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.
-
#associated_roles ⇒ Array<Types::DBInstanceRole>
The AWS Identity and Access Management (IAM) roles associated with the DB instance.
-
#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 |
#associated_roles ⇒ Array<Types::DBInstanceRole>
The AWS Identity and Access Management (IAM) roles associated with the DB instance.
468 469 470 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 468 def associated_roles data[:associated_roles] 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?
2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 2822 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
481 482 483 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 481 def client @client end |
#cluster ⇒ DBCluster?
2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 2834 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.
**Amazon Aurora**
Not applicable. Copying tags to snapshots is managed by the DB cluster. Setting this value for an Aurora DB instance has no effect on the DB cluster setting. For more information, see DBCluster.
339 340 341 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 339 def data[:copy_tags_to_snapshot] end |
#create(options = {}) ⇒ DBInstance
1415 1416 1417 1418 1419 1420 1421 1422 1423 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 1415 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
1723 1724 1725 1726 1727 1728 1729 1730 1731 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 1723 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
1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 1767 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`.
501 502 503 504 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 501 def data load unless @data @data end |
#data_loaded? ⇒ Boolean
509 510 511 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 509 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.
380 381 382 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 380 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
1827 1828 1829 1830 1831 1832 1833 1834 1835 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 1827 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
461 462 463 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 461 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
442 443 444 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 442 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.
354 355 356 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 354 def enhanced_monitoring_resource_arn data[:enhanced_monitoring_resource_arn] end |
#events(options = {}) ⇒ Event::Collection
2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 2890 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.
405 406 407 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 405 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.
3205 3206 3207 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 3205 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.
474 475 476 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 474 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
491 492 493 494 495 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 491 def load resp = @client.describe_db_instances(db_instance_identifier: @id) @data = resp.db_instances[0] self end |
#log_files(options = {}) ⇒ DBLogFile::Collection
2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 2939 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
2412 2413 2414 2415 2416 2417 2418 2419 2420 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 2412 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.
346 347 348 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 346 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.
361 362 363 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 361 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
2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 2960 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
2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 2972 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
3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 3028 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.
412 413 414 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 412 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.
420 421 422 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 420 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).
427 428 429 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 427 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.
449 450 451 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 449 def processor_features data[:processor_features] end |
#promote(options = {}) ⇒ DBInstance
2465 2466 2467 2468 2469 2470 2471 2472 2473 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 2465 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*.
374 375 376 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 374 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
3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 3050 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
2487 2488 2489 2490 2491 2492 2493 2494 2495 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 2487 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
2769 2770 2771 2772 2773 2774 2775 2776 2777 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 2769 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
3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 3062 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
3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 3159 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?
3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 3180 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?
3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 3192 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
2789 2790 2791 2792 2793 2794 2795 2796 2797 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 2789 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.
388 389 390 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 388 def timezone data[:timezone] end |
#unsubscribe_from(options = {}) ⇒ EventSubscription
2809 2810 2811 2812 2813 2814 2815 2816 2817 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 2809 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
591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 591 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 |