Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,8 @@ No modules.
| <a name="output_cluster_hostname"></a> [cluster\_hostname](#output\_cluster\_hostname) | The hostname of the Redshift cluster |
| <a name="output_cluster_id"></a> [cluster\_id](#output\_cluster\_id) | The Redshift cluster ID |
| <a name="output_cluster_identifier"></a> [cluster\_identifier](#output\_cluster\_identifier) | The Redshift cluster identifier |
| <a name="output_cluster_master_password"></a> [cluster\_master\_password](#output\_cluster\_master\_password) | The Redshift cluster master password |
| <a name="output_cluster_master_username"></a> [cluster\_master\_username](#output\_cluster\_master\_username) | The Redshift cluster master username |
| <a name="output_cluster_namespace_arn"></a> [cluster\_namespace\_arn](#output\_cluster\_namespace\_arn) | The namespace Amazon Resource Name (ARN) of the cluster |
| <a name="output_cluster_node_type"></a> [cluster\_node\_type](#output\_cluster\_node\_type) | The type of nodes in the cluster |
| <a name="output_cluster_nodes"></a> [cluster\_nodes](#output\_cluster\_nodes) | The nodes in the cluster. Each node is a map of the following attributes: `node_role`, `private_ip_address`, and `public_ip_address` |
Expand Down
2 changes: 2 additions & 0 deletions examples/complete/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ No inputs.
| <a name="output_cluster_hostname"></a> [cluster\_hostname](#output\_cluster\_hostname) | The hostname of the Redshift cluster |
| <a name="output_cluster_id"></a> [cluster\_id](#output\_cluster\_id) | The Redshift cluster ID |
| <a name="output_cluster_identifier"></a> [cluster\_identifier](#output\_cluster\_identifier) | The Redshift cluster identifier |
| <a name="output_cluster_master_password"></a> [cluster\_master\_password](#output\_cluster\_master\_password) | The Redshift cluster master password |
| <a name="output_cluster_master_username"></a> [cluster\_master\_username](#output\_cluster\_master\_username) | The Redshift cluster master username |
| <a name="output_cluster_namespace_arn"></a> [cluster\_namespace\_arn](#output\_cluster\_namespace\_arn) | The namespace Amazon Resource Name (ARN) of the cluster |
| <a name="output_cluster_node_type"></a> [cluster\_node\_type](#output\_cluster\_node\_type) | The type of nodes in the cluster |
| <a name="output_cluster_nodes"></a> [cluster\_nodes](#output\_cluster\_nodes) | The nodes in the cluster. Each node is a map of the following attributes: `node_role`, `private_ip_address`, and `public_ip_address` |
Expand Down
10 changes: 10 additions & 0 deletions examples/complete/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,16 @@ output "cluster_namespace_arn" {
value = module.redshift.cluster_namespace_arn
}

output "cluster_master_password" {
description = "The Redshift cluster master password"
value = module.redshift.cluster_master_password
}

output "cluster_master_username" {
description = "The Redshift cluster master username"
value = module.redshift.cluster_master_username
}

################################################################################
# Parameter Group
################################################################################
Expand Down
13 changes: 10 additions & 3 deletions main.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
data "aws_partition" "current" {}
data "aws_partition" "current" {
count = var.create && var.create_scheduled_action_iam_role ? 1 : 0
}

locals {
dns_suffix = try(data.aws_partition.current[0].dns_suffix, "")
}

resource "random_password" "master_password" {
count = var.create && var.create_random_password ? 1 : 0
Expand Down Expand Up @@ -105,8 +111,9 @@ resource "aws_redshift_parameter_group" "this" {

dynamic "parameter" {
for_each = var.parameter_group_parameters

content {
name = parameter.value.name
name = try(parameter.value.name, parameter.key)
value = parameter.value.value
}
}
Expand Down Expand Up @@ -210,7 +217,7 @@ data "aws_iam_policy_document" "scheduled_action_assume" {

principals {
type = "Service"
identifiers = ["scheduler.redshift.${data.aws_partition.current.dns_suffix}"]
identifiers = ["scheduler.redshift.${local.dns_suffix}"]
}
}
}
Expand Down
12 changes: 12 additions & 0 deletions outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,18 @@ output "cluster_namespace_arn" {
value = try(aws_redshift_cluster.this[0].cluster_namespace_arn, null)
}

output "cluster_master_password" {
description = "The Redshift cluster master password"
value = try(aws_redshift_cluster.this[0].master_password, null)
sensitive = true
}

output "cluster_master_username" {
description = "The Redshift cluster master username"
value = try(aws_redshift_cluster.this[0].master_username, null)
sensitive = true
}

################################################################################
# Parameter Group
################################################################################
Expand Down
2 changes: 1 addition & 1 deletion wrappers/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
output "wrapper" {
description = "Map of outputs of a wrapper."
value = module.wrapper
# sensitive = false # No sensitive module output found
sensitive = true # At least one sensitive module output (cluster_master_password) found (requires Terraform 0.14+)
}