cloudposse / terraform-aws-elasticache-redis

Terraform module to provision an ElastiCache Redis Cluster
https://cloudposse.com/accelerate
Apache License 2.0
141 stars 246 forks source link

Default `user_group_ids` conflicts with `auth_token` #179

Closed z0rc closed 1 year ago

z0rc commented 1 year ago

Found a bug? Maybe our Slack Community can help.

Slack Community

Describe the Bug

Setting auth_token triggers a conflict with default user_group_ids.

Expected Behavior

Conflict shouldn't happen.

Steps to Reproduce

module "elasticache_redis" {
  source  = "cloudposse/elasticache-redis/aws"
  version = "0.46.0"

  name              = "test"
  apply_immediately = false

  family         = "redis6.x"
  engine_version = "6.2"

  instance_type              = "cache.t4g.micro"
  at_rest_encryption_enabled = true
  transit_encryption_enabled = true

  create_security_group         = false
  associated_security_group_ids = [...]
  elasticache_subnet_group_name = ...
  vpc_id                        = ...

  maintenance_window = "tue:00:00-tue:03:00"

  auth_token = "test"
}
╷
│ Error: Conflicting configuration arguments
│
│   with module.elasticache_redis.aws_elasticache_replication_group.default[0],
│   on .terraform/modules/elasticache_redis/main.tf line 118, in resource "aws_elasticache_replication_group" "default":
│  118:   auth_token                 = var.transit_encryption_enabled ? var.auth_token : null
│
│ "auth_token": conflicts with user_group_ids
╵
╷
│ Error: Conflicting configuration arguments
│
│   with module.elasticache_redis.aws_elasticache_replication_group.default[0],
│   on .terraform/modules/elasticache_redis/main.tf line 161, in resource "aws_elasticache_replication_group" "default":
│  161:   user_group_ids          = var.user_group_ids
│
│ "user_group_ids": conflicts with auth_token
╵

Environment (please complete the following information):

Additional Context

Caused by https://github.com/cloudposse/terraform-aws-elasticache-redis/pull/177

z0rc commented 1 year ago

Workaround is to add user_group_ids = null to my code. I believe module's default user_group_ids = [] isn't right.

z0rc commented 1 year ago

Fixed by https://github.com/cloudposse/terraform-aws-elasticache-redis/pull/184.