Skip to content

ElastiCache: cluster-mode-disabled replication group returns ConfigurationEndpoint and no NodeGroups #2618

Description

@strelov1

Summary

For a cluster-mode-disabled replication group, DescribeReplicationGroups returns a
ConfigurationEndpoint and no NodeGroups. Real ElastiCache returns the opposite: one node
group carrying PrimaryEndpoint, and no ConfigurationEndpoint at all.

The response is also inconsistent with itself — it reports ClusterEnabled: false while
returning only the fields that belong to a cluster-mode-enabled group.

Reproduction

export AWS_ENDPOINT_URL=http://localhost:4566 AWS_REGION=ap-south-1

aws elasticache create-replication-group \
  --replication-group-id repro-single-node \
  --replication-group-description "cluster mode disabled, one node" \
  --engine redis --cache-node-type cache.t4g.micro --num-cache-clusters 1

aws elasticache describe-replication-groups --replication-group-id repro-single-node

--num-cache-clusters without --num-node-groups is the cluster-mode-disabled form.

Observed

{
  "ReplicationGroupId": "repro-single-node",
  "ClusterEnabled": false,
  "Status": "available",
  "ConfigurationEndpoint": { "Address": "localhost", "Port": 6380 },
  "NodeGroups": null
}

Expected

Per the ElastiCache API reference,
ConfigurationEndpoint is documented as "The configuration endpoint for this replication
group. Use the configuration endpoint to connect to this replication group" and applies to
cluster mode enabled; a cluster-mode-disabled group exposes its primary through
NodeGroups[].PrimaryEndpoint. So the expected shape is roughly:

{
  "ClusterEnabled": false,
  "NodeGroups": [
    {
      "NodeGroupId": "0001",
      "Status": "available",
      "PrimaryEndpoint": { "Address": "...", "Port": 6379 },
      "ReaderEndpoint": { "Address": "...", "Port": 6379 },
      "NodeGroupMembers": [ ... ]
    }
  ]
}

with ConfigurationEndpoint absent.

Impact

Terraform's aws_elasticache_replication_group data source reads
primary_endpoint_address from NodeGroups[0].PrimaryEndpoint.Address, so against the
emulator that attribute is empty. Anything interpolating it — an ECS task definition
environment variable, in our case — is rendered with an empty value and the workload fails
at start with a message about the consumer, not about the endpoint. Unmodified stacks
that are correct for AWS cannot be exercised locally because of it.

There is no workaround inside the configuration that we would want: branching on the
emulator is exactly what we keep our stacks free of, and coalesce over both endpoints
would be wrong for a genuinely cluster-mode-enabled group on real AWS.

Version

floci/floci:nightly, {"version":"latest","edition":"community"} from /_floci/info.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions