(EON-8723) fix: paginate source/restore account listing and adopt on 409#70
Merged
oryanomer1 merged 2 commits intomainfrom Apr 6, 2026
Merged
Conversation
…dopt on 409 ListSourceAccounts and ListRestoreAccounts only fetched the first page from the API. For workspaces with >50 accounts, accounts beyond page 1 were dropped from state during Read, causing Terraform to plan delete+recreate. Apply then failed with 409 Conflict because the accounts still existed. - Add pagination loop (PageToken/HasNextToken) to both list methods, matching the existing ListSourceAwsOrganizationalUnits pattern. - On 409 Conflict during Create, adopt the existing account into Terraform state instead of erroring, for both source and restore account resources. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
RachelNeriyaSchifter
approved these changes
Apr 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ListSourceAccountsandListRestoreAccountsnow iterate through all pages usingPageToken/HasNextToken, matching the existingListSourceAwsOrganizationalUnitspattern. Previously only the first page was fetched, so workspaces with >50 accounts saw drift and delete+recreate plans.Creategets a 409 (account already exists), the provider now adopts the existing account into Terraform state instead of failing. This prevents apply errors when Terraform tries to recreate accounts that still exist in Eon.Test plan
terraform planshows no driftterraform applysucceeds when an account already exists (409 is adopted)make test— excluding pre-existing brokenresource_account_reconnect_test.go)make testacc)🤖 Generated with Claude Code