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

Add 'description' parameter in huaweicloud_identity_user_v3 #266

Merged
merged 3 commits into from
Feb 10, 2020
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
}
27 changes: 13 additions & 14 deletions huaweicloud/resource_huaweicloud_s3_bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -353,11 +353,11 @@ func resourceS3BucketUpdate(d *schema.ResourceData, meta interface{}) error {
return fmt.Errorf("Error creating HuaweiCloud s3 client: %s", err)
}

/*
if err := setTagsS3(s3conn, d); err != nil {
return fmt.Errorf("%q: %s", d.Get("bucket").(string), err)
}
*/
// update tags
if err := setTagsS3(s3conn, d); err != nil {
return fmt.Errorf("%q: %s", d.Get("bucket").(string), err)
}

if d.HasChange("policy") {
if err := resourceS3BucketPolicyUpdate(s3conn, d); err != nil {
return err
Expand Down Expand Up @@ -778,16 +778,15 @@ func resourceS3BucketRead(d *schema.ResourceData, meta interface{}) error {
}
}

/*
tagSet, err := getTagSetS3(s3conn, d.Id())
if err != nil {
return err
}
// get tags
tagSet, err := getTagSetS3(s3conn, d.Id())
if err != nil {
return err
}

if err := d.Set("tags", tagsToMapS3(tagSet)); err != nil {
return err
}
*/
if err := d.Set("tags", tagsToMapS3(tagSet)); err != nil {
return err
}

// UNUSED?
//d.Set("arn", fmt.Sprintf("arn:%s:s3:::%s", meta.(*Config).partition, d.Id()))
Expand Down
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
1 change: 1 addition & 0 deletions website/docs/d/s3_bucket_object.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ data "huaweicloud_s3_bucket_object" "b" {
bucket = "my-test-bucket"
key = "hello-world.zip"
}
```

## Argument Reference

Expand Down
Loading