W3cubDocs

/Ansible 2.10

community.aws.rds_instance_facts – obtain information about one or more RDS instances

Note

This plugin is part of the community.aws collection.

To install it use: ansible-galaxy collection install community.aws.

To use it in a playbook, specify: community.aws.rds_instance_facts.

New in version 1.0.0: of community.aws

Synopsis

  • Obtain information about one or more RDS instances.
  • This module was called rds_instance_facts before Ansible 2.9. The usage did not change.

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
string
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.
If profile is set this parameter is ignored.
Passing the aws_access_key and profile options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.

aliases: ec2_access_key, access_key
aws_ca_bundle
path
The location of a CA Bundle to use when validating SSL certificates.
Only used for boto3 based modules.
Note: The CA Bundle is read 'module' side and may need to be explicitly copied from the controller if not run locally.
aws_config
dictionary
A dictionary to modify the botocore configuration.
Only the 'user_agent' key is used for boto modules. See http://boto.cloudhackers.com/en/latest/boto_config_tut.html#boto for more boto configuration.
aws_secret_key
string
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.
If profile is set this parameter is ignored.
Passing the aws_secret_key and profile options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.

aliases: ec2_secret_key, secret_key
db_instance_identifier
string
The RDS instance's unique identifier.

aliases: id
debug_botocore_endpoint_logs
boolean
    Choices:
  • no
  • yes
Use a botocore.endpoint logger to parse the unique (rather than total) "resource:action" API calls made during a task, outputing the set to the resource_actions key in the task results. Use the aws_resource_action callback to output to total list made during a playbook. The ANSIBLE_DEBUG_BOTOCORE_LOGS environment variable may also be used.
ec2_url
string
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.

aliases: aws_endpoint_url, endpoint_url
filters
dictionary
A filter that specifies one or more DB instances to describe. See https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_DescribeDBInstances.html
profile
string
Uses a boto profile. Only works with boto >= 2.24.0.
Using profile will override aws_access_key, aws_secret_key and security_token and support for passing them at the same time as profile has been deprecated.
aws_access_key, aws_secret_key and security_token will be made mutually exclusive with profile after 2022-06-01.

aliases: aws_profile
region
string
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
string
AWS STS security token. If not set then the value of the AWS_SECURITY_TOKEN or EC2_SECURITY_TOKEN environment variable is used.
If profile is set this parameter is ignored.
Passing the security_token and profile options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.

aliases: aws_security_token, access_token
validate_certs
boolean
    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_PROFILE or AWS_DEFAULT_PROFILE, 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, AWS_CA_BUNDLE
  • 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

- name: Get information about an instance
  community.aws.rds_instance_info:
    db_instance_identifier: new-database
  register: new_database_info

- name: Get all RDS instances
  community.aws.rds_instance_info:

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 / elements=string
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 / elements=string
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 / elements=string
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


Authors

  • Will Thames (@willthames)
  • Michael De La Rue (@mikedlr)

© 2012–2018 Michael DeHaan
© 2018–2019 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.10/collections/community/aws/rds_instance_facts_module.html