Skip to content

Commit

Permalink
Merge pull request #34753 from kota65535/fix-ram-resource-share-not-f…
Browse files Browse the repository at this point in the history
…ound

fix: Wait until RAM resource share available after accepting the invitation
  • Loading branch information
jar-b authored Feb 13, 2024
2 parents 811c087 + 0378f3a commit 9fc510b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .changelog/34753.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
resource/resource_share_acceptor: Wait until RAM resource share available after accepting the invitation
```
8 changes: 8 additions & 0 deletions internal/service/ram/resource_share_accepter.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,14 @@ func resourceResourceShareAccepterCreate(ctx context.Context, d *schema.Resource
d.Timeout(schema.TimeoutCreate),
)

if err != nil {
return sdkdiag.AppendErrorf(diags, "waiting for RAM resource share invitation accepted (%s) state: %s", d.Id(), err)
}

_, err = tfresource.RetryWhenNotFound(ctx, FindResourceShareTimeout, func() (interface{}, error) {
return findResourceShareOwnerOtherAccountsByARN(ctx, conn, d.Id())
})

if err != nil {
return sdkdiag.AppendErrorf(diags, "waiting for RAM resource share (%s) state: %s", d.Id(), err)
}
Expand Down

0 comments on commit 9fc510b

Please sign in to comment.