Documentation

redshift_facts - Gather facts about Redshift cluster(s)

New in version 2.4.

Synopsis

  • Gather facts about Redshift cluster(s)

Requirements

The below requirements are needed on the host that executes this module.

  • boto
  • boto3
  • python >= 2.6

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
cluster_identifier
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
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)
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
tags
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)
    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 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

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, the following are the fields unique to this module:

Key
Returned
Description
allow_version_upgrade
boolean
success
A Boolean value that, if true, indicates that major version upgrades will be applied automatically to the cluster during the maintenance window.
</div>
<br/>
<div style=”font-size: smaller”><b>Sample:</b></div>
<div style=”font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;”>true|false</div>

</div>

</td>

</tr>
<tr class=”return-value-column”>
<td>
<div class=”outer-elbow-container”>
<div class=”elbow-key”>

<b>automated_snapshot_retention_period</b> <br/><div style=”font-size: small; color: red”>int</div>

</div>

</div>

</td> <td><div class=”cell-border”>success</div></td> <td>

<div class=”cell-border”>
<div>The number of days that automatic cluster snapshots are retained.</div>
<br/>
<div style=”font-size: smaller”><b>Sample:</b></div>
<div style=”font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;”>1</div>

</div>

</td>

</tr>
<tr class=”return-value-column”>
<td>
<div class=”outer-elbow-container”>
<div class=”elbow-key”>

<b>availibility_zone</b> <br/><div style=”font-size: small; color: red”>string</div>

</div>

</div>

</td> <td><div class=”cell-border”>success</div></td> <td>

<div class=”cell-border”>
<div>The name of the Availability Zone in which the cluster is located.</div>
<br/>
<div style=”font-size: smaller”><b>Sample:</b></div>
<div style=”font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;”>us-east-1b</div>

</div>

</td>

</tr>
<tr class=”return-value-column”>
<td>
<div class=”outer-elbow-container”>
<div class=”elbow-key”>

<b>cluster_create_time</b> <br/><div style=”font-size: small; color: red”>string</div>

</div>

</div>

</td> <td><div class=”cell-border”>success</div></td> <td>

<div class=”cell-border”>
<div>The date and time that the cluster was created.</div>
<br/>
<div style=”font-size: smaller”><b>Sample:</b></div>
<div style=”font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;”>2016-05-10T08:33:16.629000+00:00</div>

</div>

</td>

</tr>
<tr class=”return-value-column”>
<td>
<div class=”outer-elbow-container”>
<div class=”elbow-key”>

<b>cluster_identifier</b> <br/><div style=”font-size: small; color: red”>string</div>

</div>

</div>

</td> <td><div class=”cell-border”>success</div></td> <td>

<div class=”cell-border”>
<div>Unique key to identify the cluster.</div>
<br/>
<div style=”font-size: smaller”><b>Sample:</b></div>
<div style=”font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;”>redshift-identifier</div>

</div>

</td>

</tr>
<tr class=”return-value-column”>
<td>
<div class=”outer-elbow-container”>
<div class=”elbow-key”>

<b>cluster_nodes</b> <br/><div style=”font-size: small; color: red”>list</div>

</div>

</div>

</td> <td><div class=”cell-border”>success</div></td> <td>

<div class=”cell-border”>
<div>The nodes in the cluster.</div>
<br/>
<div style=”font-size: smaller”><b>Sample:</b></div>
<div style=”font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;”>[{‘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’}]</div>

</div>

</td>

</tr>
<tr class=”return-value-column”>
<td>
<div class=”outer-elbow-container”>
<div class=”elbow-key”>

<b>cluster_paramater_groups</b> <br/><div style=”font-size: small; color: red”>list</div>

</div>

</div>

</td> <td><div class=”cell-border”>success</div></td> <td>

<div class=”cell-border”>
<div>The list of cluster parameters that are associated with this cluster.</div>
<br/>
<div style=”font-size: smaller”><b>Sample:</b></div>
<div style=”font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;”>[{‘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’}]</div>

</div>

</td>

</tr>
<tr class=”return-value-column”>
<td>
<div class=”outer-elbow-container”>
<div class=”elbow-key”>

<b>cluster_public_keys</b> <br/><div style=”font-size: small; color: red”>string</div>

</div>

</div>

</td> <td><div class=”cell-border”>success</div></td> <td>

