diff --git a/CHANGELOG.md b/CHANGELOG.md index d34d06165..b19f546a4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ nav_order: 1 - Add `connection_uri` field to components of all services. This field contains connection information for the component, and is a combination of the `host` and `port` fields - Add `external_postgresql` and `external_google_cloud_bigquery` service integration endpoints +- Do not return error on `aiven_account_team_member` deletion if the member does not exist ## [4.9.3] - 2023-10-27 diff --git a/internal/sdkprovider/service/account/account_team_member.go b/internal/sdkprovider/service/account/account_team_member.go index ba504f538..258c691f0 100644 --- a/internal/sdkprovider/service/account/account_team_member.go +++ b/internal/sdkprovider/service/account/account_team_member.go @@ -205,21 +205,19 @@ func resourceAccountTeamMemberDelete(ctx context.Context, d *schema.ResourceData } // delete account team member - found := false for _, m := range r.Members { if m.UserEmail == userEmail { err = client.AccountTeamMembers.Delete(ctx, accountID, teamID, m.UserId) if err != nil && !aiven.IsNotFound(err) { return diag.FromErr(err) } - found = true break } } - if !found { - return diag.Errorf("user with email %q is not a part of the team %q", userEmail, teamID) - } + // we don't need to return an error if a user is not found in the members list + // because it means that a user was invited but not yet accepted an invitation, + // and we already deleted an invitation above return nil }