Use this data source to get information about an RDS instance
data "aws_db_instance" "database" {
db_instance_identifier = "my-test-database"
}
This data source supports the following arguments:
db_instance_identifier
- (Optional) Name of the RDS instance.tags
- (Optional) Map of tags, each pair of which must exactly match a pair on the desired instance.This data source exports the following attributes in addition to the arguments above:
address
- Hostname of the RDS instance. See also endpoint
and port
.allocated_storage
- Allocated storage size specified in gigabytes.auto_minor_version_upgrade
- Indicates that minor version patches are applied automatically.availability_zone
- Name of the Availability Zone the DB instance is located in.backup_retention_period
- Specifies the number of days for which automatic DB snapshots are retained.db_cluster_identifier
- 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
- ARN for the DB instance.db_instance_class
- Contains the name of the compute and memory capacity class of the DB instance.db_name
- 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.db_parameter_groups
- Provides the list of DB parameter groups applied to this DB instance.db_subnet_group
- Name of the subnet group associated with the DB instance.db_instance_port
- Port that the DB instance listens on.enabled_cloudwatch_logs_exports
- List of log types to export to cloudwatch.endpoint
- Connection endpoint in address:port
format.engine
- Provides the name of the database engine to be used for this DB instance.engine_version
- Database engine version.hosted_zone_id
- Canonical hosted zone ID of the DB instance (to be used in a Route 53 Alias record).iops
- Provisioned IOPS (I/O operations per second) value.kms_key_id
- If StorageEncrypted is true, the KMS key identifier for the encrypted DB instance.license_model
- License model information for this DB instance.master_username
- Contains the master username for the DB instance.master_user_secret
- Provides the master user secret. Only available when manage_master_user_password
is set to true. Documented below.max_allocated_storage
- The upper limit to which Amazon RDS can automatically scale the storage of the DB instance.monitoring_interval
- Interval, in seconds, between points when Enhanced Monitoring metrics are collected for the DB instance.monitoring_role_arn
- ARN for the IAM role that permits RDS to send Enhanced Monitoring metrics to CloudWatch Logs.multi_az
- If the DB instance is a Multi-AZ deployment.network_type
- Network type of the DB instance.option_group_memberships
- Provides the list of option group memberships for this DB instance.port
- Database endpoint port, primarily used by an Aurora DB cluster. For a conventional RDS DB instance, the db_instance_port
is typically the preferred choice.preferred_backup_window
- Specifies the daily time range during which automated backups are created.preferred_maintenance_window
- Specifies the weekly time range during which system maintenance can occur in UTC.publicly_accessible
- Accessibility options for the DB instance.resource_id
- RDS Resource ID of this instance.storage_encrypted
- Whether the DB instance is encrypted.storage_throughput
- Storage throughput value for the DB instance.storage_type
- Storage type associated with DB instance.timezone
- Time zone of the DB instance.vpc_security_groups
- Provides a list of VPC security group elements that the DB instance belongs to.replicate_source_db
- Identifier of the source DB that this is a replica of.ca_cert_identifier
- Identifier of the CA certificate for the DB instance.The master_user_secret
configuration block supports the following attributes:
kms_key_id
- The Amazon Web Services KMS key identifier that is used to encrypt the secret.secret_arn
- The Amazon Resource Name (ARN) of the secret.secret_status
- The status of the secret. Valid Values: creating
| active
| rotating
| impaired
.