Skip to content

Commit dbee34f

Browse files
MonitobCodelax
authored andcommitted
fix: read user tags
1 parent fc50f37 commit dbee34f

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
@@ -117,7 +117,7 @@ func resourceIamUserRead(ctx context.Context, d *schema.ResourceData, m interfac
117117
_ = d.Set("updated_at", types.FlattenTime(user.UpdatedAt))
118118
_ = d.Set("organization_id", user.OrganizationID)
119119
_ = d.Set("deletable", user.Deletable)
120-
_ = d.Set("tags", types.FlattenSliceString(group.Tags))
120+
_ = d.Set("tags", types.FlattenSliceString(user.Tags))
121121
_ = d.Set("last_login_at", types.FlattenTime(user.LastLoginAt))
122122
_ = d.Set("type", user.Type)
123123
_ = d.Set("status", user.Status)
@@ -139,7 +139,7 @@ func resourceIamUserUpdate(ctx context.Context, d *schema.ResourceData, m interf
139139
if d.HasChanges("tags") {
140140
_, err = api.UpdateUser(&iam.UpdateUserRequest{
141141
UserID: user.ID,
142-
Tags: types.ExpandUpdatedStringsPtr(d.Get("tags")),
142+
Tags: types.ExpandUpdatedStringsPtr(d.Get("tags")),
143143
}, scw.WithContext(ctx))
144144
if err != nil {
145145
return diag.FromErr(err)

0 commit comments

Comments
 (0)