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

Add support for engineValkey in the ValidateFunc #39972

Conversation

schroedermatthias-iu
Copy link

@schroedermatthias-iu schroedermatthias-iu commented Oct 31, 2024

This MR adds valkey as option in the validation function for the allowed engines.
I also added a testcase with best effort, but unfortunately I cannot really run the test as I have no default subnet in my VPC which would be required by the test.

Relations

Closes #39905

Output from Acceptance Testing

make testacc TESTS=TestAccElastiCacheCluster_Engine_valkey PKG=elasticache
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.2 test ./internal/service/elasticache/... -v -count 1 -parallel 20 -run='TestAccElastiCacheCluster_Engine_valkey'  -timeout 360m
2024/10/31 17:49:09 Initializing Terraform AWS Provider...
=== RUN   TestAccElastiCacheCluster_Engine_valkey
=== PAUSE TestAccElastiCacheCluster_Engine_valkey
=== CONT  TestAccElastiCacheCluster_Engine_valkey
    cluster_test.go:130: Step 1/2 error: Error running apply: exit status 1
        
        Error: creating ElastiCache Cache Cluster (tf-acc-test-6418033427746438838): operation error ElastiCache: CreateCacheCluster, https response error StatusCode: 400, RequestID: 42f6496b-2635-4932-824b-206cc9ae2a84, InvalidParameterValue: The account does not have any default subnets.
        
          with aws_elasticache_cluster.test,
          on terraform_plugin_test.tf line 12, in resource "aws_elasticache_cluster" "test":
          12: resource "aws_elasticache_cluster" "test" {
        
--- FAIL: TestAccElastiCacheCluster_Engine_valkey (6.93s)
FAIL
FAIL	github.com/hashicorp/terraform-provider-aws/internal/service/elasticache	10.909s
FAIL
make: *** [testacc] Error 1

…idateFunc to allow creating clusters with the "valkey" engine

test(elasticache/cluster_test.go): add test case for creating an ElastiCache cluster with the "valkey" engine
@schroedermatthias-iu schroedermatthias-iu requested a review from a team as a code owner October 31, 2024 16:50
Copy link

Community Note

Voting for Prioritization

  • Please vote on this pull request by adding a 👍 reaction to the original post to help the community and maintainers prioritize this pull 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.

For Submitters

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • For new resources and data sources, use skaff to generate scaffolding with comments detailing common expectations.
  • Whether or not the branch has been rebased will not impact prioritization, but doing so is always a welcome surprise.

@github-actions github-actions bot added tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. service/elasticache Issues and PRs that pertain to the elasticache service. needs-triage Waiting for first response or review from a maintainer. labels Oct 31, 2024
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Welcome @schroedermatthias-iu 👋

It looks like this is your first Pull Request submission to the Terraform AWS Provider! If you haven’t already done so please make sure you have checked out our CONTRIBUTOR guide and FAQ to make sure your contribution is adhering to best practice and has all the necessary elements in place for a successful approval.

Also take a look at our FAQ which details how we prioritize Pull Requests for inclusion.

Thanks again, and welcome to the community! 😃

@justinretzolk justinretzolk added bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. labels Oct 31, 2024
Copy link
Collaborator

@AdamTylerLynch AdamTylerLynch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

@jar-b jar-b self-assigned this Nov 13, 2024
@github-actions github-actions bot added the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Nov 13, 2024
Copy link
Member

@jar-b jar-b left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The newly added test is failing with the following error:

% make testacc PKG=elasticache TESTS=TestAccElastiCacheCluster_Engine_valkey
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.2 test ./internal/service/elasticache/... -v -count 1 -parallel 20 -run='TestAccElastiCacheCluster_Engine_valkey'  -timeout 360m
2024/11/13 15:16:19 Initializing Terraform AWS Provider...
=== RUN   TestAccElastiCacheCluster_Engine_valkey
=== PAUSE TestAccElastiCacheCluster_Engine_valkey
=== CONT  TestAccElastiCacheCluster_Engine_valkey
    cluster_test.go:130: Step 1/2 error: Error running apply: exit status 1

        Error: creating ElastiCache Cache Cluster (tf-acc-test-8500160142762672679): operation error ElastiCache: CreateCacheCluster, https response error StatusCode: 400, RequestID: cec82629-78b9-44db-a2b5-e188baad50fa, InvalidParameterValue: This API doesn't support Valkey engine. Please use CreateReplicationGroup API for Valkey cluster creation.

          with aws_elasticache_cluster.test,
          on terraform_plugin_test.tf line 12, in resource "aws_elasticache_cluster" "test":
          12: resource "aws_elasticache_cluster" "test" {

--- FAIL: TestAccElastiCacheCluster_Engine_valkey (5.87s)
FAIL
FAIL    github.com/hashicorp/terraform-provider-aws/internal/service/elasticache        10.926s

We've shared the results with AWS and they are investigating how to proceed.

@bryantbiggs
Copy link
Contributor

at this time, the CreateCacheCluster API does not support valkey - therefore this change is not valid and can be closed

@schroedermatthias-iu
Copy link
Author

@bryantbiggs You're right. CacheCluster is the wrong approach here. CacheCluster would have been the right one. Thanks for pointing this out. I think for the ReplicationGroup, the engine valkey is already allowed in the meantime.

BR
Matthias

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. prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. service/elasticache Issues and PRs that pertain to the elasticache service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: aws_elasticache_cluster resource does not support Valkey as an engine
5 participants