Skip to content

Commit

Permalink
fix access group members resource: recreate ag members when it is del…
Browse files Browse the repository at this point in the history
…eted outside terraform
  • Loading branch information
kavya498 committed Apr 29, 2024
1 parent 422d63d commit dee24fa
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,10 @@ func resourceIBMIAMAccessGroupMembersRead(context context.Context, d *schema.Res
listAccessGroupMembersOptions.SetLimit(limit)
members, detailedResponse, err := iamAccessGroupsClient.ListAccessGroupMembers(listAccessGroupMembersOptions)
if err != nil {
if detailedResponse != nil && detailedResponse.StatusCode == 404 {
d.SetId("")
return nil
}
return diag.FromErr(fmt.Errorf("[ERROR] Error retrieving access group members: %s. API Response: %s", err, detailedResponse))
}
allMembers := members.Members
Expand Down

0 comments on commit dee24fa

Please sign in to comment.