Skip to content

Commit

Permalink
Add 'description' parameter in huaweicloud_identity_user_v3 (#266)
Browse files Browse the repository at this point in the history
* Add description parameter in huaweicloud_identity_user_v3

* sync golangsdk vendor

* Support tags in s3_bucket
  • Loading branch information
ShiChangkuo authored Feb 10, 2020
1 parent e846462 commit 83335d3
Show file tree
Hide file tree
Showing 15 changed files with 141 additions and 4 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ require (
github.com/hashicorp/errwrap v1.0.0
github.com/hashicorp/go-cleanhttp v0.5.1
github.com/hashicorp/terraform-plugin-sdk v1.0.0
github.com/huaweicloud/golangsdk v0.0.0-20191210113552-8f6bd7a6f1d8
github.com/huaweicloud/golangsdk v0.0.0-20200204080439-744c2b9d7746
github.com/jen20/awspolicyequivalence v0.0.0-20170831201602-3d48364a137a
github.com/mitchellh/go-homedir v1.1.0
github.com/smartystreets/goconvey v0.0.0-20190222223459-a17d461953aa // indirect
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ github.com/huaweicloud/golangsdk v0.0.0-20191125024548-77b3c02a6faa h1:GY+Kerh4s
github.com/huaweicloud/golangsdk v0.0.0-20191125024548-77b3c02a6faa/go.mod h1:WQBcHRNX9shz3928lWEvstQJtAtYI7ks6XlgtRT9Tcw=
github.com/huaweicloud/golangsdk v0.0.0-20191210113552-8f6bd7a6f1d8 h1:7dfGs0ENjC6iJ4xRLL3Og3amBMhvVlPUeD4i/CTiIe0=
github.com/huaweicloud/golangsdk v0.0.0-20191210113552-8f6bd7a6f1d8/go.mod h1:WQBcHRNX9shz3928lWEvstQJtAtYI7ks6XlgtRT9Tcw=
github.com/huaweicloud/golangsdk v0.0.0-20200204080439-744c2b9d7746 h1:c2HOmXuDF1VSiBdCZAPo6kbOSTt9Kh6jV87mmiegkE0=
github.com/huaweicloud/golangsdk v0.0.0-20200204080439-744c2b9d7746/go.mod h1:WQBcHRNX9shz3928lWEvstQJtAtYI7ks6XlgtRT9Tcw=
github.com/jen20/awspolicyequivalence v0.0.0-20170831201602-3d48364a137a h1:FyS/ubzBR5xJlnJGRTwe7GUHpJOR4ukYK3y+LFNffuA=
github.com/jen20/awspolicyequivalence v0.0.0-20170831201602-3d48364a137a/go.mod h1:uoIMjNxUfXi48Ci40IXkPRbghZ1vbti6v9LCbNqRgHY=
github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
Expand Down
14 changes: 13 additions & 1 deletion huaweicloud/resource_huaweicloud_identity_user_v3.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func resourceIdentityUserV3() *schema.Resource {

"name": {
Type: schema.TypeString,
Optional: true,
Required: true,
},

"password": {
Expand All @@ -55,6 +55,11 @@ func resourceIdentityUserV3() *schema.Resource {
Sensitive: true,
},

"description": {
Type: schema.TypeString,
Optional: true,
},

"region": {
Type: schema.TypeString,
Optional: true,
Expand All @@ -78,6 +83,7 @@ func resourceIdentityUserV3Create(d *schema.ResourceData, meta interface{}) erro
DomainID: d.Get("domain_id").(string),
Enabled: &enabled,
Name: d.Get("name").(string),
Description: d.Get("description").(string),
}

log.Printf("[DEBUG] Create Options: %#v", createOpts)
Expand Down Expand Up @@ -113,6 +119,7 @@ func resourceIdentityUserV3Read(d *schema.ResourceData, meta interface{}) error
d.Set("domain_id", user.DomainID)
d.Set("enabled", user.Enabled)
d.Set("name", user.Name)
d.Set("description", user.Description)
d.Set("region", GetRegion(d, config))

return nil
Expand Down Expand Up @@ -149,6 +156,11 @@ func resourceIdentityUserV3Update(d *schema.ResourceData, meta interface{}) erro
updateOpts.Name = d.Get("name").(string)
}

if d.HasChange("description") {
hasChange = true
updateOpts.Description = d.Get("description").(string)
}

if hasChange {
log.Printf("[DEBUG] Update Options: %#v", updateOpts)
}
Expand Down
2 changes: 2 additions & 0 deletions huaweicloud/resource_huaweicloud_identity_user_v3_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ func testAccIdentityV3User_basic(userName string) string {
name = "%s"
password = "password123@!"
enabled = true
description = "tested by terraform"
}
`, userName)
}
Expand All @@ -116,6 +117,7 @@ func testAccIdentityV3User_update(userName string) string {
name = "%s"
enabled = false
password = "password123@!"
description = "tested by terraform"
}
`, userName)
}
26 changes: 26 additions & 0 deletions vendor/github.com/huaweicloud/golangsdk/openstack/client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions vendor/github.com/huaweicloud/golangsdk/service_client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ github.com/hashicorp/terraform-plugin-sdk/internal/svchost
github.com/hashicorp/terraform-plugin-sdk/internal/svchost/auth
# github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d
github.com/hashicorp/yamux
# github.com/huaweicloud/golangsdk v0.0.0-20191125024548-77b3c02a6faa
# github.com/huaweicloud/golangsdk v0.0.0-20200204080439-744c2b9d7746
github.com/huaweicloud/golangsdk
github.com/huaweicloud/golangsdk/openstack
github.com/huaweicloud/golangsdk/openstack/antiddos/v1/antiddos
Expand Down Expand Up @@ -260,6 +260,7 @@ github.com/huaweicloud/golangsdk/openstack/networking/v2/extensions/lbaas_v2/lis
github.com/huaweicloud/golangsdk/openstack/networking/v2/extensions/lbaas_v2/loadbalancers
github.com/huaweicloud/golangsdk/openstack/networking/v2/extensions/lbaas_v2/monitors
github.com/huaweicloud/golangsdk/openstack/networking/v2/extensions/lbaas_v2/pools
github.com/huaweicloud/golangsdk/openstack/networking/v2/extensions/lbaas_v2/whitelists
github.com/huaweicloud/golangsdk/openstack/networking/v2/extensions/natgateways
github.com/huaweicloud/golangsdk/openstack/networking/v2/extensions/provider
github.com/huaweicloud/golangsdk/openstack/networking/v2/extensions/security/groups
Expand All @@ -279,6 +280,8 @@ github.com/huaweicloud/golangsdk/openstack/objectstorage/v1/swauth
github.com/huaweicloud/golangsdk/openstack/rds/v1/datastores
github.com/huaweicloud/golangsdk/openstack/rds/v1/flavors
github.com/huaweicloud/golangsdk/openstack/rds/v1/instances
github.com/huaweicloud/golangsdk/openstack/rds/v3/backups
github.com/huaweicloud/golangsdk/openstack/rds/v3/configurations
github.com/huaweicloud/golangsdk/openstack/rts/v1/softwareconfig
github.com/huaweicloud/golangsdk/openstack/rts/v1/stackresources
github.com/huaweicloud/golangsdk/openstack/rts/v1/stacks
Expand Down

0 comments on commit 83335d3

Please sign in to comment.