Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

redshift: add associated iam roles possiblity #1961

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions plugins/modules/redshift.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@
- Availability zone in which to launch cluster.
aliases: ['zone', 'aws_zone']
type: str
associated_iam_roles:
description:
- A list of Identity and Access Management (IAM) roles.
type: list
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add version_added: 8.1.0

number_of_nodes:
description:
- Number of nodes.
Expand Down Expand Up @@ -220,6 +224,11 @@
returned: success
type: str
sample: "us-east-1b"
associated_iam_roles:
description: Amazon IAM roles associated with the cluster.
returned: success
type: list
sample: "arn:aws:iam::123456789012:role/AWSIAMRoleForRedShift"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add version_added: 8.1.0

maintenance_window:
description: Time frame when maintenance/upgrade are done.
returned: success
Expand Down Expand Up @@ -325,13 +334,15 @@ def _collect_facts(resource):
facts["url"] = None
facts["port"] = None
facts["availability_zone"] = None
facts["associated_iam_roles"] = None
facts["tags"] = {}

if resource["ClusterStatus"] != "creating":
facts["create_time"] = resource["ClusterCreateTime"]
facts["url"] = resource["Endpoint"]["Address"]
facts["port"] = resource["Endpoint"]["Port"]
facts["availability_zone"] = resource["AvailabilityZone"]
facts["associated_iam_roles"] = resource["IamRoles"]
facts["tags"] = boto3_tag_list_to_ansible_dict(resource["Tags"])

return facts
Expand Down Expand Up @@ -404,6 +415,7 @@ def create_cluster(module, redshift):
"vpc_security_group_ids",
"cluster_subnet_group_name",
"availability_zone",
"associated_iam_roles",
"preferred_maintenance_window",
"cluster_parameter_group_name",
"automated_snapshot_retention_period",
Expand Down Expand Up @@ -545,6 +557,7 @@ def modify_cluster(module, redshift):
"vpc_security_group_ids",
"cluster_subnet_group_name",
"availability_zone",
"associated_iam_roles",
"preferred_maintenance_window",
"cluster_parameter_group_name",
"automated_snapshot_retention_period",
Expand Down Expand Up @@ -633,6 +646,7 @@ def main():
final_cluster_snapshot_identifier=dict(aliases=["final_snapshot_id"], required=False),
cluster_subnet_group_name=dict(aliases=["subnet"]),
availability_zone=dict(aliases=["aws_zone", "zone"]),
associated_iam_roles=dict(type="list", elements="str"),
preferred_maintenance_window=dict(aliases=["maintance_window", "maint_window"]),
cluster_parameter_group_name=dict(aliases=["param_group_name"]),
automated_snapshot_retention_period=dict(aliases=["retention_period"], type="int"),
Expand Down