Class: Aws::RDS::DBInstance
- Inherits:
-
Object
- Object
- Aws::RDS::DBInstance
- Defined in:
- gems/aws-sdk-rds/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
The amount of storage in gibibytes (GiB) allocated for the DB instance.
-
#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
Indicates whether 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
orall paused
. -
#availability_zone ⇒ String
The name of the Availability Zone where the DB instance is located.
-
#aws_backup_recovery_point_arn ⇒ String
The Amazon Resource Name (ARN) of the recovery point in Amazon Web Services Backup.
-
#backup_retention_period ⇒ Integer
The number of days for which automatic DB snapshots are retained.
-
#backup_target ⇒ String
The location where automated backups and manual snapshots are stored: Dedicated Local Zones, Amazon Web Services Outposts or the Amazon Web Services Region.
-
#ca_certificate_identifier ⇒ String
The identifier of the CA certificate for this DB instance.
-
#certificate_details ⇒ Types::CertificateDetails
The details of the DB instance's server certificate.
-
#character_set_name ⇒ String
If present, specifies the name of the character set that this instance is associated with.
-
#copy_tags_to_snapshot ⇒ Boolean
Indicates 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
Indicates whether a customer-owned IP address (CoIP) is enabled for an RDS on Outposts DB instance.
-
#database_insights_mode ⇒ String
The mode of Database Insights that is enabled for the instance.
-
#db_cluster_identifier ⇒ String
If the DB instance is a member of a DB cluster, indicates 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
The name of the compute and memory capacity class of the DB instance.
-
#db_instance_port ⇒ Integer
The port that the DB instance listens on.
-
#db_instance_status ⇒ String
The current state of this database.
-
#db_name ⇒ String
The initial database name that you provided (if required) when you created the DB instance.
-
#db_parameter_groups ⇒ Array<Types::DBParameterGroupStatus>
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
andDBSecurityGroup.Status
subelements. -
#db_subnet_group ⇒ Types::DBSubnetGroup
Information about the subnet group associated with the DB instance, including the name, description, and subnets in the subnet group.
-
#db_system_id ⇒ String
The Oracle system ID (Oracle SID) for a container database (CDB).
-
#dbi_resource_id ⇒ String
The Amazon Web Services Region-unique, immutable identifier for the DB instance.
-
#dedicated_log_volume ⇒ Boolean
Indicates whether the DB instance has a dedicated log volume (DLV) enabled.
-
#deletion_protection ⇒ Boolean
Indicates whether 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
The connection endpoint for the DB instance.
-
#engine ⇒ String
The database engine used for this DB instance.
-
#engine_lifecycle_support ⇒ String
The lifecycle type for the DB instance.
-
#engine_version ⇒ String
The version of the database engine.
-
#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
Indicates whether mapping of Amazon Web Services Identity and Access Management (IAM) accounts to database accounts is enabled for the DB instance.
-
#id ⇒ String
(also: #db_instance_identifier)
-
#instance_create_time ⇒ Time
The date and time when the DB instance was created.
-
#iops ⇒ Integer
The Provisioned IOPS (I/O operations per second) value for the DB instance.
-
#is_storage_config_upgrade_available ⇒ Boolean
Indicates whether an upgrade is recommended for the storage file system configuration on the DB instance.
-
#kms_key_id ⇒ String
If
StorageEncrypted
is enabled, the Amazon Web Services KMS key identifier for the encrypted DB instance. -
#latest_restorable_time ⇒ Time
The latest time to which a database in this DB instance can be restored with point-in-time restore.
-
#license_model ⇒ String
The license model information for this DB instance.
-
#listener_endpoint ⇒ Types::Endpoint
The listener connection endpoint for SQL Server Always On.
-
#master_user_secret ⇒ Types::MasterUserSecret
The secret managed by RDS in Amazon Web Services Secrets Manager for the master user password.
-
#master_username ⇒ String
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
Indicates whether the DB instance is a Multi-AZ deployment.
-
#multi_tenant ⇒ Boolean
Specifies whether the DB instance is in the multi-tenant configuration (TRUE) or the single-tenant configuration (FALSE).
-
#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>
The list of option group memberships for this DB instance.
-
#pending_modified_values ⇒ Types::PendingModifiedValues
Information about pending changes to the DB instance.
-
#percent_progress ⇒ String
The progress of the storage optimization operation as a percentage.
-
#performance_insights_enabled ⇒ Boolean
Indicates whether Performance Insights is enabled for the DB instance.
-
#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
The daily time range during which automated backups are created if automated backups are enabled, as determined by the
BackupRetentionPeriod
. -
#preferred_maintenance_window ⇒ String
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
The order of priority in which an Aurora Replica is promoted to the primary instance after a failure of the existing primary instance.
-
#publicly_accessible ⇒ Boolean
Indicates whether the DB instance is publicly accessible.
-
#read_replica_db_cluster_identifiers ⇒ Array<String>
The identifiers of Aurora DB clusters to which the RDS DB instance is replicated as a read replica.
-
#read_replica_db_instance_identifiers ⇒ Array<String>
The identifiers of the read replicas associated with this DB instance.
-
#read_replica_source_db_cluster_identifier ⇒ String
The identifier of the source DB cluster if this DB instance is a read replica.
-
#read_replica_source_db_instance_identifier ⇒ String
The identifier of the source DB instance if this DB instance is a read replica.
-
#replica_mode ⇒ String
The open mode of a Db2 or 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
Indicates whether the DB instance is encrypted.
-
#storage_throughput ⇒ Integer
The storage throughput for the DB instance.
-
#storage_type ⇒ String
The storage type associated with the 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>
The list of Amazon EC2 VPC security groups 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
-
#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 'gems/aws-sdk-rds/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.
681 682 683 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 681 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.
666 667 668 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 666 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.
659 660 661 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 659 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.
674 675 676 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 674 def activity_stream_mode data[:activity_stream_mode] end |
#activity_stream_policy_status ⇒ String
The status of the policy state of the activity stream.
738 739 740 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 738 def activity_stream_policy_status data[:activity_stream_policy_status] end |
#activity_stream_status ⇒ String
The status of the database activity stream.
650 651 652 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 650 def activity_stream_status data[:activity_stream_status] end |
#allocated_storage ⇒ Integer
The amount of storage in gibibytes (GiB) allocated for the DB instance.
92 93 94 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 92 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.
553 554 555 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 553 def associated_roles data[:associated_roles] end |
#auto_minor_version_upgrade ⇒ Boolean
Indicates whether minor version patches are applied automatically.
For more information about automatic minor version upgrades, see Automatically upgrading the minor engine version.
193 194 195 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 193 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.
709 710 711 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 709 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
.
590 591 592 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 590 def automation_mode data[:automation_mode] end |
#availability_zone ⇒ String
The name of the Availability Zone where the DB instance is located.
138 139 140 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 138 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.
688 689 690 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 688 def aws_backup_recovery_point_arn data[:aws_backup_recovery_point_arn] end |
#backup_retention_period ⇒ Integer
The number of days for which automatic DB snapshots are retained.
112 113 114 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 112 def backup_retention_period data[:backup_retention_period] end |
#backup_target ⇒ String
The location where automated backups and manual snapshots are stored: Dedicated Local Zones, Amazon Web Services Outposts or the Amazon Web Services Region.
703 704 705 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 703 def backup_target data[:backup_target] end |
#ca_certificate_identifier ⇒ String
The identifier of the CA certificate for this DB instance.
For more information, see Using SSL/TLS to encrypt a connection to a DB instance in the Amazon RDS User Guide and Using SSL/TLS to encrypt a connection to a DB cluster in the Amazon Aurora User Guide.
385 386 387 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 385 def ca_certificate_identifier data[:ca_certificate_identifier] end |
#certificate ⇒ Certificate?
5099 5100 5101 5102 5103 5104 5105 5106 5107 5108 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 5099 def certificate if data[:ca_certificate_identifier] Certificate.new( id: data[:ca_certificate_identifier], client: @client ) else nil end end |
#certificate_details ⇒ Types::CertificateDetails
The details of the DB instance's server certificate.
744 745 746 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 744 def certificate_details data[:certificate_details] end |
#character_set_name ⇒ String
If present, specifies the name of the character set that this instance is associated with.
274 275 276 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 274 def character_set_name data[:character_set_name] end |
#client ⇒ Client
822 823 824 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 822 def client @client end |
#cluster ⇒ DBCluster?
5111 5112 5113 5114 5115 5116 5117 5118 5119 5120 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 5111 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
Indicates whether tags are copied from the DB instance to snapshots of the DB instance.
This setting doesn't apply to Amazon Aurora DB instances. 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
.
404 405 406 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 404 def data[:copy_tags_to_snapshot] end |
#create(options = {}) ⇒ DBInstance
2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 2277 def create( = {}) = .merge(db_instance_identifier: @id) resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do @client.create_db_instance() end DBInstance.new( id: resp.data.db_instance.db_instance_identifier, data: resp.data.db_instance, client: @client ) end |
#create_read_replica(options = {}) ⇒ DBInstance
2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 2987 def create_read_replica( = {}) = .merge(source_db_instance_identifier: @id) resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do @client.create_db_instance_read_replica() end DBInstance.new( id: resp.data.db_instance.db_instance_identifier, data: resp.data.db_instance, client: @client ) end |
#create_snapshot(options = {}) ⇒ DBSnapshot
3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 3037 def create_snapshot( = {}) = .merge(db_instance_identifier: @id) resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do @client.create_db_snapshot() end 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.
732 733 734 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 732 def custom_iam_instance_profile data[:custom_iam_instance_profile] end |
#customer_owned_ip_enabled ⇒ Boolean
Indicates 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.
623 624 625 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 623 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
.
844 845 846 847 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 844 def data load unless @data @data end |
#data_loaded? ⇒ Boolean
852 853 854 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 852 def data_loaded? !!@data end |
#database_insights_mode ⇒ String
The mode of Database Insights that is enabled for the instance.
478 479 480 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 478 def database_insights_mode data[:database_insights_mode] end |
#db_cluster_identifier ⇒ String
If the DB instance is a member of a DB cluster, indicates the name of the DB cluster that the DB instance is a member of.
344 345 346 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 344 def db_cluster_identifier data[:db_cluster_identifier] end |
#db_instance_arn ⇒ String
The Amazon Resource Name (ARN) for the DB instance.
445 446 447 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 445 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.
695 696 697 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 695 def db_instance_automated_backups_replications data[:db_instance_automated_backups_replications] end |
#db_instance_class ⇒ String
The name of the compute and memory capacity class of the DB instance.
40 41 42 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 40 def db_instance_class data[:db_instance_class] end |
#db_instance_port ⇒ Integer
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.
337 338 339 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 337 def db_instance_port data[:db_instance_port] end |
#db_instance_status ⇒ String
The current state of this database.
For information about DB instance statuses, see Viewing DB instance status in the Amazon RDS User Guide.
59 60 61 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 59 def db_instance_status data[:db_instance_status] end |
#db_name ⇒ String
The initial database name that you provided (if required) when you created the DB instance. This name is returned for the life of your DB instance. For an RDS for Oracle CDB instance, the name identifies the PDB rather than the CDB.
74 75 76 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 74 def db_name data[:db_name] end |
#db_parameter_groups ⇒ Array<Types::DBParameterGroupStatus>
The list of DB parameter groups applied to this DB instance.
132 133 134 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 132 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.
119 120 121 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 119 def db_security_groups data[:db_security_groups] end |
#db_subnet_group ⇒ Types::DBSubnetGroup
Information about the subnet group associated with the DB instance, including the name, description, and subnets in the subnet group.
145 146 147 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 145 def db_subnet_group data[:db_subnet_group] end |
#db_system_id ⇒ String
The Oracle system ID (Oracle SID) for a container database (CDB). The Oracle SID is also the name of the CDB. This setting is only valid for RDS Custom DB instances.
752 753 754 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 752 def db_system_id data[:db_system_id] 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.
369 370 371 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 369 def dbi_resource_id data[:dbi_resource_id] end |
#dedicated_log_volume ⇒ Boolean
Indicates whether the DB instance has a dedicated log volume (DLV) enabled.
793 794 795 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 793 def dedicated_log_volume data[:dedicated_log_volume] end |
#delete(options = {}) ⇒ DBInstance
3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 3104 def delete( = {}) = .merge(db_instance_identifier: @id) resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do @client.delete_db_instance() end DBInstance.new( id: resp.data.db_instance.db_instance_identifier, data: resp.data.db_instance, client: @client ) end |
#deletion_protection ⇒ Boolean
Indicates whether 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.
546 547 548 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 546 def deletion_protection data[:deletion_protection] end |
#domain_memberships ⇒ Array<Types::DomainMembership>
The Active Directory Domain membership records associated with the DB instance.
392 393 394 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 392 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 Monitoring Amazon RDS log files in the Amazon RDS User Guide.
527 528 529 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 527 def enabled_cloudwatch_logs_exports data[:enabled_cloudwatch_logs_exports] end |
#endpoint ⇒ Types::Endpoint
The connection endpoint for the DB instance.
creating
.
85 86 87 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 85 def endpoint data[:endpoint] end |
#engine ⇒ String
The database engine used for this DB instance.
46 47 48 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 46 def engine data[:engine] end |
#engine_lifecycle_support ⇒ String
The lifecycle type for the DB instance.
For more information, see CreateDBInstance.
815 816 817 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 815 def engine_lifecycle_support data[:engine_lifecycle_support] end |
#engine_version ⇒ String
The version of the database engine.
180 181 182 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 180 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.
419 420 421 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 419 def enhanced_monitoring_resource_arn data[:enhanced_monitoring_resource_arn] end |
#events(options = {}) ⇒ Event::Collection
5167 5168 5169 5170 5171 5172 5173 5174 5175 5176 5177 5178 5179 5180 5181 5182 5183 5184 5185 5186 5187 5188 5189 5190 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 5167 def events( = {}) batches = Enumerator.new do |y| = .merge( source_type: "db-instance", source_identifier: @id ) resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do @client.describe_events() end 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
Indicates whether mapping of Amazon Web Services Identity and Access Management (IAM) accounts to database accounts is enabled for the DB instance.
For a list of engine versions that support IAM database authentication, see IAM database authentication in the Amazon RDS User Guide and IAM database authentication in Aurora in the Amazon Aurora User Guide.
472 473 474 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 472 def iam_database_authentication_enabled data[:iam_database_authentication_enabled] end |
#id ⇒ String Also known as: db_instance_identifier
33 34 35 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 33 def id @id end |
#instance_create_time ⇒ Time
The date and time when the DB instance was created.
98 99 100 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 98 def instance_create_time data[:instance_create_time] end |
#iops ⇒ Integer
The Provisioned IOPS (I/O operations per second) value for the DB instance.
253 254 255 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 253 def iops data[:iops] end |
#is_storage_config_upgrade_available ⇒ Boolean
Indicates whether an upgrade is recommended for the storage file system configuration on the DB instance. To migrate to the preferred configuration, you can either create a blue/green deployment, or create a read replica from the DB instance. For more information, see Upgrading the storage file system for a DB instance.
807 808 809 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 807 def is_storage_config_upgrade_available data[:is_storage_config_upgrade_available] end |
#kms_key_id ⇒ String
If StorageEncrypted
is enabled, 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.
360 361 362 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 360 def kms_key_id data[:kms_key_id] end |
#latest_restorable_time ⇒ Time
The latest time to which a database in this DB instance can be restored with point-in-time restore.
167 168 169 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 167 def latest_restorable_time data[:latest_restorable_time] end |
#license_model ⇒ String
The license model information for this DB instance. This setting doesn't apply to Amazon Aurora or RDS Custom DB instances.
246 247 248 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 246 def license_model data[:license_model] end |
#listener_endpoint ⇒ Types::Endpoint
The listener connection endpoint for SQL Server Always On.
559 560 561 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 559 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
832 833 834 835 836 837 838 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 832 def load resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do @client.describe_db_instances(db_instance_identifier: @id) end @data = resp.db_instances[0] self end |
#log_files(options = {}) ⇒ DBLogFile::Collection
5218 5219 5220 5221 5222 5223 5224 5225 5226 5227 5228 5229 5230 5231 5232 5233 5234 5235 5236 5237 5238 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 5218 def log_files( = {}) batches = Enumerator.new do |y| = .merge(db_instance_identifier: @id) resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do @client.describe_db_log_files() end 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_user_secret ⇒ Types::MasterUserSecret
The secret managed by RDS in Amazon Web Services Secrets Manager for the master user password.
For more information, see Password management with Amazon Web Services Secrets Manager in the Amazon RDS User Guide.
766 767 768 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 766 def master_user_secret data[:master_user_secret] end |
#master_username ⇒ String
The master username for the DB instance.
65 66 67 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 65 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.
566 567 568 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 566 def max_allocated_storage data[:max_allocated_storage] end |
#modify(options = {}) ⇒ DBInstance
4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 4288 def modify( = {}) = .merge(db_instance_identifier: @id) resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do @client.modify_db_instance() end 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.
411 412 413 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 411 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.
426 427 428 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 426 def monitoring_role_arn data[:monitoring_role_arn] end |
#multi_az ⇒ Boolean
Indicates whether the DB instance is a Multi-AZ deployment. This setting doesn't apply to RDS Custom DB instances.
174 175 176 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 174 def multi_az data[:multi_az] end |
#multi_tenant ⇒ Boolean
Specifies whether the DB instance is in the multi-tenant configuration (TRUE) or the single-tenant configuration (FALSE).
786 787 788 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 786 def multi_tenant data[:multi_tenant] 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.
282 283 284 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 282 def nchar_character_set_name data[:nchar_character_set_name] end |
#network_type ⇒ String
The network type of the DB instance.
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.
Valid Values: IPV4 | DUAL
644 645 646 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 644 def network_type data[:network_type] end |
#option_group_memberships ⇒ Array<Types::OptionGroupMembership>
The list of option group memberships for this DB instance.
267 268 269 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 267 def option_group_memberships data[:option_group_memberships] end |
#option_groups ⇒ OptionGroup::Collection
5241 5242 5243 5244 5245 5246 5247 5248 5249 5250 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 5241 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
5253 5254 5255 5256 5257 5258 5259 5260 5261 5262 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 5253 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
5292 5293 5294 5295 5296 5297 5298 5299 5300 5301 5302 5303 5304 5305 5306 5307 5308 5309 5310 5311 5312 5313 5314 5315 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 5292 def pending_maintenance_actions( = {}) batches = Enumerator.new do |y| = Aws::Util.deep_merge(, filters: [{ name: "db-instance-id", values: [@id] }]) resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do @client.describe_pending_maintenance_actions() end 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
Information about pending changes to the DB instance. This information is returned only when there are pending changes. Specific changes are identified by subelements.
160 161 162 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 160 def pending_modified_values data[:pending_modified_values] end |
#percent_progress ⇒ String
The progress of the storage optimization operation as a percentage.
779 780 781 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 779 def percent_progress data[:percent_progress] end |
#performance_insights_enabled ⇒ Boolean
Indicates whether Performance Insights is enabled for the DB instance.
484 485 486 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 484 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.
494 495 496 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 494 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.
Valid Values:
7
month * 31, where month is a number of months from 1-23. Examples:
93
(3 months * 31),341
(11 months * 31),589
(19 months * 31)731
Default: 7
days
512 513 514 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 512 def performance_insights_retention_period data[:performance_insights_retention_period] end |
#preferred_backup_window ⇒ String
The daily time range during which automated backups are created if
automated backups are enabled, as determined by the
BackupRetentionPeriod
.
106 107 108 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 106 def preferred_backup_window data[:preferred_backup_window] end |
#preferred_maintenance_window ⇒ String
The weekly time range during which system maintenance can occur, in Universal Coordinated Time (UTC).
152 153 154 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 152 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.
534 535 536 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 534 def processor_features data[:processor_features] end |
#promote(options = {}) ⇒ DBInstance
4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 4343 def promote( = {}) = .merge(db_instance_identifier: @id) resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do @client.promote_read_replica() end DBInstance.new( id: resp.data.db_instance.db_instance_identifier, data: resp.data.db_instance, client: @client ) end |
#promotion_tier ⇒ Integer
The order of priority 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.
439 440 441 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 439 def promotion_tier data[:promotion_tier] end |
#publicly_accessible ⇒ Boolean
Indicates whether the DB instance is publicly accessible.
When the DB instance is publicly accessible and you connect from outside of the DB instance's virtual private cloud (VPC), its Domain Name System (DNS) endpoint resolves to the public IP address. When you connect from within the same VPC as the DB instance, the endpoint resolves to the private IP address. 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.
309 310 311 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 309 def publicly_accessible data[:publicly_accessible] end |
#read_replica_db_cluster_identifiers ⇒ Array<String>
The 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.
220 221 222 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 220 def read_replica_db_cluster_identifiers data[:read_replica_db_cluster_identifiers] end |
#read_replica_db_instance_identifiers ⇒ Array<String>
The identifiers of the read replicas associated with this DB instance.
206 207 208 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 206 def read_replica_db_instance_identifiers data[:read_replica_db_instance_identifiers] end |
#read_replica_source_db_cluster_identifier ⇒ String
The identifier of the source DB cluster if this DB instance is a read replica.
773 774 775 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 773 def read_replica_source_db_cluster_identifier data[:read_replica_source_db_cluster_identifier] end |
#read_replica_source_db_instance_identifier ⇒ String
The identifier of the source DB instance if this DB instance is a read replica.
200 201 202 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 200 def read_replica_source_db_instance_identifier data[:read_replica_source_db_instance_identifier] end |
#read_replicas ⇒ DBInstance::Collection
5318 5319 5320 5321 5322 5323 5324 5325 5326 5327 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 5318 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
4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 4367 def reboot( = {}) = .merge(db_instance_identifier: @id) resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do @client.reboot_db_instance() end 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 a Db2 or an Oracle read replica. The default is
open-read-only
. For more information, see Working with replicas for
Amazon RDS for Db2 and Working with read replicas for Amazon RDS
for Oracle in the Amazon RDS User Guide.
239 240 241 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 239 def replica_mode data[:replica_mode] end |
#restore(options = {}) ⇒ DBInstance
5040 5041 5042 5043 5044 5045 5046 5047 5048 5049 5050 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 5040 def restore( = {}) = .merge(source_db_instance_identifier: @id) resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do @client.restore_db_instance_to_point_in_time() end 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.
598 599 600 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 598 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.
289 290 291 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 289 def secondary_availability_zone data[:secondary_availability_zone] end |
#security_groups ⇒ DBSecurityGroup::Collection
5330 5331 5332 5333 5334 5335 5336 5337 5338 5339 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 5330 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
5444 5445 5446 5447 5448 5449 5450 5451 5452 5453 5454 5455 5456 5457 5458 5459 5460 5461 5462 5463 5464 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 5444 def snapshots( = {}) batches = Enumerator.new do |y| = .merge(db_instance_identifier: @id) resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do @client.describe_db_snapshots() end 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?
5467 5468 5469 5470 5471 5472 5473 5474 5475 5476 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 5467 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 DB instance isn't a read replica, the value is blank.
316 317 318 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 316 def status_infos data[:status_infos] end |
#storage_encrypted ⇒ Boolean
Indicates whether the DB instance is encrypted.
350 351 352 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 350 def storage_encrypted data[:storage_encrypted] end |
#storage_throughput ⇒ Integer
The storage throughput for the DB instance.
This setting applies only to the gp3
storage type.
261 262 263 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 261 def storage_throughput data[:storage_throughput] end |
#storage_type ⇒ String
The storage type associated with the DB instance.
322 323 324 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 322 def storage_type data[:storage_type] end |
#subnet_group ⇒ DBSubnetGroup?
5479 5480 5481 5482 5483 5484 5485 5486 5487 5488 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 5479 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
5062 5063 5064 5065 5066 5067 5068 5069 5070 5071 5072 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 5062 def subscribe_to( = {}) = .merge(source_identifier: @id) resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do @client.add_source_identifier_to_subscription() end 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 or Tagging Amazon Aurora and Amazon RDS resources in the Amazon Aurora User Guide.
581 582 583 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 581 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.
329 330 331 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 329 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 RDS for Db2 and
RDS for SQL Server DB instances that were created with a time zone
specified.
454 455 456 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 454 def timezone data[:timezone] end |
#unsubscribe_from(options = {}) ⇒ EventSubscription
5084 5085 5086 5087 5088 5089 5090 5091 5092 5093 5094 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 5084 def unsubscribe_from( = {}) = .merge(source_identifier: @id) resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do @client.remove_source_identifier_from_subscription() end EventSubscription.new( name: resp.data.event_subscription.cust_subscription_id, data: resp.data.event_subscription, client: @client ) end |
#vpc_security_groups ⇒ Array<Types::VpcSecurityGroupMembership>
The list of Amazon EC2 VPC security groups that the DB instance belongs to.
126 127 128 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 126 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
936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb', line 936 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::Plugins::UserAgent.metric('RESOURCE_MODEL') do Aws::Waiters::Waiter.new().wait({}) end end |