<div class=”cell-border”>
<div>The public key for the cluster.</div>
<br/>
<div style=”font-size: smaller”><b>Sample:</b></div>
<div style=”font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;”>ssh-rsa anjigfam Amazon-Redshift </div>

</div>

</td>

</tr>
<tr class=”return-value-column”>
<td>
<div class=”outer-elbow-container”>
<div class=”elbow-key”>

<b>cluster_revision_number</b> <br/><div style=”font-size: small; color: red”>string</div>

</div>

</div>

</td> <td><div class=”cell-border”>success</div></td> <td>

<div class=”cell-border”>
<div>The specific revision number of the database in the cluster.</div>
<br/>
<div style=”font-size: smaller”><b>Sample:</b></div>
<div style=”font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;”>1231</div>

</div>

</td>

</tr>
<tr class=”return-value-column”>
<td>
<div class=”outer-elbow-container”>
<div class=”elbow-key”>

<b>cluster_security_groups</b> <br/><div style=”font-size: small; color: red”>list</div>

</div>

</div>

</td> <td><div class=”cell-border”>success</div></td> <td>

<div class=”cell-border”>
<div>A list of cluster security groups that are associated with the cluster.</div>

<br/>

</div>

</td>

</tr>
<tr class=”return-value-column”>
<td>
<div class=”outer-elbow-container”>
<div class=”elbow-key”>

<b>cluster_snapshot_copy_status</b> <br/><div style=”font-size: small; color: red”>dict</div>

</div>

</div>

</td> <td><div class=”cell-border”>success</div></td> <td>

<div class=”cell-border”>
<div>A value that returns the destination region and retention period that are configured for cross-region snapshot copy.</div>

<br/>

</div>

</td>

</tr>
<tr class=”return-value-column”>
<td>
<div class=”outer-elbow-container”>
<div class=”elbow-key”>

<b>cluster_status</b> <br/><div style=”font-size: small; color: red”>string</div>

</div>

</div>

</td> <td><div class=”cell-border”>success</div></td> <td>

<div class=”cell-border”>
<div>Current state of the cluster.</div>
<br/>
<div style=”font-size: smaller”><b>Sample:</b></div>
<div style=”font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;”>available</div>

</div>

</td>

</tr>
<tr class=”return-value-column”>
<td>
<div class=”outer-elbow-container”>
<div class=”elbow-key”>

<b>cluster_subnet_group_name</b> <br/><div style=”font-size: small; color: red”>string</div>

</div>

</div>

</td> <td><div class=”cell-border”>success</div></td> <td>

<div class=”cell-border”>
<div>The name of the subnet group that is associated with the cluster.</div>
<br/>
<div style=”font-size: smaller”><b>Sample:</b></div>
<div style=”font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;”>redshift-subnet</div>

</div>

</td>

</tr>
<tr class=”return-value-column”>
<td>
<div class=”outer-elbow-container”>
<div class=”elbow-key”>

<b>cluster_version</b> <br/><div style=”font-size: small; color: red”>string</div>

</div>

</div>

</td> <td><div class=”cell-border”>success</div></td> <td>

<div class=”cell-border”>
<div>The version ID of the Amazon Redshift engine that is running on the cluster.</div>
<br/>
<div style=”font-size: smaller”><b>Sample:</b></div>
<div style=”font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;”>1.0</div>

</div>

</td>

</tr>
<tr class=”return-value-column”>
<td>
<div class=”outer-elbow-container”>
<div class=”elbow-key”>

<b>db_name</b> <br/><div style=”font-size: small; color: red”>string</div>

</div>

</div>

</td> <td><div class=”cell-border”>success</div></td> <td>

<div class=”cell-border”>
<div>The name of the initial database that was created when the cluster was created.</div>
<br/>
<div style=”font-size: smaller”><b>Sample:</b></div>
<div style=”font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;”>dev</div>

</div>

</td>

</tr>
<tr class=”return-value-column”>
<td>
<div class=”outer-elbow-container”>
<div class=”elbow-key”>

<b>elastic_ip_status</b> <br/><div style=”font-size: small; color: red”>dict</div>

</div>

</div>

</td> <td><div class=”cell-border”>success</div></td> <td>

<div class=”cell-border”>
<div>The status of the elastic IP (EIP) address.</div>

<br/>

</div>

</td>

</tr>
<tr class=”return-value-column”>
<td>
<div class=”outer-elbow-container”>
<div class=”elbow-key”>

<b>encrypted</b> <br/><div style=”font-size: small; color: red”>boolean</div>

