Skip to content

Commit 2694431

Browse files
authored
feat!: Upgrade AWS provider and min required Terraform version to 6.21 and 1.11 respectively (#110)
* feat!: Upgrade AWS provider and min required Terraform version to `6.21` and `1.11` respectively * fix: Remove deprecated argument `aqua_configuration_status` * feat: Add variable optional attribute type definitions * feat: Add support for `region` resource level argument * feat: Add support for creating a security group by default for the cluster * feat: Support creating multiple VPC access endpoints * feat: Consolidate variables under top level variables * feat: Replace `master_password` with write only argument equivalent `master_password_wo` * chore: Updates from testing and validating upgrade guide * fix: Correct timeouts * fix: Remove empty logging list, add default password management to replace prior default password generation
1 parent b802a13 commit 2694431

File tree

13 files changed

+822
-464
lines changed

13 files changed

+822
-464
lines changed

README.md

Lines changed: 75 additions & 68 deletions
Large diffs are not rendered by default.

docs/UPGRADE-6.0.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ module "redshift" {
115115
+ snapshot_copy_grant_name = "ex-complete-us-east-1"
116116
}
117117
```
118+
118119
The `aws_redshift_logging` can be applied or imported. If setting the `log_destination_type`, an apply following an import will be required to clear the remaining diff.
119120
The `aws_redshift_snapshot_copy` resource requires importing if an existing snapshot_copy configuration exists.
120121

docs/UPGRADE-7.0.md

Lines changed: 207 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,207 @@
1+
# Upgrade from v6.x to v7.x
2+
3+
Please consult the `examples` directory for reference example configurations. If you find a bug, please open an issue with supporting configuration to reproduce.
4+
5+
## List of backwards incompatible changes
6+
7+
- Terraform `v1.11` is now minimum supported version to support write-only (`wo_*`) attributes.
8+
- AWS provider `v6.18` is now minimum supported version
9+
- The ability for the module to create a random password has been removed in order to ensure passwords are not stored in plain text within the state file. Users must now provide their own password via the `master_password_wo` variable.
10+
- `master_password` is no longer supported and only the write-only equivalent is supported (`master_password_wo` and `master_password_wo_version`)
11+
- `manage_master_password` default changed from `false` to `true` to ensure password rotation is managed by default.
12+
- The variable(s) used to create access endpoints has changed from creating a single endpoint to n-number of endpoints
13+
14+
## Additional changes
15+
16+
### Added
17+
18+
- Support for `region` argument to specify the AWS region for the resources created if different from the provider region.
19+
- Support for creating a security group used by the cluster
20+
21+
### Modified
22+
23+
- Variable definitions now contain detailed `object` types in place of the previously used any type.
24+
- Default value for `parameter_group_family` changed from `redshift-1.0` to `redshift-2.0`
25+
- `manage_master_password` default changed from `false` to `true`
26+
27+
### Removed
28+
29+
- Support for generating random passwords has been removed.
30+
31+
### Variable and output changes
32+
33+
1. Removed variables:
34+
35+
- `create_random_password` removed along with support for generating a random password
36+
- `random_password_length` removed along with support for generating a random password
37+
- `aqua_configuration_status` argument was deprecated
38+
- The variables for endpoint access have been nested under a single, top-level `endpoint_access` variable:
39+
- `create_endpoint_access` removed - set `endpoint_access` to `null` or omit to disable
40+
- `endpoint_name` -> `endpoint_access.name`
41+
- `endpoint_resource_owner` -> `endpoint_access.resource_owner`
42+
- `endpoint_subnet_group_name` -> `endpoint_access.subnet_group_name`
43+
- `endpoint_vpc_security_group_ids` -> `endpoint_access.vpc_security_group_ids`
44+
- The variables for snapshot schedule have been nested under a single, top-level `snapshot_schedule` variable:
45+
- `create_snapshot_schedule` removed - set `snapshot_schedule` to `null` or omit to disable
46+
- `snapshot_schedule_identifier` -> `snapshot_schedule.identifier`
47+
- `use_snapshot_identifier_prefix` -> `snapshot_schedule.use_prefix`
48+
- `snapshot_schedule_description` -> `snapshot_schedule.description`
49+
- `snapshot_schedule_definitions` -> `snapshot_schedule.definitions`
50+
- `snapshot_schedule_force_destroy` -> `snapshot_schedule.force_destroy`
51+
52+
2. Renamed variables:
53+
54+
- `master_password` -> `master_password_wo`
55+
56+
3. Added variables:
57+
58+
- `region`
59+
- `create_security_group`
60+
- `security_group_name`
61+
- `security_group_use_name_prefix`
62+
- `security_group_description`
63+
- `vpc_id`
64+
- `security_group_ingress_rules`
65+
- `security_group_egress_rules`
66+
- `master_password_wo_version`
67+
68+
4. Removed outputs:
69+
70+
- `endpoint_access_address` -> see `endpoint_access` output
71+
- `endpoint_access_port` -> see `endpoint_access` output
72+
- `endpoint_access_id` -> see `endpoint_access` output
73+
- `endpoint_access_vpc_endpoint` -> see `endpoint_access` output
74+
75+
5. Renamed outputs:
76+
77+
- None
78+
79+
6. Added outputs:
80+
81+
- None
82+
83+
## Upgrade Migration
84+
85+
### Before v6.x Example
86+
87+
```hcl
88+
module "redshift" {
89+
source = "terraform-aws-modules/redshift/aws"
90+
version = "~> 6.0"
91+
92+
# Only the affected attributes are shown
93+
94+
# Snapshot schedule
95+
create_snapshot_schedule = true
96+
snapshot_schedule_identifier = "example"
97+
use_snapshot_identifier_prefix = true
98+
snapshot_schedule_description = "Example snapshot schedule"
99+
snapshot_schedule_definitions = ["rate(12 hours)"]
100+
snapshot_schedule_force_destroy = true
101+
102+
# Scheduled actions
103+
create_scheduled_action_iam_role = true
104+
scheduled_actions = {
105+
pause = {
106+
name = "example-pause"
107+
description = "Pause cluster every night"
108+
schedule = "cron(0 22 * * ? *)"
109+
pause_cluster = true
110+
}
111+
resize = {
112+
name = "example-resize"
113+
description = "Resize cluster (demo only)"
114+
schedule = "cron(00 13 * * ? *)"
115+
resize_cluster = {
116+
node_type = "ds2.xlarge"
117+
number_of_nodes = 5
118+
}
119+
}
120+
resume = {
121+
name = "example-resume"
122+
description = "Resume cluster every morning"
123+
schedule = "cron(0 12 * * ? *)"
124+
resume_cluster = true
125+
}
126+
}
127+
128+
# Endpoint access - only available when using the ra3.x type
129+
create_endpoint_access = true
130+
endpoint_name = "example"
131+
endpoint_subnet_group_name = "example"
132+
endpoint_vpc_security_group_ids = ["sg-12345678"]
133+
}
134+
```
135+
136+
### After v7.x Example
137+
138+
```hcl
139+
module "redshift" {
140+
source = "terraform-aws-modules/redshift/aws"
141+
version = "~> 7.0"
142+
143+
# Only the affected attributes are shown
144+
145+
# Security group
146+
vpc_id = "vpc-1234556abcdef"
147+
148+
# Snapshot schedule
149+
snapshot_schedule = {
150+
identifier = "example"
151+
use_prefix = true
152+
description = "Example snapshot schedule"
153+
definitions = ["rate(12 hours)"]
154+
force_destroy = true
155+
}
156+
157+
# Scheduled actions
158+
create_scheduled_action_iam_role = true
159+
scheduled_actions = {
160+
pause = {
161+
name = "example-pause"
162+
description = "Pause cluster every night"
163+
schedule = "cron(0 22 * * ? *)"
164+
target_action = {
165+
pause_cluster = true
166+
}
167+
}
168+
resize = {
169+
name = "example-resize"
170+
description = "Resize cluster (demo only)"
171+
schedule = "cron(00 13 * * ? *)"
172+
target_action = {
173+
resize_cluster = {
174+
node_type = "ds2.xlarge"
175+
number_of_nodes = 5
176+
}
177+
}
178+
}
179+
resume = {
180+
name = "example-resume"
181+
description = "Resume cluster every morning"
182+
schedule = "cron(0 12 * * ? *)"
183+
target_action = {
184+
resume_cluster = true
185+
}
186+
}
187+
}
188+
189+
# Endpoint access - only available when using the ra3.x type
190+
endpoint_access = {
191+
example = {
192+
name = "example"
193+
subnet_group_name = "example"
194+
vpc_security_group_ids = ["sg-12345678"]
195+
}
196+
}
197+
198+
# Maintains backward compatibility, as needed
199+
parameter_group_family = "redshift-1.0"
200+
}
201+
```
202+
203+
### State Move Commands
204+
205+
```sh
206+
terraform state mv 'module.redshift.aws_redshift_endpoint_access.this[0]' 'module.redshift.aws_redshift_endpoint_access.this["example"]'
207+
```

examples/complete/README.md

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,14 @@ Note that this example may create resources which cost money. Run `terraform des
2323

2424
| Name | Version |
2525
|------|---------|
26-
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.3 |
27-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.45 |
26+
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.11 |
27+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 6.21 |
2828

2929
## Providers
3030

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

3635
## Modules
3736

@@ -40,9 +39,9 @@ Note that this example may create resources which cost money. Run `terraform des
4039
| <a name="module_default"></a> [default](#module\_default) | ../../ | n/a |
4140
| <a name="module_disabled"></a> [disabled](#module\_disabled) | ../../ | n/a |
4241
| <a name="module_redshift"></a> [redshift](#module\_redshift) | ../../ | n/a |
43-
| <a name="module_s3_logs"></a> [s3\_logs](#module\_s3\_logs) | terraform-aws-modules/s3-bucket/aws | ~> 3.0 |
42+
| <a name="module_s3_logs"></a> [s3\_logs](#module\_s3\_logs) | terraform-aws-modules/s3-bucket/aws | ~> 5.0 |
4443
| <a name="module_security_group"></a> [security\_group](#module\_security\_group) | terraform-aws-modules/security-group/aws//modules/redshift | ~> 5.0 |
45-
| <a name="module_vpc"></a> [vpc](#module\_vpc) | terraform-aws-modules/vpc/aws | ~> 5.0 |
44+
| <a name="module_vpc"></a> [vpc](#module\_vpc) | terraform-aws-modules/vpc/aws | ~> 6.0 |
4645
| <a name="module_with_cloudwatch_logging"></a> [with\_cloudwatch\_logging](#module\_with\_cloudwatch\_logging) | ../../ | n/a |
4746

4847
## Resources
@@ -89,10 +88,7 @@ No inputs.
8988
| <a name="output_cluster_type"></a> [cluster\_type](#output\_cluster\_type) | The Redshift cluster type |
9089
| <a name="output_cluster_version"></a> [cluster\_version](#output\_cluster\_version) | The version of Redshift engine software |
9190
| <a name="output_cluster_vpc_security_group_ids"></a> [cluster\_vpc\_security\_group\_ids](#output\_cluster\_vpc\_security\_group\_ids) | The VPC security group ids associated with the cluster |
92-
| <a name="output_endpoint_access_address"></a> [endpoint\_access\_address](#output\_endpoint\_access\_address) | The DNS address of the endpoint |
93-
| <a name="output_endpoint_access_id"></a> [endpoint\_access\_id](#output\_endpoint\_access\_id) | The Redshift-managed VPC endpoint name |
94-
| <a name="output_endpoint_access_port"></a> [endpoint\_access\_port](#output\_endpoint\_access\_port) | The port number on which the cluster accepts incoming connections |
95-
| <a name="output_endpoint_access_vpc_endpoint"></a> [endpoint\_access\_vpc\_endpoint](#output\_endpoint\_access\_vpc\_endpoint) | The connection endpoint for connecting to an Amazon Redshift cluster through the proxy. See details below |
91+
| <a name="output_endpoint_access"></a> [endpoint\_access](#output\_endpoint\_access) | A map of access endpoints created and their attributes |
9692
| <a name="output_master_password_secret_arn"></a> [master\_password\_secret\_arn](#output\_master\_password\_secret\_arn) | ARN of managed master password secret |
9793
| <a name="output_master_password_secretsmanager_secret_rotation_enabled"></a> [master\_password\_secretsmanager\_secret\_rotation\_enabled](#output\_master\_password\_secretsmanager\_secret\_rotation\_enabled) | Specifies whether automatic rotation is enabled for the secret |
9894
| <a name="output_parameter_group_arn"></a> [parameter\_group\_arn](#output\_parameter\_group\_arn) | Amazon Resource Name (ARN) of the parameter group created |

0 commit comments

Comments
 (0)