|
| 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 | +``` |
0 commit comments