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
-
#activity_stream_engine_native_audit_fields_included ⇒ Boolean
Indicates whether engine-native audit fields are included in the database activity stream.
-
#activity_stream_kinesis_stream_name ⇒ String
The name of the Amazon Kinesis data stream used for the database activity stream.
-
#activity_stream_kms_key_id ⇒ String
The Amazon Web Services KMS key identifier used for encrypting messages in the database activity stream.
-
#activity_stream_mode ⇒ String
The mode of the database activity stream.
-
#activity_stream_policy_status ⇒ String
The status of the policy state of the activity stream.
-
#activity_stream_status ⇒ String
The status of the database activity stream.
-
#allocated_storage ⇒ Integer
Specifies the allocated storage size specified in gibibytes (GiB).
-
#associated_roles ⇒ Array<Types::DBInstanceRole>
The Amazon Web Services Identity and Access Management (IAM) roles associated with the DB instance.
-
#auto_minor_version_upgrade ⇒ Boolean
A value that indicates that minor version patches are applied automatically.
-
#automatic_restart_time ⇒ Time
The time when a stopped DB instance is restarted automatically.
-
#automation_mode ⇒ String
The automation mode of the RDS Custom DB instance: `full` or `all paused`.
-
#availability_zone ⇒ String
Specifies the name of the Availability Zone the DB instance is located in.
-
#aws_backup_recovery_point_arn ⇒ String
The Amazon Resource Name (ARN) of the recovery point in Amazon Web Services Backup.
-
#backup_retention_period ⇒ Integer
Specifies the number of days for which automatic DB snapshots are retained.
-
#backup_target ⇒ String
Specifies where automated backups and manual snapshots are stored: Amazon Web Services Outposts or the Amazon Web Services Region.
-
#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.
-
#custom_iam_instance_profile ⇒ String
The instance profile associated with the underlying Amazon EC2 instance of an RDS Custom DB instance.
-
#customer_owned_ip_enabled ⇒ Boolean
Specifies whether a customer-owned IP address (CoIP) is enabled for an RDS on Outposts 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_automated_backups_replications ⇒ Array<Types::DBInstanceAutomatedBackupsReplication>
The list of replicated automated backups associated with 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>
A list of DB security group elements containing `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 Amazon Web Services 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
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 Amazon Web Services 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 Amazon Web Services 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.
-
#max_allocated_storage ⇒ Integer
The upper limit in gibibytes (GiB) to which Amazon RDS can automatically scale the storage of 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.
-
#nchar_character_set_name ⇒ String
The name of the NCHAR character set for the Oracle DB instance.
-
#network_type ⇒ String
The network type of the DB instance.
-
#option_group_memberships ⇒ Array<Types::OptionGroupMembership>
Provides the list of option group memberships for this DB instance.
-
#pending_modified_values ⇒ Types::PendingModifiedValues
A value that 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 Amazon Web Services KMS key identifier for encryption of Performance Insights data.
-
#performance_insights_retention_period ⇒ Integer
The number of 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.
-
#replica_mode ⇒ String
The open mode of an Oracle read replica.
-
#resume_full_automation_mode_time ⇒ Time
The number of minutes to pause the automation.
-
#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.
-
#tag_list ⇒ Array<Types::Tag>
A list of tags.
-
#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 = {}) {|resource| ... } ⇒ 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.
22 23 24 25 26 27 28 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 22 def initialize(*args) = Hash === args.last ? args.pop.dup : {} @id = extract_id(args, ) @data = .delete(:data) @client = .delete(:client) || Client.new() @waiter_block_warned = false end |
Instance Method Details
#activity_stream_engine_native_audit_fields_included ⇒ Boolean
Indicates whether engine-native audit fields are included in the database activity stream.
646 647 648 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 646 def activity_stream_engine_native_audit_fields_included data[:activity_stream_engine_native_audit_fields_included] end |
#activity_stream_kinesis_stream_name ⇒ String
The name of the Amazon Kinesis data stream used for the database activity stream.
631 632 633 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 631 def activity_stream_kinesis_stream_name data[:activity_stream_kinesis_stream_name] end |
#activity_stream_kms_key_id ⇒ String
The Amazon Web Services KMS key identifier used for encrypting messages in the database activity stream. The Amazon Web Services KMS key identifier is the key ARN, key ID, alias ARN, or alias name for the KMS key.
624 625 626 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 624 def activity_stream_kms_key_id data[:activity_stream_kms_key_id] end |
#activity_stream_mode ⇒ String
The mode of the database activity stream. Database events such as a change or access generate an activity stream event. RDS for Oracle always handles these events asynchronously.
639 640 641 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 639 def activity_stream_mode data[:activity_stream_mode] end |
#activity_stream_policy_status ⇒ String
The status of the policy state of the activity stream.
724 725 726 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 724 def activity_stream_policy_status data[:activity_stream_policy_status] end |
#activity_stream_status ⇒ String
The status of the database activity stream.
615 616 617 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 615 def activity_stream_status data[:activity_stream_status] end |
#allocated_storage ⇒ Integer
Specifies the allocated storage size specified in gibibytes (GiB).
110 111 112 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 110 def allocated_storage data[:allocated_storage] end |
#associated_roles ⇒ Array<Types::DBInstanceRole>
The Amazon Web Services Identity and Access Management (IAM) roles associated with the DB instance.
546 547 548 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 546 def associated_roles data[:associated_roles] end |
#auto_minor_version_upgrade ⇒ Boolean
A value that indicates that minor version patches are applied automatically.
208 209 210 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 208 def auto_minor_version_upgrade data[:auto_minor_version_upgrade] end |
#automatic_restart_time ⇒ Time
The time when a stopped DB instance is restarted automatically.
66 67 68 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 66 def automatic_restart_time data[:automatic_restart_time] end |
#automation_mode ⇒ String
The automation mode of the RDS Custom DB instance: `full` or `all paused`. If `full`, the DB instance automates monitoring and instance recovery. If `all paused`, the instance pauses automation for the duration set by `–resume-full-automation-mode-minutes`.
655 656 657 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 655 def automation_mode data[:automation_mode] end |
#availability_zone ⇒ String
Specifies the name of the Availability Zone the DB instance is located in.
158 159 160 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 158 def availability_zone data[:availability_zone] end |
#aws_backup_recovery_point_arn ⇒ String
The Amazon Resource Name (ARN) of the recovery point in Amazon Web Services Backup.
609 610 611 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 609 def aws_backup_recovery_point_arn data[:aws_backup_recovery_point_arn] end |
#backup_retention_period ⇒ Integer
Specifies the number of days for which automatic DB snapshots are retained.
131 132 133 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 131 def backup_retention_period data[:backup_retention_period] end |
#backup_target ⇒ String
Specifies where automated backups and manual snapshots are stored: Amazon Web Services Outposts or the Amazon Web Services Region.
693 694 695 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 693 def backup_target data[:backup_target] end |
#ca_certificate_identifier ⇒ String
The identifier of the CA certificate for this DB instance.
379 380 381 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 379 def ca_certificate_identifier data[:ca_certificate_identifier] end |
#certificate ⇒ Certificate?
3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 3991 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.
279 280 281 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 279 def character_set_name data[:character_set_name] end |
#client ⇒ Client
731 732 733 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 731 def client @client end |
#cluster ⇒ DBCluster?
4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 4003 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`.
399 400 401 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 399 def data[:copy_tags_to_snapshot] end |
#create(options = {}) ⇒ DBInstance
1962 1963 1964 1965 1966 1967 1968 1969 1970 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 1962 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
2484 2485 2486 2487 2488 2489 2490 2491 2492 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 2484 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
2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 2528 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 |
#custom_iam_instance_profile ⇒ String
The instance profile associated with the underlying Amazon EC2 instance of an RDS Custom DB instance. The instance profile must meet the following requirements:
-
The profile must exist in your account.
-
The profile must have an IAM role that Amazon EC2 has permissions to assume.
-
The instance profile name and the associated IAM role name must start with the prefix `AWSRDSCustom`.
For the list of permissions required for the IAM role, see [ Configure IAM and your VPC] in the *Amazon RDS User Guide*.
[1]: docs.aws.amazon.com/AmazonRDS/latest/UserGuide/custom-setup-orcl.html#custom-setup-orcl.iam-vpc
686 687 688 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 686 def custom_iam_instance_profile data[:custom_iam_instance_profile] end |
#customer_owned_ip_enabled ⇒ Boolean
Specifies whether a customer-owned IP address (CoIP) is enabled for an RDS on Outposts DB instance.
A CoIP provides local or external connectivity to resources in your Outpost subnets through your on-premises network. For some use cases, a CoIP can provide lower latency for connections to the DB instance from outside of its virtual private cloud (VPC) on your local network.
For more information about RDS on Outposts, see [Working with Amazon RDS on Amazon Web Services Outposts] in the *Amazon RDS User Guide*.
For more information about CoIPs, see [Customer-owned IP addresses] in the *Amazon Web Services Outposts User Guide*.
[1]: docs.aws.amazon.com/AmazonRDS/latest/UserGuide/rds-on-outposts.html [2]: docs.aws.amazon.com/outposts/latest/userguide/outposts-networking-components.html#ip-addressing
602 603 604 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 602 def customer_owned_ip_enabled data[:customer_owned_ip_enabled] end |
#data ⇒ Types::DBInstance
Returns the data for this Aws::RDS::DBInstance. Calls Client#describe_db_instances if #data_loaded? is `false`.
751 752 753 754 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 751 def data load unless @data @data end |
#data_loaded? ⇒ Boolean
759 760 761 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 759 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.
348 349 350 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 348 def db_cluster_identifier data[:db_cluster_identifier] end |
#db_instance_arn ⇒ String
The Amazon Resource Name (ARN) for the DB instance.
440 441 442 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 440 def db_instance_arn data[:db_instance_arn] end |
#db_instance_automated_backups_replications ⇒ Array<Types::DBInstanceAutomatedBackupsReplication>
The list of replicated automated backups associated with the DB instance.
577 578 579 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 577 def db_instance_automated_backups_replications data[:db_instance_automated_backups_replications] end |
#db_instance_class ⇒ String
Contains the name of the compute and memory capacity class of the DB instance.
41 42 43 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 41 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.
341 342 343 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 341 def db_instance_port data[:db_instance_port] end |
#db_instance_status ⇒ String
Specifies the current state of this database.
For information about DB instance statuses, see [Viewing DB instance status] in the *Amazon RDS User Guide.*
[1]: docs.aws.amazon.com/AmazonRDS/latest/UserGuide/accessing-monitoring.html#Overview.DBInstance.Status
60 61 62 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 60 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.
**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.
93 94 95 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 93 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.
151 152 153 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 151 def db_parameter_groups data[:db_parameter_groups] end |
#db_security_groups ⇒ Array<Types::DBSecurityGroupMembership>
A list of DB security group elements containing `DBSecurityGroup.Name` and `DBSecurityGroup.Status` subelements.
138 139 140 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 138 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.
166 167 168 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 166 def db_subnet_group data[:db_subnet_group] end |
#dbi_resource_id ⇒ String
The Amazon Web Services Region-unique, immutable identifier for the DB instance. This identifier is found in Amazon Web Services CloudTrail log entries whenever the Amazon Web Services KMS key for the DB instance is accessed.
373 374 375 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 373 def dbi_resource_id data[:dbi_resource_id] end |
#delete(options = {}) ⇒ DBInstance
2594 2595 2596 2597 2598 2599 2600 2601 2602 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 2594 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 deletion protection is enabled. For more information, see [ Deleting a DB Instance].
[1]: docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_DeleteInstance.html
539 540 541 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 539 def deletion_protection data[:deletion_protection] end |
#domain_memberships ⇒ Array<Types::DomainMembership>
The Active Directory Domain membership records associated with the DB instance.
386 387 388 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 386 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
520 521 522 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 520 def enabled_cloudwatch_logs_exports data[:enabled_cloudwatch_logs_exports] end |
#endpoint ⇒ Types::Endpoint
Specifies the connection endpoint.
<note markdown=“1”> The endpoint might not be shown for instances whose status is `creating`.
</note>
104 105 106 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 104 def endpoint data[:endpoint] end |
#engine ⇒ String
The name of the database engine to be used for this DB instance.
47 48 49 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 47 def engine data[:engine] end |
#engine_version ⇒ String
Indicates the database engine version.
201 202 203 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 201 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.
414 415 416 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 414 def enhanced_monitoring_resource_arn data[:enhanced_monitoring_resource_arn] end |
#events(options = {}) ⇒ Event::Collection
4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 4059 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 Amazon Web Services 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.
465 466 467 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 465 def iam_database_authentication_enabled data[:iam_database_authentication_enabled] end |
#id ⇒ String Also known as: db_instance_identifier
33 34 35 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 33 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.
4376 4377 4378 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 4376 def identifiers { id: @id } end |
#instance_create_time ⇒ Time
Provides the date and time the DB instance was created.
116 117 118 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 116 def instance_create_time data[:instance_create_time] end |
#iops ⇒ Integer
Specifies the Provisioned IOPS (I/O operations per second) value.
266 267 268 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 266 def iops data[:iops] end |
#kms_key_id ⇒ String
If `StorageEncrypted` is true, the Amazon Web Services KMS key identifier for the encrypted DB instance.
The Amazon Web Services KMS key identifier is the key ARN, key ID, alias ARN, or alias name for the KMS key.
364 365 366 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 364 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.
188 189 190 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 188 def latest_restorable_time data[:latest_restorable_time] end |
#license_model ⇒ String
License model information for this DB instance. This setting doesn't apply to RDS Custom.
260 261 262 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 260 def license_model data[:license_model] end |
#listener_endpoint ⇒ Types::Endpoint
Specifies the listener connection endpoint for SQL Server Always On.
552 553 554 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 552 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
741 742 743 744 745 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 741 def load resp = @client.describe_db_instances(db_instance_identifier: @id) @data = resp.db_instances[0] self end |
#log_files(options = {}) ⇒ DBLogFile::Collection
4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 4108 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.
72 73 74 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 72 def master_username data[:master_username] end |
#max_allocated_storage ⇒ Integer
The upper limit in gibibytes (GiB) to which Amazon RDS can automatically scale the storage of the DB instance.
559 560 561 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 559 def max_allocated_storage data[:max_allocated_storage] end |
#modify(options = {}) ⇒ DBInstance
3429 3430 3431 3432 3433 3434 3435 3436 3437 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 3429 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.
406 407 408 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 406 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.
421 422 423 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 421 def monitoring_role_arn data[:monitoring_role_arn] end |
#multi_az ⇒ Boolean
Specifies if the DB instance is a Multi-AZ deployment. This setting doesn't apply to RDS Custom.
195 196 197 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 195 def multi_az data[:multi_az] end |
#nchar_character_set_name ⇒ String
The name of the NCHAR character set for the Oracle DB instance. This character set specifies the Unicode encoding for data stored in table columns of type NCHAR, NCLOB, or NVARCHAR2.
287 288 289 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 287 def nchar_character_set_name data[:nchar_character_set_name] end |
#network_type ⇒ String
The network type of the DB instance.
Valid values:
-
`IPV4`
-
`DUAL`
The network type is determined by the `DBSubnetGroup` specified for the DB instance. A `DBSubnetGroup` can support only the IPv4 protocol or the IPv4 and the IPv6 protocols (`DUAL`).
For more information, see [ Working with a DB instance in a VPC] in the *Amazon RDS User Guide* and [ Working with a DB instance in a VPC] in the *Amazon Aurora User Guide.*
[1]: docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_VPC.WorkingWithRDSInstanceinaVPC.html [2]: docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_VPC.WorkingWithRDSInstanceinaVPC.html
718 719 720 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 718 def network_type data[:network_type] end |
#option_group_memberships ⇒ Array<Types::OptionGroupMembership>
Provides the list of option group memberships for this DB instance.
272 273 274 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 272 def option_group_memberships data[:option_group_memberships] end |
#option_groups ⇒ OptionGroup::Collection
4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 4129 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
4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 4141 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
4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 4180 def pending_maintenance_actions( = {}) batches = Enumerator.new do |y| = Aws::Util.deep_merge(, filters: [{ name: "db-instance-id", values: [@id] }]) resp = @client.describe_pending_maintenance_actions() resp.each_page do |page| batch = [] page.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 end PendingMaintenanceAction::Collection.new(batches) end |
#pending_modified_values ⇒ Types::PendingModifiedValues
A value that specifies that changes to the DB instance are pending. This element is only included when changes are pending. Specific changes are identified by subelements.
181 182 183 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 181 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.
472 473 474 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 472 def performance_insights_enabled data[:performance_insights_enabled] end |
#performance_insights_kms_key_id ⇒ String
The Amazon Web Services KMS key identifier for encryption of Performance Insights data.
The Amazon Web Services KMS key identifier is the key ARN, key ID, alias ARN, or alias name for the KMS key.
482 483 484 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 482 def performance_insights_kms_key_id data[:performance_insights_kms_key_id] end |
#performance_insights_retention_period ⇒ Integer
The number of days to retain Performance Insights data. The default is 7 days. The following values are valid:
-
7
-
month * 31, where month is a number of months from 1-23
-
731
For example, the following values are valid:
-
93 (3 months * 31)
-
341 (11 months * 31)
-
589 (19 months * 31)
-
731
505 506 507 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 505 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`.
124 125 126 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 124 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).
173 174 175 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 173 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.
527 528 529 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 527 def processor_features data[:processor_features] end |
#promote(options = {}) ⇒ DBInstance
3482 3483 3484 3485 3486 3487 3488 3489 3490 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 3482 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*.
434 435 436 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 434 def promotion_tier data[:promotion_tier] end |
#publicly_accessible ⇒ Boolean
Specifies the accessibility options for the DB instance.
When the DB cluster is publicly accessible, its Domain Name System (DNS) endpoint resolves to the private IP address from within the DB cluster's virtual private cloud (VPC). It resolves to the public IP address from outside of the DB cluster's VPC. Access to the DB cluster is ultimately controlled by the security group it uses. That public access isn't permitted if the security group assigned to the DB cluster doesn't permit it.
When the DB instance isn't publicly accessible, it is an internal DB instance with a DNS name that resolves to a private IP address.
For more information, see CreateDBInstance.
313 314 315 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 313 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 for MySQL DB instance, the Aurora MySQL DB cluster for the Aurora read replica is shown. This output doesn't contain information about cross-Region Aurora read replicas.
<note markdown=“1”> Currently, each RDS DB instance can have only one Aurora read replica.
</note>
237 238 239 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 237 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.
222 223 224 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 222 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.
215 216 217 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 215 def read_replica_source_db_instance_identifier data[:read_replica_source_db_instance_identifier] end |
#read_replicas ⇒ DBInstance::Collection
4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 4204 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
3505 3506 3507 3508 3509 3510 3511 3512 3513 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 3505 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 |
#replica_mode ⇒ String
The open mode of an Oracle read replica. The default is `open-read-only`. For more information, see [Working with Oracle Read Replicas for Amazon RDS] in the *Amazon RDS User Guide*.
<note markdown=“1”> This attribute is only supported in RDS for Oracle.
</note>
[1]: docs.aws.amazon.com/AmazonRDS/latest/UserGuide/oracle-read-replicas.html
253 254 255 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 253 def replica_mode data[:replica_mode] end |
#restore(options = {}) ⇒ DBInstance
3938 3939 3940 3941 3942 3943 3944 3945 3946 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 3938 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 |
#resume_full_automation_mode_time ⇒ Time
The number of minutes to pause the automation. When the time period ends, RDS Custom resumes full automation. The minimum value is 60 (default). The maximum value is 1,440.
663 664 665 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 663 def resume_full_automation_mode_time data[:resume_full_automation_mode_time] end |
#secondary_availability_zone ⇒ String
If present, specifies the name of the secondary Availability Zone for a DB instance with multi-AZ support.
294 295 296 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 294 def secondary_availability_zone data[:secondary_availability_zone] end |
#security_groups ⇒ DBSecurityGroup::Collection
4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 4216 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
4330 4331 4332 4333 4334 4335 4336 4337 4338 4339 4340 4341 4342 4343 4344 4345 4346 4347 4348 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 4330 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?
4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 4351 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 isn't a read replica, this is blank.
320 321 322 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 320 def status_infos data[:status_infos] end |
#storage_encrypted ⇒ Boolean
Specifies whether the DB instance is encrypted.
354 355 356 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 354 def storage_encrypted data[:storage_encrypted] end |
#storage_type ⇒ String
Specifies the storage type associated with DB instance.
326 327 328 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 326 def storage_type data[:storage_type] end |
#subnet_group ⇒ DBSubnetGroup?
4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 4363 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
3958 3959 3960 3961 3962 3963 3964 3965 3966 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 3958 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 |
#tag_list ⇒ Array<Types::Tag>
A list of tags. For more information, see [Tagging Amazon RDS Resources] in the *Amazon RDS User Guide.*
[1]: docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html
570 571 572 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 570 def tag_list data[:tag_list] end |
#tde_credential_arn ⇒ String
The ARN from the key store with which the instance is associated for TDE encryption.
333 334 335 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 333 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.
448 449 450 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 448 def timezone data[:timezone] end |
#unsubscribe_from(options = {}) ⇒ EventSubscription
3978 3979 3980 3981 3982 3983 3984 3985 3986 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 3978 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.
145 146 147 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 145 def vpc_security_groups data[:vpc_security_groups] end |
#wait_until(options = {}) {|resource| ... } ⇒ 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) do |instance|
instance.state.name == 'running'
end
## 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
843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 |
# File 'lib/aws-sdk-rds/db_instance.rb', line 843 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 |