rds_instance_facts – obtain facts about one or more RDS instances¶
New in version 2.6.
Requirements¶
The below requirements are needed on the host that executes this module.
- boto
- boto3
- python >= 2.6
- python >= 2.7
Parameters¶
Parameter | Choices/Defaults | Comments |
---|---|---|
aws_access_key
-
|
AWS access key. If not set then the value of the AWS_ACCESS_KEY_ID, AWS_ACCESS_KEY or EC2_ACCESS_KEY environment variable is used.
aliases: ec2_access_key, access_key |
|
aws_secret_key
-
|
AWS secret key. If not set then the value of the AWS_SECRET_ACCESS_KEY, AWS_SECRET_KEY, or EC2_SECRET_KEY environment variable is used.
aliases: ec2_secret_key, secret_key |
|
db_instance_identifier
-
|
The RDS instance's unique identifier.
aliases: id |
|
ec2_url
-
|
Url to use to connect to EC2 or your Eucalyptus cloud (by default the module will use EC2 endpoints). Ignored for modules where region is required. Must be specified for all other modules if region is not used. If not set then the value of the EC2_URL environment variable, if any, is used.
|
|
filters
-
|
A filter that specifies one or more DB instances to describe. See https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_DescribeDBInstances.html
|
|
profile
-
added in 1.6 |
Uses a boto profile. Only works with boto >= 2.24.0.
|
|
region
-
|
The AWS region to use. If not specified then the value of the AWS_REGION or EC2_REGION environment variable, if any, is used. See http://docs.aws.amazon.com/general/latest/gr/rande.html#ec2_region
aliases: aws_region, ec2_region |
|
security_token
-
added in 1.6 |
AWS STS security token. If not set then the value of the AWS_SECURITY_TOKEN or EC2_SECURITY_TOKEN environment variable is used.
aliases: access_token |
|
validate_certs
boolean
added in 1.5 |
|
When set to "no", SSL certificates will not be validated for boto versions >= 2.6.0.
|
Notes¶
Note
- If parameters are not set within the module, the following environment variables can be used in decreasing order of precedence
AWS_URL
orEC2_URL
,AWS_ACCESS_KEY_ID
orAWS_ACCESS_KEY
orEC2_ACCESS_KEY
,AWS_SECRET_ACCESS_KEY
orAWS_SECRET_KEY
orEC2_SECRET_KEY
,AWS_SECURITY_TOKEN
orEC2_SECURITY_TOKEN
,AWS_REGION
orEC2_REGION
- Ansible uses the boto configuration file (typically ~/.boto) if no credentials are provided. See https://boto.readthedocs.io/en/latest/boto_config_tut.html
AWS_REGION
orEC2_REGION
can be typically be used to specify the AWS region, when required, but this can also be configured in the boto config file
Examples¶
# Get facts about an instance
- rds_instance_facts:
db_instance_identifier: new-database
register: new_database_facts
# Get all RDS instances
- rds_instance_facts:
Return Values¶
Common return values are documented here, the following are the fields unique to this module:
Key | Returned | Description | ||||
---|---|---|---|---|---|---|
instances
complex
|
always |
List of RDS instances
|
||||
allocated_storage
integer
|
always |
Gigabytes of storage allocated to the database
Sample:
10
|
||||
auto_minor_version_upgrade
boolean
|
always |
Whether minor version upgrades happen automatically
Sample:
True
|
||||
availability_zone
string
|
always |
Availability Zone in which the database resides
Sample:
us-west-2b
|
||||
backup_retention_period
integer
|
always |
Days for which backups are retained
Sample:
7
|
||||
ca_certificate_identifier
string
|
always |
ID for the CA certificate
Sample:
rds-ca-2015
|
||||
copy_tags_to_snapshot
boolean
|
always |
Whether DB tags should be copied to the snapshot
|
||||
db_instance_arn
string
|
always |
ARN of the database instance
Sample:
arn:aws:rds:us-west-2:111111111111:db:helloworld-rds
|
||||
db_instance_class
string
|
always |
Instance class of the database instance
Sample:
db.t2.small
|
||||
db_instance_identifier
string
|
always |
Database instance identifier
Sample:
helloworld-rds
|
||||
db_instance_port
integer
|
always |
Port used by the database instance
|
||||
db_instance_status
string
|
always |
Status of the database instance
Sample:
available
|
||||
db_name
string
|
always |
Name of the database
Sample:
management
|
||||
db_parameter_groups
complex
|
always |
List of database parameter groups
|
||||
db_parameter_group_name
string
|
always |
Name of the database parameter group
Sample:
psql-pg-helloworld
|
||||
parameter_apply_status
string
|
always |
Whether the parameter group has been applied
Sample:
in-sync
|
||||
db_security_groups
list
|
always |
List of security groups used by the database instance
|
||||
db_subnet_group
complex
|
always |
list of subnet groups
|
||||
db_subnet_group_description
string
|
always |
Description of the DB subnet group
Sample:
My database subnet group
|
||||
db_subnet_group_name
string
|
always |
Name of the database subnet group
Sample:
my-subnet-group
|
||||
subnet_group_status
string
|
always |
Subnet group status
Sample:
Complete
|
||||
subnets
complex
|
always |
List of subnets in the subnet group
|
||||
subnet_availability_zone
complex
|
always |
Availability zone of the subnet
|
||||
name
string
|
always |
Name of the availability zone
Sample:
us-west-2c
|
||||
subnet_identifier
string
|
always |
Subnet ID
Sample:
subnet-abcd1234
|
||||
subnet_status
string
|
always |
Subnet status
Sample:
Active
|
||||
vpc_id
string
|
always |
VPC id of the subnet group
Sample:
vpc-abcd1234
|
||||
dbi_resource_id
string
|
always |
AWS Region-unique, immutable identifier for the DB instance
Sample:
db-AAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
domain_memberships
list
|
always |
List of domain memberships
|
||||
endpoint
complex
|
always |
Database endpoint
|
||||
address
string
|
always |
Database endpoint address
Sample:
helloworld-rds.ctrqpe3so1sf.us-west-2.rds.amazonaws.com
|
||||
hosted_zone_id
string
|
always |
Route53 hosted zone ID
Sample:
Z1PABCD0000000
|
||||
port
integer
|
always |
Database endpoint port
Sample:
5432
|
||||
engine
string
|
always |
Database engine
Sample:
postgres
|
||||
engine_version
string
|
always |
Database engine version
Sample:
9.5.10
|
||||
iam_database_authentication_enabled
boolean
|
always |
Whether database authentication through IAM is enabled
|
||||
instance_create_time
string
|
always |
Date and time the instance was created
Sample:
2017-10-10T04:00:07.434000+00:00
|
||||
kms_key_id
string
|
always |
KMS Key ID
Sample:
arn:aws:kms:us-west-2:111111111111:key/abcd1234-0000-abcd-1111-0123456789ab
|
||||
latest_restorable_time
string
|
always |
Latest time to which a database can be restored with point-in-time restore
Sample:
2018-05-17T00:03:56+00:00
|
||||
license_model
string
|
always |
License model
Sample:
postgresql-license
|
||||
master_username
string
|
always |
Database master username
Sample:
dbadmin
|
||||
monitoring_interval
integer
|
always |
Interval, in seconds, between points when Enhanced Monitoring metrics are collected for the DB instance
|
||||
multi_az
boolean
|
always |
Whether Multi-AZ is on
|
||||
option_group_memberships
complex
|
always |
List of option groups
|
||||
option_group_name
string
|
always |
Option group name
Sample:
default:postgres-9-5
|
||||
status
string
|
always |
Status of option group
Sample:
in-sync
|
||||
pending_modified_values
complex
|
always |
Modified values pending application
|
||||
performance_insights_enabled
boolean
|
always |
Whether performance insights are enabled
|
||||
preferred_backup_window
string
|
always |
Preferred backup window
Sample:
04:00-05:00
|
||||
preferred_maintenance_window
string
|
always |
Preferred maintenance window
Sample:
mon:05:00-mon:05:30
|
||||
publicly_accessible
boolean
|
always |
Whether the DB is publicly accessible
|
||||
read_replica_db_instance_identifiers
list
|
always |
List of database instance read replicas
|
||||
storage_encrypted
boolean
|
always |
Whether the storage is encrypted
Sample:
True
|
||||
storage_type
string
|
always |
Storage type of the Database instance
Sample:
gp2
|
||||
tags
complex
|
always |
Tags used by the database instance
|
||||
vpc_security_groups
complex
|
always |
List of VPC security groups
|
||||
status
string
|
always |
Status of the VPC security group
Sample:
active
|
||||
vpc_security_group_id
string
|
always |
VPC Security Group ID
Sample:
sg-abcd1234
|
Status¶
- This module is not guaranteed to have a backwards compatible interface. [preview]
- This module is maintained by the Ansible Community. [community]
Authors¶
- Will Thames (@willthames)
- Michael De La Rue (@mikedlr)
Hint
If you notice any issues in this documentation you can edit this document to improve it.