Skip to content

feat: organization add resource #2521

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 13 commits into from
Feb 5, 2024
Merged

Conversation

WeiMengXS
Copy link
Collaborator

add resource tencentcloud_organization_org_share_unit

@WeiMengXS WeiMengXS added the run check run check label Feb 5, 2024
@WeiMengXS WeiMengXS changed the title feat: organization add resource [WIP]feat: organization add resource Feb 5, 2024
@WeiMengXS WeiMengXS changed the title [WIP]feat: organization add resource feat: organization add resource Feb 5, 2024
return err
}
shareMemberUins := strings.Join(shareMemberUin, tccommon.COMMA_SP)
d.SetId(strings.Join(append([]string{area, unitId, shareMemberUins}), tccommon.FILED_SP))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里为啥 Id 中要把 shareMemberUins 加进来呢

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不加进来的话,查询到时候,没办法知道传入的uin是否绑定成功。

return nil
}

_ = d.Set("unit_id", unitId)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里为啥要单独 set unit_id 呢

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

id有些特殊,没办法直接引用到另一个资源上

Check: resource.ComposeTestCheckFunc(resource.TestCheckResourceAttrSet("tencentcloud_organization_org_share_unit_member.org_share_unit_member", "id"),
resource.TestCheckResourceAttrSet("tencentcloud_organization_org_share_unit_member.org_share_unit_member", "unit_id"),
resource.TestCheckResourceAttrSet("tencentcloud_organization_org_share_unit_member.org_share_unit_member", "area"),
resource.TestCheckResourceAttrSet("tencentcloud_organization_org_share_unit_member.org_share_unit_member", "members.#"),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里不支持导入吗,测试用量貌似没有导入的用例?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个是attachment

@WeiMengXS WeiMengXS force-pushed the feat/organization-share-unit branch from cdfde35 to 34bae35 Compare February 5, 2024 09:06
Copy link
Collaborator

@andrew-tx andrew-tx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@andrew-tx andrew-tx merged commit f04641b into master Feb 5, 2024
@andrew-tx andrew-tx deleted the feat/organization-share-unit branch February 5, 2024 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
run check run check
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants