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/aws_elasticache_replication_group: v2 state upgrader #34600

Merged
merged 2 commits into from Nov 28, 2023

Conversation

jar-b
Copy link
Member

@jar-b jar-b commented Nov 28, 2023

Description

This state upgrader resolves issues with the default auth_token_update_strategy value, introduced in v5.27.0, which causes a diff upon upgrade and triggers an attempted in-place update. The default value will now instead be written to state by the state upgrader, resulting in no changes on the initial apply.

Before:

% make testacc PKG=elasticache TESTS="TestAccElastiCacheReplicationGroup_stateUpgrade5270"
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/elasticache/... -v -count 1 -parallel 20 -run='TestAccElastiCacheReplicationGroup_stateUpgrade5270'  -timeout 360m
=== RUN   TestAccElastiCacheReplicationGroup_stateUpgrade5270
=== PAUSE TestAccElastiCacheReplicationGroup_stateUpgrade5270
=== CONT  TestAccElastiCacheReplicationGroup_stateUpgrade5270
    replication_group_test.go:81: Step 2/2 error: Error running apply: exit status 1

        Error: changing auth_token for ElastiCache Replication Group (tf-acc-test-867954266583441629): InvalidParameterValue: The AUTH token modification is only supported when encryption-in-transit is enabl
ed.
                status code: 400, request id: de789aa8-0cf8-4e3d-a20f-d1252d7e5c28

          with aws_elasticache_replication_group.test,
          on terraform_plugin_test.tf line 2, in resource "aws_elasticache_replication_group" "test":
           2: resource "aws_elasticache_replication_group" "test" {

--- FAIL: TestAccElastiCacheReplicationGroup_stateUpgrade5270 (856.84s)
FAIL
FAIL    github.com/hashicorp/terraform-provider-aws/internal/service/elasticache        860.110s

After:

% make testacc PKG=elasticache TESTS="TestAccElastiCacheReplicationGroup_stateUpgrade5270"
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/elasticache/... -v -count 1 -parallel 20 -run='TestAccElastiCacheReplicationGroup_stateUpgrade5270'  -timeout 360m
=== RUN   TestAccElastiCacheReplicationGroup_stateUpgrade5270
=== PAUSE TestAccElastiCacheReplicationGroup_stateUpgrade5270
=== CONT  TestAccElastiCacheReplicationGroup_stateUpgrade5270
--- PASS: TestAccElastiCacheReplicationGroup_stateUpgrade5270 (892.26s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/elasticache        895.558s

Relations

Closes #34589
Closes #34592
Relates #34460

References

Output from Acceptance Testing

% make testacc PKG=elasticache TESTS="TestAccElastiCacheReplicationGroup_stateUpgrade5270"
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/elasticache/... -v -count 1 -parallel 20 -run='TestAccElastiCacheReplicationGroup_stateUpgrade5270'  -timeout 360m
=== RUN   TestAccElastiCacheReplicationGroup_stateUpgrade5270
=== PAUSE TestAccElastiCacheReplicationGroup_stateUpgrade5270
=== CONT  TestAccElastiCacheReplicationGroup_stateUpgrade5270
--- PASS: TestAccElastiCacheReplicationGroup_stateUpgrade5270 (892.26s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/elasticache        895.558s

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 size/XL Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. service/elasticache Issues and PRs that pertain to the elasticache service. labels Nov 28, 2023
@terraform-aws-provider terraform-aws-provider bot added the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Nov 28, 2023
Copy link

Thank you for your contribution! 🚀

A new usage of AWS SDK for Go V1 was detected. Please prefer AWS SDK for Go V2 for all net-new services. If this is an enhancement or bug fix to an existing AWS SDK Go V1 based resource, this comment can be safely ignored.

For additional information refer to the AWS SDK for Go Versions page in the contributor guide.

This state upgrader resolves issues with the default auth_token_update_strategy value, introduced in v5.27.0, which causes a diff upon upgrade and triggers an attempted in-place update.
The default value will now instead be written to state by the state upgrader, resulting in no changes on the initial apply.
@jar-b jar-b force-pushed the b-elasticache_replication_group-regression branch from 4ccc7fe to bc70fa7 Compare November 28, 2023 16:30
@ewbankkit ewbankkit self-assigned this Nov 28, 2023
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=TestAccElastiCacheReplicationGroup_stateUpgrade5270\|TestAccElastiCacheReplicationGroup_basic' PKG=elasticache ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/elasticache/... -v -count 1 -parallel 2  -run=TestAccElastiCacheReplicationGroup_stateUpgrade5270\|TestAccElastiCacheReplicationGroup_basic -timeout 360m
=== RUN   TestAccElastiCacheReplicationGroup_basic
=== PAUSE TestAccElastiCacheReplicationGroup_basic
=== RUN   TestAccElastiCacheReplicationGroup_basic_v5
=== PAUSE TestAccElastiCacheReplicationGroup_basic_v5
=== RUN   TestAccElastiCacheReplicationGroup_stateUpgrade5270
=== PAUSE TestAccElastiCacheReplicationGroup_stateUpgrade5270
=== CONT  TestAccElastiCacheReplicationGroup_basic
=== CONT  TestAccElastiCacheReplicationGroup_stateUpgrade5270
--- PASS: TestAccElastiCacheReplicationGroup_basic (837.02s)
=== CONT  TestAccElastiCacheReplicationGroup_basic_v5
--- PASS: TestAccElastiCacheReplicationGroup_stateUpgrade5270 (916.98s)
--- PASS: TestAccElastiCacheReplicationGroup_basic_v5 (836.33s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/elasticache	1678.700s

@jar-b jar-b merged commit c114d40 into main Nov 28, 2023
45 of 46 checks passed
@jar-b jar-b deleted the b-elasticache_replication_group-regression branch November 28, 2023 19:09
@github-actions github-actions bot added this to the v5.28.0 milestone Nov 28, 2023
github-actions bot pushed a commit that referenced this pull request Nov 28, 2023
Copy link

This functionality has been released in v5.28.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 29, 2023
@justinretzolk justinretzolk added the bug Addresses a defect in current functionality. label Feb 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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. size/XL Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
3 participants