Terraform: Feature request: Support for ElastiCache Redis cluster mode

Created on 18 Oct 2016  ยท  13Comments  ยท  Source: hashicorp/terraform

Amazon recently added support for Redis 3.2 and with it, support for the native Redis Cluster capability, allowing you to create a Redis ElastiCache cluster with 1-15 shards and 0-5 replicas per shard. The AWS documentation now makes the distinction between Memcache, Redis (cluster mode disabled), and Redis (cluster mode enabled). I would enjoy being able to create such a cluster via Terraform.

The announcement is here: https://aws.amazon.com/blogs/aws/amazon-elasticache-for-redis-update-sharded-clusters-engine-improvements-and-more/

Further reading here:
https://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/Replication.Redis-RedisCluster.html
https://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/SelectEngine.Uses.html

enhancement provideaws

Most helpful comment

Is this still being worked on? Would love to see this feature available!

All 13 comments

Is this still being worked on? Would love to see this feature available!

Is this feature "ElastiCache Redis cluster mode" available??

+1

According to the cli reference* one is able to control the cluster mode via --cache-parameter-group, it seems this is already supported?

default.redis3.2.cluster.on cluster mode enabled
default.redis3.2 cluster mode disabled

=>

resource "aws_elasticache_cluster" "bar" {
    parameter_group_name = "default.redis3.2.cluster.on"
}

*http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/Clusters.Create.CLI.html#Clusters.Create.CLI.Redis

According to the cli reference* one is able to control the cluster mode via --cache-parameter-group, it seems this is already supported?

Not quite, but see https://github.com/hashicorp/terraform/pull/9892 for a candidate implementation.

Would be great to see this as part of terraform 0.9.

Any news on this? Any intention of enabling this into terraform 0.8 as well?

It's taken me while to poke around but this is actually already supported in 0.8.8 (possibly earlier):

resource "aws_elasticache_replication_group" "foo-replication-group" {
  replication_group_id          = "foo"
  replication_group_description = "Foo replication group"
  node_type                     = "cache.m1.small"
  number_cache_clusters         = 2
  port                          = 6379
  parameter_group_name          = "default.redis3.2.cluster.on"
  availability_zones            = ["eu-west-1a", "eu-west-1b"]
  automatic_failover_enabled    = true
  security_group_ids            = ["${aws_security_group.foo_sg.id}"]
  subnet_group_name             = "${aws_elasticache_subnet_group.foo-subnets.name}"
}

EDIT: the key point is, I think, the confusion stems from attempts to configure clustered mode with an aws_elasticache_cluster resource when an aws_elasticache_replication_group resource should be used instead.

@deepybee Do you have any ideas on how to scale up the number_cache_clusters minimizing the downtime of destroying/creating the new resource? Thanks in advance!

It seems to be still missing the real clustering part. According to this 9892

Yes @randahlem, it looks like that's a destructive change at present. However, I've manually spun a cluster mode redis cluster in AWS and the modification options are pretty limited. The button to add or remove nodes to shard across is greyed out, so this may be a limitation of the Elasticache API rather than Terraform.

screenshot from 2017-03-30 16-25-22

@bsiegel I believe this has been added now - please can you check this when 0.9.6 comes out?

I deployed it in a clustered mode using the following:

resource "aws_elasticache_replication_group" "foo" {
...
...
cluster_mode {
    num_node_groups = 2
    replicas_per_node_group = 1
  }

}

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.

Was this page helpful?
0 / 5 - 0 ratings