Skip to content

(EON-8377) fix: read role from API response in restore account create#68

Merged
assafr-eon merged 1 commit intomainfrom
assafr-eon-8377-fix-unknown-role-after-create
Mar 31, 2026
Merged

(EON-8377) fix: read role from API response in restore account create#68
assafr-eon merged 1 commit intomainfrom
assafr-eon-8377-fix-unknown-role-after-create

Conversation

@assafr-eon
Copy link
Copy Markdown
Collaborator

Summary

  • The Create function for eon_restore_account was copying role from plan data (data.Aws.RoleArn), which can be "unknown" when role_arn depends on a resource replaced in the same apply (e.g. replace_triggered_by)
  • Terraform then fails with Provider returned invalid result object after apply because unknown values are not allowed after create
  • Now reads role from the API response, matching how Read and ImportState already work

Test plan

  • terraform apply with replace_triggered_by = [aws_iam_role.eon_restore_account_role] no longer fails
  • Backward compat: deprecated role field still populated correctly after create

🤖 Generated with Claude Code

The create path was copying `role` from plan data, which can be
"unknown" when role_arn depends on a resource replaced in the same
apply. Read from the API response instead, matching how Read and
ImportState already work.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@assafr-eon assafr-eon merged commit 17d2216 into main Mar 31, 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