</div>

</div>

</td> <td><div class=”cell-border”>success</div></td> <td>

<div class=”cell-border”>
<div>Boolean value that, if true , indicates that data in the cluster is encrypted at rest.</div>
<br/>
<div style=”font-size: smaller”><b>Sample:</b></div>
<div style=”font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;”>true|false</div>

</div>

</td>

</tr>
<tr class=”return-value-column”>
<td>
<div class=”outer-elbow-container”>
<div class=”elbow-key”>

<b>endpoint</b> <br/><div style=”font-size: small; color: red”>string</div>

</div>

</div>

</td> <td><div class=”cell-border”>success</div></td> <td>

<div class=”cell-border”>
<div>The connection endpoint.</div>
<br/>
<div style=”font-size: smaller”><b>Sample:</b></div>
<div style=”font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;”>{‘port’: 5439, ‘address’: ‘cluster-ds2.ocmugla0rf.us-east-1.redshift.amazonaws.com’}</div>

</div>

</td>

</tr>
<tr class=”return-value-column”>
<td>
<div class=”outer-elbow-container”>
<div class=”elbow-key”>

<b>enhanced_vpc_routing</b> <br/><div style=”font-size: small; color: red”>boolean</div>

</div>

</div>

</td> <td><div class=”cell-border”>success</div></td> <td>

<div class=”cell-border”>
<div>An option that specifies whether to create the cluster with enhanced VPC routing enabled.</div>
<br/>
<div style=”font-size: smaller”><b>Sample:</b></div>
<div style=”font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;”>true|false</div>

</div>

</td>

</tr>
<tr class=”return-value-column”>
<td>
<div class=”outer-elbow-container”>
<div class=”elbow-key”>

<b>hsm_status</b> <br/><div style=”font-size: small; color: red”>dict</div>

</div>

</div>

</td> <td><div class=”cell-border”>success</div></td> <td>

<div class=”cell-border”>
<div>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.
</div>
<br/>

</div>

</td>

</tr>
<tr class=”return-value-column”>
<td>
<div class=”outer-elbow-container”>
<div class=”elbow-key”>

<b>iam_roles</b> <br/><div style=”font-size: small; color: red”>list</div>

</div>

</div>

</td> <td><div class=”cell-border”>success</div></td> <td>

<div class=”cell-border”>
<div>List of IAM roles attached to the cluster.</div>

<br/>

</div>

</td>

</tr>
<tr class=”return-value-column”>
<td>
<div class=”outer-elbow-container”>
<div class=”elbow-key”>

<b>kms_key_id</b> <br/><div style=”font-size: small; color: red”>string</div>

</div>

</div>

</td> <td><div class=”cell-border”>success</div></td> <td>

<div class=”cell-border”>
<div>The AWS Key Management Service (AWS KMS) key ID of the encryption key used to encrypt data in the cluster.</div>

<br/>

</div>

</td>

</tr>
<tr class=”return-value-column”>
<td>
<div class=”outer-elbow-container”>
<div class=”elbow-key”>

<b>master_username</b> <br/><div style=”font-size: small; color: red”>string</div>

</div>

</div>

</td> <td><div class=”cell-border”>success</div></td> <td>

<div class=”cell-border”>
<div>The master user name for the cluster.</div>
<br/>
<div style=”font-size: smaller”><b>Sample:</b></div>
<div style=”font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;”>admin</div>

</div>

</td>

</tr>
<tr class=”return-value-column”>
<td>
<div class=”outer-elbow-container”>
<div class=”elbow-key”>

<b>modify_status</b> <br/><div style=”font-size: small; color: red”>string</div>

</div>

</div>

</td> <td><div class=”cell-border”>optional</div></td> <td>

<div class=”cell-border”>
<div>The status of a modify operation.</div>

<br/>

</div>

</td>

</tr>
<tr class=”return-value-column”>
<td>
<div class=”outer-elbow-container”>
<div class=”elbow-key”>

<b>node_type</b> <br/><div style=”font-size: small; color: red”>string</div>

</div>

</div>

</td> <td><div class=”cell-border”>success</div></td> <td>

<div class=”cell-border”>
<div>The node type for nodes in the cluster.</div>
<br/>
<div style=”font-size: smaller”><b>Sample:</b></div>
<div style=”font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;”>ds2.xlarge</div>

</div>

</td>

