Documentation

redshift_facts - Gather facts about Redshift cluster(s)

New in version 2.4.

Synopsis

  • Gather facts about Redshift cluster(s)

Options

parameter required default choices comments
aws_access_key
no
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
no
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
cluster_identifier
no
The prefix of cluster identifier of the Redshift cluster you are searching for.
This is a regular expression match with implicit '^'. Append '$' for a complete match.

aliases: name, identifier
ec2_url
no
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.
profile
(added in 1.6)
no
Uses a boto profile. Only works with boto >= 2.24.0.
region
no
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)
no
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
tags
no
A dictionary/hash of tags in the format { tag1_name: 'tag1_value', tag2_name: 'tag2_value' } to match against the security group(s) you are searching for.
validate_certs
(added in 1.5)
no yes
  • yes
  • no
When set to "no", SSL certificates will not be validated for boto versions >= 2.6.0.

Examples

# Note: These examples do net set authentication details, see the AWS guide for details.

# Find all clusters
- redshift_facts:
  register: redshift

# Find cluster(s) with matching tags
- redshift_facts:
    tags:
      env: prd
      stack: monitoring
  register: redshift_tags

# Find cluster(s) with matching name/prefix and tags
- redshift_facts:
    tags:
      env: dev
      stack: web
    name: user-
  register: redshift_web

# Fail if no cluster(s) is/are found
- redshift_facts:
    tags:
      env: stg
      stack: db
  register: redshift_user
  failed_when: "{{ redshift_user.results | length == 0 }}"

Return Values

Common return values are documented here Return Values, the following are the fields unique to this module:

name description returned type sample
restore_status
A value that describes the status of a cluster restore action.
success dict {}
encrypted
Boolean value that, if true , indicates that data in the cluster is encrypted at rest.
success boolean true|false
kms_key_id
The AWS Key Management Service (AWS KMS) key ID of the encryption key used to encrypt data in the cluster.
success string
availibility_zone
The name of the Availability Zone in which the cluster is located.
success string us-east-1b
pending_modified_values
A value that, if present, indicates that changes to the cluster are pending.
success dict {}
node_type
The node type for nodes in the cluster.
success string ds2.xlarge
publicly_accessible
A Boolean value that, if true , indicates that the cluster can be accessed from a public network.
success boolean true|false
master_username
The master user name for the cluster.
success string admin
cluster_revision_number
The specific revision number of the database in the cluster.
success string 1231
modify_status
The status of a modify operation.
optional string
cluster_create_time
The date and time that the cluster was created.
success string 2016-05-10T08:33:16.629000+00:00
vpc_security_groups
A list of VPC security groups the are associated with the cluster.
success list [{'status': 'active', 'vpc_security_group_id': 'sg-12cghhg'}]
allow_version_upgrade
A Boolean value that, if true, indicates that major version upgrades will be applied automatically to the cluster during the maintenance window.
success boolean true|false
cluster_status
Current state of the cluster.
success string available
cluster_paramater_groups
The list of cluster parameters that are associated with this cluster.
success list [{'parameter_group_name': 'tuba', 'cluster_parameter_status_list': [{'parameter_apply_status': 'in-sync', 'parameter_name': 'statement_timeout'}, {'parameter_apply_status': 'in-sync', 'parameter_name': 'require_ssl'}], 'parameter_apply_status': 'in-sync'}]
cluster_snapshot_copy_status
A value that returns the destination region and retention period that are configured for cross-region snapshot copy.
success dict {}
tags
The list of tags for the cluster.
success list []
number_of_nodes
The number of compute nodes in the cluster.
success int 12
cluster_public_keys
The public key for the cluster.
success string ssh-rsa anjigfam Amazon-Redshift
db_name
The name of the initial database that was created when the cluster was created.
success string dev
vpc_id
The identifier of the VPC the cluster is in, if the cluster is in a VPC.
success string vpc-1234567
iam_roles
List of IAM roles attached to the cluster.
success list []
cluster_subnet_group_name
The name of the subnet group that is associated with the cluster.
success string redshift-subnet
elastic_ip_status
The status of the elastic IP (EIP) address.
success dict {}
endpoint
The connection endpoint.
success string {'port': 5439, 'address': 'cluster-ds2.ocmugla0rf.us-east-1.redshift.amazonaws.com'}
cluster_identifier
Unique key to identify the cluster.
success string redshift-identifier
cluster_security_groups
A list of cluster security groups that are associated with the cluster.
success list []
hsm_status
A value that reports whether the Amazon Redshift cluster has finished applying any hardware security module (HSM) settings changes specified in a modify cluster command.
success dict {}
enhanced_vpc_routing
An option that specifies whether to create the cluster with enhanced VPC routing enabled.
success boolean true|false
cluster_nodes
The nodes in the cluster.
success list [{'private_ip_address': '10.0.0.1', 'public_ip_address': 'x.x.x.x', 'node_role': 'LEADER'}, {'private_ip_address': '10.0.0.3', 'public_ip_address': 'x.x.x.x', 'node_role': 'COMPUTE-1'}]
automated_snapshot_retention_period
The number of days that automatic cluster snapshots are retained.
success int 1
cluster_version
The version ID of the Amazon Redshift engine that is running on the cluster.
success string 1.0
preferred_maintenance_window
The weekly time range, in Universal Coordinated Time (UTC), during which system maintenance can occur.
success string tue:07:30-tue:08:00


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 http://boto.readthedocs.org/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

Status

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

For help in developing on modules, should you be so inclined, please read Community Information & Contributing, Testing Ansible and Developing Modules.