umotif-public/terraform-aws-elasticache-redis

[BUG] Elasticache endpoints are `null` under some circumstances

Closed this issue · 1 comments

What is the current behavior?

This code applies, but producesnull outputs for elasticache_replication_group_primary_endpoint_address and elasticache_replication_group_reader_endpoint_address

module "elasticache_redis" {
  source  = "umotif-public/elasticache-redis/aws"
  version = "3.0.0"

  name_prefix        = test
  num_cache_clusters = 2
  node_type          = cache.t3.small

  cluster_mode_enabled    = true
  replicas_per_node_group = 1
  num_node_groups         = 2

  engine_version           = "6.x"
  port                     = 6379
  maintenance_window       = "mon:03:00-mon:04:00"
  snapshot_window          = "04:00-06:00"
  snapshot_retention_limit = 7

  automatic_failover_enabled = true

  at_rest_encryption_enabled = true
  transit_encryption_enabled = true
  auth_token                 = random_password.auth_token.result

  apply_immediately = true
  family            = "redis6.x"
  description       = var.description

  subnet_ids = var.subnet_ids
  vpc_id     = var.vpc_id

  ingress_cidr_blocks = ["0.0.0.0/0"]

  parameter = [
    {
      name  = "repl-backlog-size"
      value = "16384"
    }
  ]

  tags = var.tags
}

Either this config is wrong-headed somehow that AWS still allows (which is possible as I am not super familiar with Elasticache) or the logic here is broken, because my cluster appears to have this defined in the state file:

"configuration_endpoint_address": "clustercfg.foo.bar.use1.cache.amazonaws.com",

but not these:

            "primary_endpoint_address": null,
            "reader_endpoint_address": null,

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.

Use this module with the code above.

What is the expected behavior?

The redis endpoint is set correctly in the outputs.

Software versions?

3.0.0

Thank you @spkane for raising this as a bug.

The fix is now a part of 3.1.1 release.