Skip to content

Commit 2f6bfee

Browse files
author
Cristina Sánchez Sánchez
committed
Fixed import
1 parent b92ebf9 commit 2f6bfee

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

internal/service/clouduserprojectassignment/resource.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -208,15 +208,15 @@ func (r *rs) ImportState(ctx context.Context, req resource.ImportStateRequest, r
208208
resp.Diagnostics.AddError("invalid import ID format", "expected 'project_id/user_id' or 'project_id/username', got: "+importID)
209209
return
210210
}
211-
orgID, userID := parts[0], parts[1]
211+
projectID, user := parts[0], parts[1]
212212

213-
resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("org_id"), orgID)...)
213+
resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("projetc_id"), projectID)...)
214214

215215
emailRegex := regexp.MustCompile(`^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}$`)
216216

217-
if emailRegex.MatchString(userID) {
218-
resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("username"), userID)...)
217+
if emailRegex.MatchString(user) {
218+
resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("username"), user)...)
219219
} else {
220-
resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("user_id"), userID)...)
220+
resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("user_id"), user)...)
221221
}
222222
}

0 commit comments

Comments
 (0)