Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Either number_cache_clusters or cluster_mode must be set when both are #23044

Closed
alepeltier opened this issue Oct 10, 2019 · 2 comments
Closed

Comments

@alepeltier
Copy link

alepeltier commented Oct 10, 2019

Terraform Version

Terraform v0.12.10

Terraform Configuration Files

resource "aws_elasticache_replication_group" "shared_microservice_cache" {
  engine                = "redis"
  node_type             = var.elasticache_instance_type
  port                  = 6379
 number_cache_clusters = 3

  // Time is in UTC
  maintenance_window = "sun:03:00-sun:06:00"

  snapshot_retention_limit = var.elasticache_snapshot_rentention_limit
  snapshot_window          = "00:00-02:00"

  subnet_group_name  = aws_elasticache_subnet_group.default.name
  security_group_ids = [module.security_group.id]

  automatic_failover_enabled = true

  replication_group_description = format("%s %s %s",
    "A redis cache which can be used by any microservice in the",
    var.environment,
    "environment"
  )

  replication_group_id = format("%s-%s",
    "microservice",
    var.environment
  )

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

  cluster_mode {
    replicas_per_node_group = var.elasticache_replicas_per_node_group
    num_node_groups         = var.elasticache_num_node_groups
  }
}

Expected Behavior

According to the documentation, I should be able to make a clustered Redis cache by setting either cluster_mode or number_cache_clusters. I have both set in the above code however when I run an apply Terraform throws an error saying I need to have them set. I've had this issue multiple times and don't think it is the expected behaviour unless I'm doing something wrong.

Actual Behavior

I get the following error

Error: Either `number_cache_clusters` or `cluster_mode` must be set

  on main.tf line 82, in resource "aws_elasticache_replication_group" "shared_microservice_cache":
  82: resource "aws_elasticache_replication_group" "shared_microservice_cache" {

Steps to Reproduce

1: Run terraform apply

@ghost
Copy link

ghost commented Oct 10, 2019

This issue has been automatically migrated to hashicorp/terraform-provider-aws#10458 because it looks like an issue with that provider. If you believe this is not an issue with the provider, please reply to hashicorp/terraform-provider-aws#10458.

@ghost ghost closed this as completed Oct 10, 2019
@ghost
Copy link

ghost commented Nov 10, 2019

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.

@ghost ghost locked and limited conversation to collaborators Nov 10, 2019
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants