-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Open
Labels
bugAddresses a defect in current functionality.Addresses a defect in current functionality.needs-triageWaiting for first response or review from a maintainer.Waiting for first response or review from a maintainer.service/elasticacheIssues and PRs that pertain to the elasticache service.Issues and PRs that pertain to the elasticache service.waiting-responseMaintainers are waiting on response from community or contributor.Maintainers are waiting on response from community or contributor.
Description
Terraform and AWS Provider Version
Terraform v1.5.7
on darwin_arm64
+ provider registry.terraform.io/hashicorp/aws v5.100.0
Affected Resource(s) or Data Source(s)
aws_elasticache_replication_group
Expected Behavior
The expected behaviour to import or create this resource when num_cache_clusters is set to 1, and cluster_mode = "enabled"
Actual Behavior
resource can't be created using terraform when num_cache_clusters is set to 1, but i can create it, when num_chache_clusters is set to 2.
Note: i created with these configs using AWS console
Relevant Error/Panic Output
│ Error: "num_cache_clusters": must be at least 2 if automatic_failover_enabled is true
│
│ with module.clusters.module.elasticache["my-elasticache-cluster"].aws_elasticache_replication_group.this,
│ on .terraform/modules/clusters.elasticache/resources.tf line 2, in resource "aws_elasticache_replication_group" "this":
│ 2: resource "aws_elasticache_replication_group" "this" {
Sample Terraform Configuration
We used custome and private module
engine = "valkey"
engine_version = "8.0"
replication_group_id = "my-elasticache-cluster"
cluster_mode = "enabled"
node_type = "cache.t4g.micro"
description = " "
maintenance_window = "mon:03:00-mon:04:00"
num_cache_clusters = 2
create_parameter_group = true
parameter_group_name = "my-elasticache-cluster"
parameter_group_description = "my-elasticache-cluster"
parameter_group_family = "valkey8"
parameter_group_parameters = [{
name = "maxmemory-policy",
value = "volatile-ttl"
},
{
name = "cluster-enabled",
value = "yes"
}
]
snapshot_retention_limit = 0
snapshot_window = "09:00-10:00"
automatic_failover_enabled = true
multi_az_enabled = false
global_enabled = false
security_group_ids = ["sg-ID"]
at_rest_encryption_enabled = true
transit_encryption_enabled = true
Steps to Reproduce
- Create from AWS console valkey cluster with cluster mode enabled, single AZ and one replica
- try to import it to terraform or create it using terraform, it will fail with error num_cache_clusters must be 2 at least to enable failover, while these can be done using AWS console
Debug Logging
Click to expand log output
GenAI / LLM Assisted Development
n/a
Important Facts and References
No response
Would you like to implement a fix?
No
AhmadMS1988 and AhmadMasry
Metadata
Metadata
Assignees
Labels
bugAddresses a defect in current functionality.Addresses a defect in current functionality.needs-triageWaiting for first response or review from a maintainer.Waiting for first response or review from a maintainer.service/elasticacheIssues and PRs that pertain to the elasticache service.Issues and PRs that pertain to the elasticache service.waiting-responseMaintainers are waiting on response from community or contributor.Maintainers are waiting on response from community or contributor.