Skip to content

(EON-8723) fix: paginate source/restore account listing and adopt on 409#70

Merged
oryanomer1 merged 2 commits intomainfrom
EON-8723-misses-paginated-source-accounts
Apr 6, 2026
Merged

(EON-8723) fix: paginate source/restore account listing and adopt on 409#70
oryanomer1 merged 2 commits intomainfrom
EON-8723-misses-paginated-source-accounts

Conversation

@oryanomer1
Copy link
Copy Markdown
Contributor

Summary

  • Pagination: ListSourceAccounts and ListRestoreAccounts now iterate through all pages using PageToken/HasNextToken, matching the existing ListSourceAwsOrganizationalUnits pattern. Previously only the first page was fetched, so workspaces with >50 accounts saw drift and delete+recreate plans.
  • 409 Conflict handling: When Create gets 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.
  • Both fixes apply to source and restore account resources.

Test plan

  • Deploy against a workspace with >50 source accounts and verify terraform plan shows no drift
  • Verify terraform apply succeeds when an account already exists (409 is adopted)
  • Verify existing unit tests pass (make test — excluding pre-existing broken resource_account_reconnect_test.go)
  • Run acceptance tests against a real environment (make testacc)

🤖 Generated with Claude Code

oryanomer1 and others added 2 commits April 1, 2026 18:00
…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>
@oryanomer1 oryanomer1 merged commit 56a3308 into main Apr 6, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants