Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to resize cluster, due to terraform detects change in parameter group name when there is no change #65

Closed
kapild-devops opened this issue May 5, 2022 · 2 comments

Comments

@kapild-devops
Copy link

Hi Anton,

Redshift cluster resizing failed due to changes found in parameter_group_name even if there is no change in it, which further cause cluster resize operation to fail by below error:

│ Error: error modifying Redshift Cluster (test-cluster): InvalidClusterState: The Cluster is being modified by a concurrent operation. Please check the Cluster's status and try again.

there is no such issue in resize when i fix default redshift parameter group name in plan, it only happen when i try to create parameter group with wlm_json_configuration and reapply it.

Versions

  • Module version: 3.4.0
  • Terraform version: 1.1.9
  • Provider version(s): 3.57.0

Reproduction Code

module "redshift" {
  source                  = "terraform-aws-modules/redshift/aws"
  version                 = "3.4.0"
  cluster_identifier      = "test-cluster"
  cluster_node_type       = "dc2.large"
  cluster_number_of_nodes = 3
  # cluster_type            = "multi-node"

  allow_version_upgrade = false # questions

  cluster_database_name   = "mydb"
  cluster_master_username = "mydbuser"
  cluster_master_password = "xxxxx" # questions
  wlm_json_configuration = "[{\"query_concurrency\": 5}]"
  subnets                = ["subnet-xxxx", "subnet-xxxx", "subnet-xxxx"]
  vpc_security_group_ids = ["sg-xxxx"]
  enable_logging         = false
  encrypted              = true
  publicly_accessible    = false
  tags = {
    "Name" = "test"
  }
}

Expected behavior

when i change the cluster_number_of_nodes based on number, it will resize the cluster.

 # module.redshift.aws_redshift_cluster.this will be updated in-place
  ~ resource "aws_redshift_cluster" "this" {
        id                                   = "test-cluster"
      ~ number_of_nodes                      = 3 -> 2
        tags                                 = {
            "Name" = "test"
        }
        # (30 unchanged attributes hidden)

        # (1 unchanged block hidden)
    }

Actual behavior

when i change the cluster_number_of_nodes based on number it will resize the cluster, but terraform found the change in parameter group and try to apply it on cluster, so the state of cluster changes to modifying and not allowing cluster to resize.
this is happen on every terraform apply.

error:
Error: error modifying Redshift Cluster (test-cluster): InvalidClusterState: The Cluster is being modified by a concurrent operation. Please check the Cluster's status and try again.

let me know, if you need further information.

Thanks.

@antonbabenko
Copy link
Member

Hi,

I checked the open issues of Terraform AWS provider and didn't find anything similar to what you experienced but it seems that it should be the best place to open a new issue.

Make sure to update Terraform AWS provider to v4.9.0 or newer where hashicorp/terraform-provider-aws#13203 was merged. It may help.

Normally, there is no simple way in modules to tell Terraform to do one thing and then wait for it to be complete before changing something else in the same resource. It is the responsibility of the Terraform providers.

My vote is that this is a bug in the provider, so I will close it here.

@github-actions
Copy link

I'm going to lock this issue 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 similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants