Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IAM]: fix opentelekomcloud_identity_user_v3 attribute output #2283

Merged
merged 2 commits into from Aug 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/resources/identity_user_v3.md
Expand Up @@ -69,6 +69,8 @@ In addition to all arguments above, the following attributes are exported:

* `last_login` - The time when the IAM user last login.

* `domain_id` - The domain user belongs to.

## Import

Users can be imported using the `id`, e.g.
Expand Down
Expand Up @@ -37,6 +37,7 @@ func TestAccIdentityV3User_basic(t *testing.T) {
resource.TestCheckResourceAttrPtr(resourceName, "name", &user.Name),
resource.TestCheckResourceAttr(resourceName, "enabled", "true"),
resource.TestCheckResourceAttr(resourceName, "email", "test@acme.org"),
resource.TestCheckResourceAttrSet(resourceName, "domain_id"),
),
},
{
Expand All @@ -46,6 +47,7 @@ func TestAccIdentityV3User_basic(t *testing.T) {
resource.TestCheckResourceAttrPtr(resourceName, "name", &user.Name),
resource.TestCheckResourceAttr(resourceName, "enabled", "false"),
resource.TestCheckResourceAttr(resourceName, "email", "test2@acme.org"),
resource.TestCheckResourceAttrSet(resourceName, "domain_id"),
),
},
},
Expand Down
Expand Up @@ -98,6 +98,10 @@ func ResourceIdentityUserV3() *schema.Resource {
Type: schema.TypeString,
Computed: true,
},
"domain_id": {
Type: schema.TypeString,
Computed: true,
},
},
}
}
Expand Down Expand Up @@ -178,6 +182,7 @@ func resourceIdentityUserV3Read(ctx context.Context, d *schema.ResourceData, met
d.Set("pwd_reset", user.PasswordStatus),
d.Set("create_time", user.CreateAt),
d.Set("last_login", user.LastLogin),
d.Set("domain_id", user.DomainID),
)

if err = mErr.ErrorOrNil(); err != nil {
Expand Down
5 changes: 5 additions & 0 deletions releasenotes/notes/users_domain-a63c7989c9e87ce9.yaml
@@ -0,0 +1,5 @@
---
fixes:
- |
**[IAM]** Fix ``resource/opentelekomcloud_identity_user_v3`` to return `domain_id` attribute (`#2283 <https://github.com/opentelekomcloud/terraform-provider-opentelekomcloud/pull/2283>`_)