amazon-web-servicesredisterraformterraform-provider-awsvalkey

Valkey on AWS via Terraform can not use replication groups


I am trying to set up a cache cluster on AWS via terraform. I want to use the engine 'Valkey'. I am getting the following error when I run terraform plan: The only acceptable Engine type when using Replication Groups is Redis. From AWS documentation I thought this would be supported, but maybe this is just a limitation with terraform? From terraform documentation I also thought this should be supported: https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/elasticache_replication_group

Below is my terraform:

resource "aws_elasticache_replication_group" "cluster_valkey" {
    replication_group_id            = "abc"
    replication_group_description   = "abc"

    node_type                       = "abc"
    port                            = "abc"
    parameter_group_name            = "abc"
    engine                          = "valkey"
    engine_version                  = "7.2"

    subnet_group_name               = "abc"
    security_group_ids              = "abc"

    cluster_mode {
        num_node_groups             = "2"
        replicas_per_node_group     = "1"
    }

    automatic_failover_enabled      = true

    apply_immediately               = true

    tags = {
        ...
    }
}

Is this not supported by AWS or am I missing something here?


Solution

  • Which version of the provider are you using? The documentation reference you provided is for data sources rather than resources, so this would be a better reference: https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/elasticache_global_replication_group#engine-1.

    resource "aws_elasticache_replication_group" "primary" {
      replication_group_id = "example-primary"
      description          = "primary replication group"
    
      engine         = "valkey"
      engine_version = "7.0" # or whichever version you need
      node_type      = "cache.m5.large"
    
      num_cache_clusters = 1
    }