terraform-aws-redshift icon indicating copy to clipboard operation
terraform-aws-redshift copied to clipboard

fix: Master username when specifying snapshot identifier

Open tico8 opened this issue 3 years ago β€’ 3 comments

Description

In the steps below, the cluster with the difference will be recreated.

1 - specify snapshot_identifier, terraform apply 2 - same condition, terraform plan

$ terraform plan
  ...
  # module.redshift.aws_redshift_cluster.this[0] must be replaced
-/+ resource "aws_redshift_cluster" "this" {
      ...
      - master_username                      = "master" -> null # forces replacement
      ...

Motivation and Context

We want to restore the cluster from a snapshot. However, I have this problem and am looking for a solution.

Breaking Changes

It will affect cases where both master_username and snapshot_identifier are specified.

How Has This Been Tested?

  • [ ] I have updated at least one of the examples/* to demonstrate and validate my change(s)
  • [ ] I have tested and validated these changes using one or more of the provided examples/* projects
  • [ ] I have executed pre-commit run -a on my pull request

tico8 avatar Aug 18 '22 16:08 tico8

I believe what we have is correct per https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/redshift_cluster#master_username

bryantbiggs avatar Aug 18 '22 17:08 bryantbiggs

I believe what we have is correct per https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/redshift_cluster#master_username

I believe so too. However, it is happening in my environment.

environment aws provider version: 4.26 terraform-aws-modules/redshift/aws : 4.0.1

tico8 avatar Aug 18 '22 23:08 tico8

Is it related to this issue? https://github.com/hashicorp/terraform-provider-aws/issues/17448

Until the terraform provider side improves, what should the side using this module do ?

tico8 avatar Aug 28 '22 00:08 tico8

can this be merged please?

zeyaddeeb avatar Sep 15 '22 13:09 zeyaddeeb

I'm running into an issue here upgrading the cluster created from a snapshot. it always try to recreate which is not the right behavior. I tested with this fork and it was fine.

zeyaddeeb avatar Sep 26 '22 22:09 zeyaddeeb

This PR is included in version 4.0.2 :tada:

antonbabenko avatar Sep 26 '22 23:09 antonbabenko

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

github-actions[bot] avatar Oct 28 '22 02:10 github-actions[bot]