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

r/elasticache_serverless_cache: fix modify error using autoflex #40969

Merged
merged 4 commits into from
Jan 16, 2025

Conversation

johnsonaj
Copy link
Contributor

@johnsonaj johnsonaj commented Jan 16, 2025

Description

When modifying and aws_elasticache_serverless_cache the resource can sometimes throw the following error due all parameters being passed to the update:

% make testacc TESTARGS='-run=TestAccElastiCacheServerlessCache_redisUpdateWithUserGroup' PKG=elasticache

make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.3 test ./internal/service/elasticache/... -v -count 1 -parallel 20  -run=TestAccElastiCacheServerlessCache_redisUpdateWithUserGroup -timeout 360m -vet=off
2025/01/16 09:43:53 Initializing Terraform AWS Provider...
=== RUN   TestAccElastiCacheServerlessCache_redisUpdateWithUserGroup
=== PAUSE TestAccElastiCacheServerlessCache_redisUpdateWithUserGroup
=== CONT  TestAccElastiCacheServerlessCache_redisUpdateWithUserGroup
    serverless_cache_test.go:214: Step 2/2 error: Error running apply: exit status 1

        Error: updating ElastiCache Serverless Cache (tf-acc-test-7713555080296793790)

          with aws_elasticache_serverless_cache.test,
          on terraform_plugin_test.tf line 56, in resource "aws_elasticache_serverless_cache" "test":
          56: resource "aws_elasticache_serverless_cache" "test" {

        operation error ElastiCache: ModifyServerlessCache, https response error
        StatusCode: 400, RequestID: fa52f39a-9a6f-4267-b141-dd7372806b81,
        InvalidParameterCombination: Serverless Cache modifications only support
        modifying one field per request.
--- FAIL: TestAccElastiCacheServerlessCache_redisUpdateWithUserGroup (619.41s)
FAIL
FAIL	github.com/hashicorp/terraform-provider-aws/internal/service/elasticache	625.897s
FAIL
make: *** [testacc] Error 1

Relations

Closes #37499
Closes #40461

References

Output from Acceptance Testing

% make testacc TESTARGS='-run=TestAccElastiCacheServerlessCache_redisUpdateWithUserGroup' PKG=elasticache

make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.3 test ./internal/service/elasticache/... -v -count 1 -parallel 20  -run=TestAccElastiCacheServerlessCache_redisUpdateWithUserGroup -timeout 360m -vet=off
2025/01/16 09:59:31 Initializing Terraform AWS Provider...
=== RUN   TestAccElastiCacheServerlessCache_redisUpdateWithUserGroup
=== PAUSE TestAccElastiCacheServerlessCache_redisUpdateWithUserGroup
=== CONT  TestAccElastiCacheServerlessCache_redisUpdateWithUserGroup
--- PASS: TestAccElastiCacheServerlessCache_redisUpdateWithUserGroup (532.74s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/elasticache	539.266s
% make testacc TESTARGS='-run=TestAccElastiCacheServerlessCache_' PKG=elasticache

make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.3 test ./internal/service/elasticache/... -v -count 1 -parallel 20  -run=TestAccElastiCacheServerlessCache_ -timeout 360m -vet=off
2025/01/16 10:12:47 Initializing Terraform AWS Provider...
--- PASS: TestAccElastiCacheServerlessCache_disappears (416.33s)
--- PASS: TestAccElastiCacheServerlessCache_update (458.97s)
--- PASS: TestAccElastiCacheServerlessCache_tags (463.96s)
--- PASS: TestAccElastiCacheServerlessCache_basicValkey (471.00s)
--- PASS: TestAccElastiCacheServerlessCache_basicRedis (482.76s)
--- PASS: TestAccElastiCacheServerlessCache_redisUpdateWithUserGroup (524.66s)
--- PASS: TestAccElastiCacheServerlessCache_fullValkey (572.70s)
--- PASS: TestAccElastiCacheServerlessCache_fullRedis (624.83s)
--- PASS: TestAccElastiCacheServerlessCache_full (655.87s)
--- PASS: TestAccElastiCacheServerlessCache_updatesc (682.26s)
--- PASS: TestAccElastiCacheServerlessCache_update_RedisToValkey (777.39s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/elasticache	783.887s

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. prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. labels Jan 16, 2025
@johnsonaj johnsonaj marked this pull request as ready for review January 16, 2025 17:06
@johnsonaj johnsonaj requested a review from a team as a code owner January 16, 2025 17:06
@johnsonaj johnsonaj added the bug Addresses a defect in current functionality. label Jan 16, 2025
@ewbankkit ewbankkit self-assigned this Jan 16, 2025
Copy link
Contributor

@ewbankkit ewbankkit left a comment

Choose a reason for hiding this comment

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

LGTM 🚀.

% make testacc TESTARGS='-run=TestAccElastiCacheServerlessCache_' PKG=elasticache ACCTEST_PARALLELISM=3
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.3 test ./internal/service/elasticache/... -v -count 1 -parallel 3  -run=TestAccElastiCacheServerlessCache_ -timeout 360m -vet=off
2025/01/16 14:40:28 Initializing Terraform AWS Provider...
=== RUN   TestAccElastiCacheServerlessCache_basicRedis
=== PAUSE TestAccElastiCacheServerlessCache_basicRedis
=== RUN   TestAccElastiCacheServerlessCache_basicValkey
=== PAUSE TestAccElastiCacheServerlessCache_basicValkey
=== RUN   TestAccElastiCacheServerlessCache_full
=== PAUSE TestAccElastiCacheServerlessCache_full
=== RUN   TestAccElastiCacheServerlessCache_fullRedis
=== PAUSE TestAccElastiCacheServerlessCache_fullRedis
=== RUN   TestAccElastiCacheServerlessCache_redisUpdateWithUserGroup
=== PAUSE TestAccElastiCacheServerlessCache_redisUpdateWithUserGroup
=== RUN   TestAccElastiCacheServerlessCache_fullValkey
=== PAUSE TestAccElastiCacheServerlessCache_fullValkey
=== RUN   TestAccElastiCacheServerlessCache_update
=== PAUSE TestAccElastiCacheServerlessCache_update
=== RUN   TestAccElastiCacheServerlessCache_updatesc
=== PAUSE TestAccElastiCacheServerlessCache_updatesc
=== RUN   TestAccElastiCacheServerlessCache_update_RedisToValkey
=== PAUSE TestAccElastiCacheServerlessCache_update_RedisToValkey
=== RUN   TestAccElastiCacheServerlessCache_disappears
=== PAUSE TestAccElastiCacheServerlessCache_disappears
=== RUN   TestAccElastiCacheServerlessCache_tags
=== PAUSE TestAccElastiCacheServerlessCache_tags
=== CONT  TestAccElastiCacheServerlessCache_basicRedis
=== CONT  TestAccElastiCacheServerlessCache_update
=== CONT  TestAccElastiCacheServerlessCache_fullRedis
--- PASS: TestAccElastiCacheServerlessCache_update (394.73s)
=== CONT  TestAccElastiCacheServerlessCache_disappears
--- PASS: TestAccElastiCacheServerlessCache_fullRedis (511.82s)
=== CONT  TestAccElastiCacheServerlessCache_tags
--- PASS: TestAccElastiCacheServerlessCache_basicRedis (533.41s)
=== CONT  TestAccElastiCacheServerlessCache_fullValkey
--- PASS: TestAccElastiCacheServerlessCache_disappears (373.02s)
=== CONT  TestAccElastiCacheServerlessCache_update_RedisToValkey
=== CONT  TestAccElastiCacheServerlessCache_redisUpdateWithUserGroup
--- PASS: TestAccElastiCacheServerlessCache_tags (367.54s)
--- PASS: TestAccElastiCacheServerlessCache_fullValkey (385.74s)
=== CONT  TestAccElastiCacheServerlessCache_updatesc
--- PASS: TestAccElastiCacheServerlessCache_redisUpdateWithUserGroup (535.02s)
=== CONT  TestAccElastiCacheServerlessCache_full
--- PASS: TestAccElastiCacheServerlessCache_update_RedisToValkey (693.59s)
=== CONT  TestAccElastiCacheServerlessCache_basicValkey
--- PASS: TestAccElastiCacheServerlessCache_updatesc (617.17s)
--- PASS: TestAccElastiCacheServerlessCache_full (386.93s)
--- PASS: TestAccElastiCacheServerlessCache_basicValkey (407.56s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/elasticache	1874.555s

@johnsonaj johnsonaj merged commit d092bdf into main Jan 16, 2025
63 checks passed
@johnsonaj johnsonaj deleted the elasticache_has_changes_ignore branch January 16, 2025 20:24
@github-actions github-actions bot added this to the v5.85.0 milestone Jan 16, 2025
terraform-aws-provider bot pushed a commit that referenced this pull request Jan 16, 2025
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
2 participants