Documentation

rds_instance_facts - obtain facts about one or more RDS instances

New in version 2.6.

Synopsis

  • obtain facts about one or more RDS instances

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
bool

(added in 1.5)
    Choices:
  • no
  • yes ←
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 or EC2_URL, AWS_ACCESS_KEY_ID or AWS_ACCESS_KEY or EC2_ACCESS_KEY, AWS_SECRET_ACCESS_KEY or AWS_SECRET_KEY or EC2_SECRET_KEY, AWS_SECURITY_TOKEN or EC2_SECURITY_TOKEN, AWS_REGION or EC2_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 or EC2_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

  backup_retention_period
int
always
Days for which backups are retained

Sample:
7
  availability_zone
string
always
Availability Zone in which the database resides

Sample:
us-west-2b
  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_instance_status
string
always
Status of the database instance

Sample:
available
  domain_memberships
list
always
List of domain memberships

  engine_version
string
always
Database engine version

Sample:
9.5.10
  db_instance_class
string
always
Instance class of the database instance

Sample:
db.t2.small
  pending_modified_values
complex
always
Modified values pending application

  storage_type
string
always
Storage type of the Database instance

Sample:
gp2
  db_security_groups
list
always
List of security groups used by the database instance

  master_username
string
always
Database master username

Sample:
dbadmin
  auto_minor_version_upgrade
bool
always
Whether minor version upgrades happen automatically

Sample:
True
  performance_insights_enabled
bool
always
Whether performance insights are enabled

  db_instance_identifier
string
always
Database instance identifier

Sample:
helloworld-rds
  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
  monitoring_interval
int
always
Interval, in seconds, between points when Enhanced Monitoring metrics are collected for the DB instance

  option_group_memberships
complex
always
List of option groups

    status
string
always
Status of option group

Sample:
in-sync
    option_group_name
string
always
Option group name

Sample:
default:postgres-9-5
  allocated_storage
int
always
Gigabytes of storage allocated to the database

Sample:
10
  db_instance_port
int
always
Port used by the database instance

  preferred_backup_window
string
always
Preferred backup window

Sample:
04:00-05:00
  engine
string
always
Database engine

Sample:
postgres
  kms_key_id
string
always
KMS Key ID

Sample:
arn:aws:kms:us-west-2:111111111111:key/abcd1234-0000-abcd-1111-0123456789ab
  tags
complex
always
Tags used by the database instance

  db_subnet_group
complex
always
list of subnet groups

    db_subnet_group_name
string
always
Name of the database subnet group

Sample:
my-subnet-group
    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_status
string
always
Subnet status

Sample:
Active
      subnet_identifier
string
always
Subnet ID

Sample:
subnet-abcd1234
    db_subnet_group_description
string
always
Description of the DB subnet group

Sample:
My database subnet group
    subnet_group_status
string
always
Subnet group status

Sample:
Complete
    vpc_id
string
always
VPC id of the subnet group

Sample:
vpc-abcd1234
  ca_certificate_identifier
string
always
ID for the CA certificate

Sample:
rds-ca-2015
  db_instance_arn
string
always
ARN of the database instance

Sample:
arn:aws:rds:us-west-2:111111111111:db:helloworld-rds
  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
  db_name
string
always
Name of the database

Sample:
management
  license_model
string
always
License model

Sample:
postgresql-license
  storage_encrypted
bool
always
Whether the storage is encrypted

Sample:
True
  instance_create_time
string
always
Date and time the instance was created

Sample:
2017-10-10T04:00:07.434000+00:00
  dbi_resource_id
string
always
AWS Region-unique, immutable identifier for the DB instance

Sample:
db-AAAAAAAAAAAAAAAAAAAAAAAAAA
  copy_tags_to_snapshot
bool
always
Whether DB tags should be copied to the snapshot

  endpoint
complex
always
Database endpoint

    hosted_zone_id
string
always
Route53 hosted zone ID

Sample:
Z1PABCD0000000
    port
int
always
Database endpoint port

Sample:
5432
    address
string
always
Database endpoint address

Sample:
helloworld-rds.ctrqpe3so1sf.us-west-2.rds.amazonaws.com
  read_replica_db_instance_identifiers
list
always
List of database instance read replicas

  iam_database_authentication_enabled
bool
always
Whether database authentication through IAM is enabled

  multi_az
bool
always
Whether Multi-AZ is on

  publicly_accessible
bool
always
Whether the DB is publicly accessible

  preferred_maintenance_window
string
always
Preferred maintenance window

Sample:
mon:05:00-mon:05:30


Status

This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.

Maintenance

This module is flagged as community which means that it is maintained by the Ansible Community. See Module Maintenance & Support for more info.

For a list of other modules that are also maintained by the Ansible Community, see here.

Author

  • 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.