hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.86k stars 9.2k forks source link

[Bug]: Terraform does not disable cluster mode for Redis #39968

Open EugenKon opened 3 weeks ago

EugenKon commented 3 weeks ago

Terraform Core Version

v1.9.8

AWS Provider Version

v5.67.0

Affected Resource(s)

Expected Behavior

When cluster mode is turned off cluster_mode = "disabled" it should be applied to actual resource image

Actual Behavior

image

Relevant Error/Panic Output Snippet

No response

Terraform Configuration Files

resource "aws_elasticache_replication_group" "redis" {
  replication_group_id  = "redis"
  description           = "Redis cluster"
  subnet_group_name     = aws_elasticache_subnet_group.redis.name
  security_group_ids    = [aws_security_group.redis.id]

  node_type            = "cache.t2.micro"
  port                 = 6379
  engine               = "redis"
  engine_version       = "7.1"
  parameter_group_name = "default.redis7"

  cluster_mode               = "disabled"
  automatic_failover_enabled = false
  num_cache_clusters         = 1

  at_rest_encryption_enabled = false
  transit_encryption_enabled = false
}

Steps to Reproduce

  1. Deploy Redis with cluster mode
  2. change configuration to cluster_mode = enabled -> "disabled" automatic_failover_enabled = true -> false num_cache_clusters = 2 -> 1

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

None

github-actions[bot] commented 3 weeks ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue

acwwat commented 3 weeks ago

According to Modifying cluster mode, cluster mode configuration can only be changed from cluster mode disabled to cluster mode enabled. Reverting this configuration is not possible. It doesn't seem like you can changed from enabled to compatible to disabled either. Maybe the AWS API is erroring out with a misleading message?