Skip to content

Commit b4c2141

Browse files
feat: Add multi_az support and add cluster_namespace_arn (#93)
Co-authored-by: Anton Babenko <anton@antonbabenko.com>
1 parent 054f25e commit b4c2141

File tree

8 files changed

+27
-7
lines changed

8 files changed

+27
-7
lines changed

README.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -179,14 +179,14 @@ module "redshift" {
179179
| Name | Version |
180180
|------|---------|
181181
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
182-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.24 |
182+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.35 |
183183
| <a name="requirement_random"></a> [random](#requirement\_random) | >= 3.0 |
184184

185185
## Providers
186186

187187
| Name | Version |
188188
|------|---------|
189-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.24 |
189+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.35 |
190190
| <a name="provider_random"></a> [random](#provider\_random) | >= 3.0 |
191191

192192
## Modules
@@ -260,6 +260,7 @@ No modules.
260260
| <a name="input_master_password"></a> [master\_password](#input\_master\_password) | Password for the master DB user. (Required unless a `snapshot_identifier` is provided). Must contain at least 8 chars, one uppercase letter, one lowercase letter, and one number | `string` | `null` | no |
261261
| <a name="input_master_password_secret_kms_key_id"></a> [master\_password\_secret\_kms\_key\_id](#input\_master\_password\_secret\_kms\_key\_id) | ID of the KMS key used to encrypt the cluster admin credentials secret | `string` | `null` | no |
262262
| <a name="input_master_username"></a> [master\_username](#input\_master\_username) | Username for the master DB user (Required unless a `snapshot_identifier` is provided). Defaults to `awsuser` | `string` | `"awsuser"` | no |
263+
| <a name="input_multi_az"></a> [multi\_az](#input\_multi\_az) | Specifies if the Redshift cluster is multi-AZ | `bool` | `null` | no |
263264
| <a name="input_node_type"></a> [node\_type](#input\_node\_type) | The node type to be provisioned for the cluster | `string` | `""` | no |
264265
| <a name="input_number_of_nodes"></a> [number\_of\_nodes](#input\_number\_of\_nodes) | Number of nodes in the cluster. Defaults to 1. Note: values greater than 1 will trigger `cluster_type` to switch to `multi-node` | `number` | `1` | no |
265266
| <a name="input_owner_account"></a> [owner\_account](#input\_owner\_account) | The AWS customer account used to create or copy the snapshot. Required if you are restoring a snapshot you do not own, optional if you own the snapshot | `string` | `null` | no |
@@ -305,6 +306,7 @@ No modules.
305306
| <a name="output_cluster_hostname"></a> [cluster\_hostname](#output\_cluster\_hostname) | The hostname of the Redshift cluster |
306307
| <a name="output_cluster_id"></a> [cluster\_id](#output\_cluster\_id) | The Redshift cluster ID |
307308
| <a name="output_cluster_identifier"></a> [cluster\_identifier](#output\_cluster\_identifier) | The Redshift cluster identifier |
309+
| <a name="output_cluster_namespace_arn"></a> [cluster\_namespace\_arn](#output\_cluster\_namespace\_arn) | The namespace Amazon Resource Name (ARN) of the cluster |
308310
| <a name="output_cluster_node_type"></a> [cluster\_node\_type](#output\_cluster\_node\_type) | The type of nodes in the cluster |
309311
| <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` |
310312
| <a name="output_cluster_parameter_group_name"></a> [cluster\_parameter\_group\_name](#output\_cluster\_parameter\_group\_name) | The name of the parameter group to be associated with this cluster |

examples/complete/README.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ Note that this example may create resources which cost money. Run `terraform des
2424
| Name | Version |
2525
|------|---------|
2626
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
27-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.24 |
27+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.35 |
2828

2929
## Providers
3030

3131
| Name | Version |
3232
|------|---------|
33-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.24 |
34-
| <a name="provider_aws.us_east_1"></a> [aws.us\_east\_1](#provider\_aws.us\_east\_1) | >= 5.24 |
33+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.35 |
34+
| <a name="provider_aws.us_east_1"></a> [aws.us\_east\_1](#provider\_aws.us\_east\_1) | >= 5.35 |
3535

3636
## Modules
3737

@@ -74,6 +74,7 @@ No inputs.
7474
| <a name="output_cluster_hostname"></a> [cluster\_hostname](#output\_cluster\_hostname) | The hostname of the Redshift cluster |
7575
| <a name="output_cluster_id"></a> [cluster\_id](#output\_cluster\_id) | The Redshift cluster ID |
7676
| <a name="output_cluster_identifier"></a> [cluster\_identifier](#output\_cluster\_identifier) | The Redshift cluster identifier |
77+
| <a name="output_cluster_namespace_arn"></a> [cluster\_namespace\_arn](#output\_cluster\_namespace\_arn) | The namespace Amazon Resource Name (ARN) of the cluster |
7778
| <a name="output_cluster_node_type"></a> [cluster\_node\_type](#output\_cluster\_node\_type) | The type of nodes in the cluster |
7879
| <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` |
7980
| <a name="output_cluster_parameter_group_name"></a> [cluster\_parameter\_group\_name](#output\_cluster\_parameter\_group\_name) | The name of the parameter group to be associated with this cluster |

examples/complete/outputs.tf

+5
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,11 @@ output "cluster_nodes" {
107107
value = module.redshift.cluster_nodes
108108
}
109109

110+
output "cluster_namespace_arn" {
111+
description = "The namespace Amazon Resource Name (ARN) of the cluster"
112+
value = module.redshift.cluster_namespace_arn
113+
}
114+
110115
################################################################################
111116
# Parameter Group
112117
################################################################################

examples/complete/versions.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ terraform {
44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 5.24"
7+
version = ">= 5.35"
88
}
99
}
1010
}

main.tf

+1
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ resource "aws_redshift_cluster" "this" {
6464
master_password = var.snapshot_identifier == null && !var.manage_master_password ? local.master_password : null
6565
master_password_secret_kms_key_id = var.master_password_secret_kms_key_id
6666
master_username = var.master_username
67+
multi_az = var.multi_az
6768
node_type = var.node_type
6869
number_of_nodes = var.number_of_nodes
6970
owner_account = var.owner_account

outputs.tf

+5
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,11 @@ output "cluster_nodes" {
111111
value = try(aws_redshift_cluster.this[0].cluster_nodes, {})
112112
}
113113

114+
output "cluster_namespace_arn" {
115+
description = "The namespace Amazon Resource Name (ARN) of the cluster"
116+
value = try(aws_redshift_cluster.this[0].cluster_namespace_arn, null)
117+
}
118+
114119
################################################################################
115120
# Parameter Group
116121
################################################################################

variables.tf

+6
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,12 @@ variable "master_password" {
143143
sensitive = true
144144
}
145145

146+
variable "multi_az" {
147+
description = "Specifies if the Redshift cluster is multi-AZ"
148+
type = bool
149+
default = null
150+
}
151+
146152
variable "create_random_password" {
147153
description = "Determines whether to create random password for cluster `master_password`"
148154
type = bool

versions.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ terraform {
44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 5.24"
7+
version = ">= 5.35"
88
}
99

1010
random = {

0 commit comments

Comments
 (0)