Skip to content

Commit 2f27cc6

Browse files
committed
fix: read user tags
1 parent 3fab98b commit 2f27cc6

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

docs/resources/iam_user.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ resource scaleway_iam_user user {
3838

3939
- `email` - (Required) The email of the IAM user.
4040

41+
- `tags` - (Optional) The tags associated with the user.
42+
4143
- `organization_id` - (Defaults to [provider](../index.md#organization_d) `organization_id`) The ID of the organization the user is associated with.
4244

4345
## Attributes Reference

internal/services/iam/user.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ func resourceIamUserRead(ctx context.Context, d *schema.ResourceData, m interfac
116116
_ = d.Set("updated_at", types.FlattenTime(user.UpdatedAt))
117117
_ = d.Set("organization_id", user.OrganizationID)
118118
_ = d.Set("deletable", user.Deletable)
119-
_ = d.Set("tags", types.FlattenSliceString(group.Tags))
119+
_ = d.Set("tags", types.FlattenSliceString(user.Tags))
120120
_ = d.Set("last_login_at", types.FlattenTime(user.LastLoginAt))
121121
_ = d.Set("type", user.Type)
122122
_ = d.Set("status", user.Status)
@@ -138,7 +138,7 @@ func resourceIamUserUpdate(ctx context.Context, d *schema.ResourceData, m interf
138138
if d.HasChanges("tags") {
139139
_, err = api.UpdateUser(&iam.UpdateUserRequest{
140140
UserID: user.ID,
141-
Tags: types.ExpandUpdatedStringsPtr(d.Get("tags")),
141+
Tags: types.ExpandUpdatedStringsPtr(d.Get("tags")),
142142
}, scw.WithContext(ctx))
143143
if err != nil {
144144
return diag.FromErr(err)

0 commit comments

Comments
 (0)