Skip to content

Prevent planned forces replacement on region when upgrading from a pre-v6.0.0 provider version and -refresh=false is in effect#43516

Merged
ewbankkit merged 8 commits into
mainfrom
upgrade-to-v6-refresh=false-region
Jul 23, 2025
Merged

Prevent planned forces replacement on region when upgrading from a pre-v6.0.0 provider version and -refresh=false is in effect#43516
ewbankkit merged 8 commits into
mainfrom
upgrade-to-v6-refresh=false-region

Conversation

@ewbankkit

@ewbankkit ewbankkit commented Jul 23, 2025

Copy link
Copy Markdown
Contributor

Rollback Plan

If a change needs to be reverted, we will publish an updated version of the library.

Changes to Security Controls

Are there any changes to security controls (access controls, encryption, logging) in this pull request? If so, explain.

Description

For Framework resources there is an edge case in the seamless upgrade from a pre-v6.0.0 provider when an attribute has changed and terraform plan -refresh=false is used. In such cases, the new region attribute erroneously reports forces replacement.

Output from Acceptance Testing

% make testacc TESTARGS='-run=TestAccVPC_upgradeFromV5' PKG=ec2
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.24.5 test ./internal/service/ec2/... -v -count 1 -parallel 20  -run=TestAccVPC_upgradeFromV5 -timeout 360m -vet=off
2025/07/23 11:29:56 Creating Terraform AWS Provider (SDKv2-style)...
2025/07/23 11:29:56 Initializing Terraform AWS Provider (SDKv2-style)...
=== RUN   TestAccVPC_upgradeFromV5
=== PAUSE TestAccVPC_upgradeFromV5
=== RUN   TestAccVPC_upgradeFromV5PlanRefreshFalse
=== PAUSE TestAccVPC_upgradeFromV5PlanRefreshFalse
=== RUN   TestAccVPC_upgradeFromV5WithUpdatePlanRefreshFalse
=== PAUSE TestAccVPC_upgradeFromV5WithUpdatePlanRefreshFalse
=== RUN   TestAccVPC_upgradeFromV5WithDefaultRegionRefreshFalse
=== PAUSE TestAccVPC_upgradeFromV5WithDefaultRegionRefreshFalse
=== RUN   TestAccVPC_upgradeFromV5WithNewRegionRefreshFalse
=== PAUSE TestAccVPC_upgradeFromV5WithNewRegionRefreshFalse
=== CONT  TestAccVPC_upgradeFromV5
=== CONT  TestAccVPC_upgradeFromV5WithDefaultRegionRefreshFalse
=== CONT  TestAccVPC_upgradeFromV5WithNewRegionRefreshFalse
=== CONT  TestAccVPC_upgradeFromV5WithUpdatePlanRefreshFalse
=== CONT  TestAccVPC_upgradeFromV5PlanRefreshFalse
--- PASS: TestAccVPC_upgradeFromV5WithNewRegionRefreshFalse (86.41s)
--- PASS: TestAccVPC_upgradeFromV5 (90.21s)
--- PASS: TestAccVPC_upgradeFromV5WithDefaultRegionRefreshFalse (102.15s)
--- PASS: TestAccVPC_upgradeFromV5PlanRefreshFalse (108.97s)
--- PASS: TestAccVPC_upgradeFromV5WithUpdatePlanRefreshFalse (112.02s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ec2	117.288s
% AWS_DEFAULT_REGION=us-east-1 make testacc TESTARGS='-run=TestAccAppFabric_serial/^AppBundle$$' PKG=appfabric 
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.24.5 test ./internal/service/appfabric/... -v -count 1 -parallel 20  -run=TestAccAppFabric_serial/^AppBundle$ -timeout 360m -vet=off
2025/07/23 10:44:19 Creating Terraform AWS Provider (SDKv2-style)...
2025/07/23 10:44:19 Initializing Terraform AWS Provider (SDKv2-style)...
=== RUN   TestAccAppFabric_serial
=== PAUSE TestAccAppFabric_serial
=== CONT  TestAccAppFabric_serial
=== RUN   TestAccAppFabric_serial/AppBundle
=== RUN   TestAccAppFabric_serial/AppBundle/upgradeFromV5PlanRefreshFalse
=== RUN   TestAccAppFabric_serial/AppBundle/upgradeFromV5WithUpdatePlanRefreshFalse
=== RUN   TestAccAppFabric_serial/AppBundle/upgradeFromV5WithNewRegionRefreshFalse
=== RUN   TestAccAppFabric_serial/AppBundle/Identity
=== RUN   TestAccAppFabric_serial/AppBundle/Identity/basic
=== RUN   TestAccAppFabric_serial/AppBundle/Identity/ExistingResource
=== RUN   TestAccAppFabric_serial/AppBundle/Identity/RegionOverride
=== RUN   TestAccAppFabric_serial/AppBundle/disappears
=== RUN   TestAccAppFabric_serial/AppBundle/tags
=== RUN   TestAccAppFabric_serial/AppBundle/tags/EmptyTag_OnCreate
=== RUN   TestAccAppFabric_serial/AppBundle/tags/DefaultTags_updateToProviderOnly
=== RUN   TestAccAppFabric_serial/AppBundle/tags/DefaultTags_updateToResourceOnly
=== RUN   TestAccAppFabric_serial/AppBundle/tags/DefaultTags_nullNonOverlappingResourceTag
=== RUN   TestAccAppFabric_serial/AppBundle/tags/IgnoreTags_Overlap_ResourceTag
=== RUN   TestAccAppFabric_serial/AppBundle/tags/basic
=== RUN   TestAccAppFabric_serial/AppBundle/tags/EmptyTag_OnUpdate_Add
=== RUN   TestAccAppFabric_serial/AppBundle/tags/DefaultTags_overlapping
=== RUN   TestAccAppFabric_serial/AppBundle/tags/DefaultTags_emptyResourceTag
=== RUN   TestAccAppFabric_serial/AppBundle/tags/ComputedTag_OnUpdate_Add
=== RUN   TestAccAppFabric_serial/AppBundle/tags/AddOnUpdate
=== RUN   TestAccAppFabric_serial/AppBundle/tags/EmptyTag_OnUpdate_Replace
=== RUN   TestAccAppFabric_serial/AppBundle/tags/DefaultTags_providerOnly
=== RUN   TestAccAppFabric_serial/AppBundle/tags/DefaultTags_nonOverlapping
=== RUN   TestAccAppFabric_serial/AppBundle/tags/DefaultTags_nullOverlappingResourceTag
=== RUN   TestAccAppFabric_serial/AppBundle/tags/ComputedTag_OnCreate
=== RUN   TestAccAppFabric_serial/AppBundle/tags/ComputedTag_OnUpdate_Replace
=== RUN   TestAccAppFabric_serial/AppBundle/tags/IgnoreTags_Overlap_DefaultTag
=== RUN   TestAccAppFabric_serial/AppBundle/tags/null
=== RUN   TestAccAppFabric_serial/AppBundle/tags/EmptyMap
=== RUN   TestAccAppFabric_serial/AppBundle/regionCreateNull
=== RUN   TestAccAppFabric_serial/AppBundle/upgradeFromV5
=== RUN   TestAccAppFabric_serial/AppBundle/upgradeFromV5WithDefaultRegionRefreshFalse
=== RUN   TestAccAppFabric_serial/AppBundle/basic
=== RUN   TestAccAppFabric_serial/AppBundle/cmk
=== RUN   TestAccAppFabric_serial/AppBundle/regionCreateNonNull
--- PASS: TestAccAppFabric_serial (957.05s)
    --- PASS: TestAccAppFabric_serial/AppBundle (957.05s)
        --- PASS: TestAccAppFabric_serial/AppBundle/upgradeFromV5PlanRefreshFalse (51.40s)
        --- PASS: TestAccAppFabric_serial/AppBundle/upgradeFromV5WithUpdatePlanRefreshFalse (51.38s)
        --- PASS: TestAccAppFabric_serial/AppBundle/upgradeFromV5WithNewRegionRefreshFalse (53.66s)
        --- PASS: TestAccAppFabric_serial/AppBundle/Identity (119.25s)
            --- PASS: TestAccAppFabric_serial/AppBundle/Identity/basic (15.64s)
            --- PASS: TestAccAppFabric_serial/AppBundle/Identity/ExistingResource (73.54s)
            --- PASS: TestAccAppFabric_serial/AppBundle/Identity/RegionOverride (20.07s)
        --- PASS: TestAccAppFabric_serial/AppBundle/disappears (18.22s)
        --- PASS: TestAccAppFabric_serial/AppBundle/tags (420.45s)
            --- PASS: TestAccAppFabric_serial/AppBundle/tags/EmptyTag_OnCreate (19.73s)
            --- PASS: TestAccAppFabric_serial/AppBundle/tags/DefaultTags_updateToProviderOnly (17.90s)
            --- PASS: TestAccAppFabric_serial/AppBundle/tags/DefaultTags_updateToResourceOnly (17.08s)
            --- PASS: TestAccAppFabric_serial/AppBundle/tags/DefaultTags_nullNonOverlappingResourceTag (11.31s)
            --- PASS: TestAccAppFabric_serial/AppBundle/tags/IgnoreTags_Overlap_ResourceTag (24.52s)
            --- PASS: TestAccAppFabric_serial/AppBundle/tags/basic (37.65s)
            --- PASS: TestAccAppFabric_serial/AppBundle/tags/EmptyTag_OnUpdate_Add (26.31s)
            --- PASS: TestAccAppFabric_serial/AppBundle/tags/DefaultTags_overlapping (29.15s)
            --- PASS: TestAccAppFabric_serial/AppBundle/tags/DefaultTags_emptyResourceTag (11.08s)
            --- PASS: TestAccAppFabric_serial/AppBundle/tags/ComputedTag_OnUpdate_Add (21.47s)
            --- PASS: TestAccAppFabric_serial/AppBundle/tags/AddOnUpdate (17.56s)
            --- PASS: TestAccAppFabric_serial/AppBundle/tags/EmptyTag_OnUpdate_Replace (17.58s)
            --- PASS: TestAccAppFabric_serial/AppBundle/tags/DefaultTags_providerOnly (38.49s)
            --- PASS: TestAccAppFabric_serial/AppBundle/tags/DefaultTags_nonOverlapping (29.37s)
            --- PASS: TestAccAppFabric_serial/AppBundle/tags/DefaultTags_nullOverlappingResourceTag (11.09s)
            --- PASS: TestAccAppFabric_serial/AppBundle/tags/ComputedTag_OnCreate (14.52s)
            --- PASS: TestAccAppFabric_serial/AppBundle/tags/ComputedTag_OnUpdate_Replace (21.56s)
            --- PASS: TestAccAppFabric_serial/AppBundle/tags/IgnoreTags_Overlap_DefaultTag (22.41s)
            --- PASS: TestAccAppFabric_serial/AppBundle/tags/null (10.90s)
            --- PASS: TestAccAppFabric_serial/AppBundle/tags/EmptyMap (10.76s)
        --- PASS: TestAccAppFabric_serial/AppBundle/regionCreateNull (41.01s)
        --- PASS: TestAccAppFabric_serial/AppBundle/upgradeFromV5 (50.45s)
        --- PASS: TestAccAppFabric_serial/AppBundle/upgradeFromV5WithDefaultRegionRefreshFalse (51.08s)
        --- PASS: TestAccAppFabric_serial/AppBundle/basic (20.75s)
        --- PASS: TestAccAppFabric_serial/AppBundle/cmk (47.00s)
        --- PASS: TestAccAppFabric_serial/AppBundle/regionCreateNonNull (32.40s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/appfabric	961.821s

Previously

% AWS_DEFAULT_REGION=us-east-1 make testacc TESTARGS='-run=TestAccAppFabric_serial/^AppBundle$$/^upgradeFromV5' PKG=appfabric
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.24.5 test ./internal/service/appfabric/... -v -count 1 -parallel 20  -run=TestAccAppFabric_serial/^AppBundle$/^upgradeFromV5 -timeout 360m -vet=off
2025/07/23 10:03:47 Creating Terraform AWS Provider (SDKv2-style)...
2025/07/23 10:03:47 Initializing Terraform AWS Provider (SDKv2-style)...
=== RUN   TestAccAppFabric_serial
=== PAUSE TestAccAppFabric_serial
=== CONT  TestAccAppFabric_serial
=== RUN   TestAccAppFabric_serial/AppBundle
=== RUN   TestAccAppFabric_serial/AppBundle/upgradeFromV5WithUpdatePlanRefreshFalse
    app_bundle_test.go:258: Step 2/2 error: Pre-apply plan check(s) failed:
        'aws_appfabric_app_bundle.test' - expected Update, got action(s): [delete create]
=== RUN   TestAccAppFabric_serial/AppBundle/upgradeFromV5
=== RUN   TestAccAppFabric_serial/AppBundle/upgradeFromV5PlanRefreshFalse
--- FAIL: TestAccAppFabric_serial (138.20s)
    --- FAIL: TestAccAppFabric_serial/AppBundle (138.20s)
        --- FAIL: TestAccAppFabric_serial/AppBundle/upgradeFromV5WithUpdatePlanRefreshFalse (37.24s)
        --- PASS: TestAccAppFabric_serial/AppBundle/upgradeFromV5 (49.79s)
        --- PASS: TestAccAppFabric_serial/AppBundle/upgradeFromV5PlanRefreshFalse (51.17s)
FAIL
FAIL	github.com/hashicorp/terraform-provider-aws/internal/service/appfabric	143.332s
FAIL
make: *** [testacc] Error 1

…undle_upgradeFromV5WithUpdatePlanRefreshFalse'.
… 'testAccAppBundle_upgradeFromV5WithNewRegionRefreshFalse'.
… a pre-v6.0.0 provider version and `-refresh=false` is in effect.
…AccVPC_upgradeFromV5WithNewRegionRefreshFalse'.
@ewbankkit ewbankkit requested a review from a team as a code owner July 23, 2025 15:40
@github-actions

Copy link
Copy Markdown
Contributor

Community Guidelines

This comment is added to every new Pull Request to provide quick reference to how the Terraform AWS Provider is maintained. Please review the information below, and thank you for contributing to the community that keeps the provider thriving! 🚀

Voting for Prioritization

  • Please vote on this Pull Request by adding a 👍 reaction to the original post to help the community and maintainers prioritize it.
  • Please see our prioritization guide for additional information on how the maintainers handle prioritization.
  • Please do not leave +1 or other comments that do not add relevant new information or questions; they generate extra noise for others following the Pull Request and do not help prioritize the request.

Pull Request Authors

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • 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. provider Pertains to the provider itself, rather than any interaction with AWS. service/vpc Issues and PRs that pertain to the vpc service. service/appfabric Issues and PRs that pertain to the appfabric service. prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. size/XL Managed by automation to categorize the size of a PR. labels Jul 23, 2025
@ewbankkit ewbankkit added the bug Addresses a defect in current functionality. label Jul 23, 2025

@johnsonaj johnsonaj left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM 🚀

@ewbankkit ewbankkit merged commit 2e46ce0 into main Jul 23, 2025
58 checks passed
@ewbankkit ewbankkit deleted the upgrade-to-v6-refresh=false-region branch July 23, 2025 20:16
@github-actions

Copy link
Copy Markdown
Contributor

Warning

This Issue has been closed, meaning that any additional comments are much easier for the maintainers to miss. Please assume that the maintainers will not see them.

Ongoing conversations amongst community members are welcome, however, the issue will be locked after 30 days. Moving conversations to another venue, such as the AWS Provider forum, is recommended. If you have additional concerns, please open a new issue, referencing this one where needed.

@github-actions github-actions Bot added this to the v6.5.0 milestone Jul 23, 2025
terraform-aws-provider Bot pushed a commit that referenced this pull request Jul 23, 2025
@github-actions

Copy link
Copy Markdown
Contributor

This functionality has been released in v6.5.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!

@github-actions github-actions Bot removed the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Jul 24, 2025
@github-actions

Copy link
Copy Markdown
Contributor

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 Aug 24, 2025
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. provider Pertains to the provider itself, rather than any interaction with AWS. service/appfabric Issues and PRs that pertain to the appfabric service. service/vpc Issues and PRs that pertain to the vpc 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

Development

Successfully merging this pull request may close these issues.

2 participants