</tr>
<tr class=”return-value-column”>
<td>
<div class=”outer-elbow-container”>
<div class=”elbow-key”>

<b>number_of_nodes</b> <br/><div style=”font-size: small; color: red”>int</div>

</div>

</div>

</td> <td><div class=”cell-border”>success</div></td> <td>

<div class=”cell-border”>
<div>The number of compute nodes in the cluster.</div>
<br/>
<div style=”font-size: smaller”><b>Sample:</b></div>
<div style=”font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;”>12</div>

</div>

</td>

</tr>
<tr class=”return-value-column”>
<td>
<div class=”outer-elbow-container”>
<div class=”elbow-key”>

<b>pending_modified_values</b> <br/><div style=”font-size: small; color: red”>dict</div>

</div>

</div>

</td> <td><div class=”cell-border”>success</div></td> <td>

<div class=”cell-border”>
<div>A value that, if present, indicates that changes to the cluster are pending.</div>

<br/>

</div>

</td>

</tr>
<tr class=”return-value-column”>
<td>
<div class=”outer-elbow-container”>
<div class=”elbow-key”>

<b>preferred_maintenance_window</b> <br/><div style=”font-size: small; color: red”>string</div>

</div>

</div>

</td> <td><div class=”cell-border”>success</div></td> <td>

<div class=”cell-border”>
<div>The weekly time range, in Universal Coordinated Time (UTC), during which system maintenance can occur.</div>
<br/>
<div style=”font-size: smaller”><b>Sample:</b></div>
<div style=”font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;”>tue:07:30-tue:08:00</div>

</div>

</td>

</tr>
<tr class=”return-value-column”>
<td>
<div class=”outer-elbow-container”>
<div class=”elbow-key”>

<b>publicly_accessible</b> <br/><div style=”font-size: small; color: red”>boolean</div>

</div>

</div>

</td> <td><div class=”cell-border”>success</div></td> <td>

<div class=”cell-border”>
<div>A Boolean value that, if true , indicates that the cluster can be accessed from a public network.</div>
<br/>
<div style=”font-size: smaller”><b>Sample:</b></div>
<div style=”font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;”>true|false</div>

</div>

</td>

</tr>
<tr class=”return-value-column”>
<td>
<div class=”outer-elbow-container”>
<div class=”elbow-key”>

<b>restore_status</b> <br/><div style=”font-size: small; color: red”>dict</div>

</div>

</div>

</td> <td><div class=”cell-border”>success</div></td> <td>

<div class=”cell-border”>
<div>A value that describes the status of a cluster restore action.</div>

<br/>

</div>

</td>

</tr>
<tr class=”return-value-column”>
<td>
<div class=”outer-elbow-container”>
<div class=”elbow-key”>

<b>tags</b> <br/><div style=”font-size: small; color: red”>list</div>

</div>

</div>

</td> <td><div class=”cell-border”>success</div></td> <td>

<div class=”cell-border”>
<div>The list of tags for the cluster.</div>

<br/>

</div>

</td>

</tr>
<tr class=”return-value-column”>
<td>
<div class=”outer-elbow-container”>
<div class=”elbow-key”>

<b>vpc_id</b> <br/><div style=”font-size: small; color: red”>string</div>

</div>

</div>

</td> <td><div class=”cell-border”>success</div></td> <td>

<div class=”cell-border”>
<div>The identifier of the VPC the cluster is in, if the cluster is in a VPC.</div>
<br/>
<div style=”font-size: smaller”><b>Sample:</b></div>
<div style=”font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;”>vpc-1234567</div>

</div>

</td>

</tr>
<tr class=”return-value-column”>
<td>
<div class=”outer-elbow-container”>
<div class=”elbow-key”>

<b>vpc_security_groups</b> <br/><div style=”font-size: small; color: red”>list</div>

</div>

</div>

</td> <td><div class=”cell-border”>success</div></td> <td>

<div class=”cell-border”>
<div>A list of VPC security groups the are associated with the cluster.</div>
<br/>
<div style=”font-size: smaller”><b>Sample:</b></div>
<div style=”font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;”>[{‘status’: ‘active’, ‘vpc_security_group_id’: ‘sg-12cghhg’}]</div>

</div>

</td>

</tr>
</table>

<br/><br/>

Status

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

Author

  • Jens Carl (@j-carl)

Hint

If you notice any issues in this documentation you can edit this document to improve it.


Last updated on Apr 12, 2018.
Copyright © 2018 Red Hat, Inc.