Skip to content

fix(tco): [137234675] tencentcloud_organization_org_member_email fix the issue of update function execution failure #3095

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

Merged
merged 4 commits into from
Jan 22, 2025
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
3 changes: 3 additions & 0 deletions .changelog/3095.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
resource/tencentcloud_organization_org_member_email: fix the issue of update function execution failure
```
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,6 @@ func resourceTencentCloudOrganizationOrgMemberEmailUpdate(d *schema.ResourceData
memberUin := idSplit[0]
bindId := idSplit[1]

request.MemberUin = helper.StrToInt64Point(memberUin)
request.BindId = helper.StrToInt64Point(bindId)
immutableArgs := []string{"member_uin", "bind_id", "apply_time", "bind_status", "bind_time", "description", "phone_bind"}

for _, v := range immutableArgs {
Expand All @@ -232,28 +230,19 @@ func resourceTencentCloudOrganizationOrgMemberEmailUpdate(d *schema.ResourceData
}
}

if d.HasChange("member_uin") {
if v, ok := d.GetOkExists("member_uin"); ok {
request.MemberUin = helper.IntInt64(v.(int))
}
}
request.MemberUin = helper.StrToInt64Point(memberUin)
request.BindId = helper.StrToInt64Point(bindId)

if d.HasChange("email") {
if v, ok := d.GetOk("email"); ok {
request.Email = helper.String(v.(string))
}
if v, ok := d.GetOk("email"); ok {
request.Email = helper.String(v.(string))
}

if d.HasChange("country_code") {
if v, ok := d.GetOk("country_code"); ok {
request.CountryCode = helper.String(v.(string))
}
if v, ok := d.GetOk("country_code"); ok {
request.CountryCode = helper.String(v.(string))
}

if d.HasChange("phone") {
if v, ok := d.GetOk("phone"); ok {
request.Phone = helper.String(v.(string))
}
if v, ok := d.GetOk("phone"); ok {
request.Phone = helper.String(v.(string))
}

err := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError {
Expand All @@ -263,8 +252,10 @@ func resourceTencentCloudOrganizationOrgMemberEmailUpdate(d *schema.ResourceData
} else {
log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), result.ToJsonString())
}

return nil
})

if err != nil {
log.Printf("[CRITAL]%s update organization orgMemberEmail failed, reason:%+v", logId, err)
return err
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
Provides a resource to create a organization org_member_email
Provides a resource to create a organization member email

Example Usage

```hcl
resource "tencentcloud_organization_org_member_email" "org_member_email" {
member_uin = 100033704327
email = "iac-example@qq.com"
resource "tencentcloud_organization_org_member_email" "example" {
member_uin = 100033118139
email = "example@tencent.com"
country_code = "86"
phone = "12345678901"
}
phone = "18611111111"
}
```

Import

organization org_member_email can be imported using the id, e.g.
organization member email can be imported using the id, e.g.

```
terraform import tencentcloud_organization_org_member_email.org_member_email org_member_email_id
terraform import tencentcloud_organization_org_member_email.example 100033118139#132
```
16 changes: 8 additions & 8 deletions website/docs/r/organization_org_member_email.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@ layout: "tencentcloud"
page_title: "TencentCloud: tencentcloud_organization_org_member_email"
sidebar_current: "docs-tencentcloud-resource-organization_org_member_email"
description: |-
Provides a resource to create a organization org_member_email
Provides a resource to create a organization member email
---

# tencentcloud_organization_org_member_email

Provides a resource to create a organization org_member_email
Provides a resource to create a organization member email

## Example Usage

```hcl
resource "tencentcloud_organization_org_member_email" "org_member_email" {
member_uin = 100033704327
email = "iac-example@qq.com"
resource "tencentcloud_organization_org_member_email" "example" {
member_uin = 100033118139
email = "example@tencent.com"
country_code = "86"
phone = "12345678901"
phone = "18611111111"
}
```

Expand Down Expand Up @@ -46,9 +46,9 @@ In addition to all arguments above, the following attributes are exported:

## Import

organization org_member_email can be imported using the id, e.g.
organization member email can be imported using the id, e.g.

```
terraform import tencentcloud_organization_org_member_email.org_member_email org_member_email_id
terraform import tencentcloud_organization_org_member_email.example 100033118139#132
```

Loading