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

[Bug]: aws_elasticache_cluster resource does not support Valkey as an engine #39905

Open
kevinsantiago-mnltechnology opened this issue Oct 28, 2024 · 6 comments
Labels
bug Addresses a defect in current functionality. good first issue Call to action for new contributors looking for a place to start. Smaller or straightforward issues. service/elasticache Issues and PRs that pertain to the elasticache service. upstream Addresses functionality related to the cloud provider.

Comments

@kevinsantiago-mnltechnology
Copy link

kevinsantiago-mnltechnology commented Oct 28, 2024

Terraform Core Version

1.9.8

AWS Provider Version

5.73.0

Affected Resource(s)

aws_elasticache_cluster

Expected Behavior

should accept valkey as an engine per 5.73.0 release

Actual Behavior

Error: expected engine to be one of ["memcached" "redis"], got valkey

Relevant Error/Panic Output Snippet

No response

Terraform Configuration Files

resource "aws_elasticache_cluster" "valkey-cluster" {
  cluster_id           = "valkey-cluster"
  engine               = "valkey"
  engine_version       = "7.2"
  node_type            = "cache.t2.micro"
  num_cache_nodes      = 1
  parameter_group_name = "default.valkey7"
  port                 = 6379
  subnet_group_name    = data.aws_elasticache_subnet_group.redis-subnet-group.name
  security_group_ids   = [data.aws_security_group.redis-sg.id]
}

Steps to Reproduce

terraform {
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "5.73.0"
    }
  }
}


resource "aws_elasticache_cluster" "valkey-cluster" {
  cluster_id           = "valkey-cluster"
  engine               = "valkey"
  engine_version       = "7.2"
  node_type            = "cache.t2.micro"
  num_cache_nodes      = 1
  parameter_group_name = "default.valkey7"
  port                 = 6379
  subnet_group_name    = data.aws_elasticache_subnet_group.redis-subnet-group.name
  security_group_ids   = [data.aws_security_group.redis-sg.id]
}

Debug Output

No response

Panic Output

No response

Important Factoids

i tried engine "valkey" in aws_elasticache_replication_group it is working.

References

Relates #39641.

Would you like to implement a fix?

None

@kevinsantiago-mnltechnology kevinsantiago-mnltechnology added the bug Addresses a defect in current functionality. label Oct 28, 2024
Copy link

Community Note

Voting for Prioritization

  • Please vote on this issue by adding a 👍 reaction to the original post to help the community and maintainers prioritize this request.
  • Please see our prioritization guide for information on how we prioritize.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

Volunteering to Work on This Issue

  • If you are interested in working on this issue, please leave a comment.
  • If this would be your first contribution, please review the contribution guide.

@github-actions github-actions bot added service/elasticache Issues and PRs that pertain to the elasticache service. needs-triage Waiting for first response or review from a maintainer. labels Oct 28, 2024
@justinretzolk justinretzolk added good first issue Call to action for new contributors looking for a place to start. Smaller or straightforward issues. and removed needs-triage Waiting for first response or review from a maintainer. labels Oct 28, 2024
@xpertkn
Copy link

xpertkn commented Oct 28, 2024

Same here. Already installed provider 5.73.0 and here is my code:

resource "aws_elasticache_cluster" "this" {
  cluster_id           = "lab-valkey1"
  engine               = "valkey"
  node_type            = "cache.t4g.micro"
  num_cache_nodes      = 1
  parameter_group_name = "default.valkey7"
  engine_version       = "7.2"
}

terraform {
  required_version = ">= 1.3.0"
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = ">= 5.73.0"
    }
  }
}

When I run terraform plan, it says valkey engine is not supported

❯ terraform plan
╷
│ Error: expected engine to be one of ["memcached" "redis"], got valkey
│ 
│   with aws_elasticache_cluster.this,
│   on main.tf line 3, in resource "aws_elasticache_cluster" "this":
│    3:   engine               = "valkey"
│ 
╵

@beezly
Copy link
Contributor

beezly commented Oct 29, 2024

This looks wrong:

https://github.com/hashicorp/terraform-provider-aws/blame/1977363a134f59ecfe3ebbd90c97dd8fad94336d/internal/service/elasticache/cluster.go#L144

			names.AttrEngine: {
				Type:         schema.TypeString,
				Optional:     true,
				Computed:     true,
				ForceNew:     true,
				ExactlyOneOf: []string{names.AttrEngine, "replication_group_id"},
				ValidateFunc: validation.StringInSlice([]string{engineMemcached, engineRedis}, false),
			},

engineValkey exists in consts.go so I suspect the fix is:

				ValidateFunc: validation.StringInSlice([]string{engineMemcached, engineRedis, engineValkey}, false),

@schematis
Copy link

Experiencing this in 5.75 still.

@jar-b
Copy link
Member

jar-b commented Nov 13, 2024

This enhancement is blocked until the upstream API adds support for this engine type. See #39972 (comment).

@jar-b jar-b added the upstream Addresses functionality related to the cloud provider. label Nov 13, 2024
@schroedermatthias-iu
Copy link

This enhancement is blocked until the upstream API adds support for this engine type. See #39972 (comment).

But you can use the aws_elasticache_replication_group with existing valkey support instead 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Addresses a defect in current functionality. good first issue Call to action for new contributors looking for a place to start. Smaller or straightforward issues. service/elasticache Issues and PRs that pertain to the elasticache service. upstream Addresses functionality related to the cloud provider.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants