From 35d6971de9bbcb8fbdf2bf3bc345396cd71e0dca Mon Sep 17 00:00:00 2001 From: SevenEarth <391613297@qq.com> Date: Mon, 2 Dec 2024 15:42:29 +0800 Subject: [PATCH 1/2] add --- tencentcloud/provider.md | 2 + .../cam/data_source_tc_cam_role_detail.go | 20 ++++---- .../cam/data_source_tc_cam_sub_accounts.go | 18 ++++---- website/docs/d/cam_role_detail.html.markdown | 46 +++++++++++++++++++ website/docs/d/cam_sub_accounts.html.markdown | 35 ++++++++++++++ website/tencentcloud.erb | 6 +++ 6 files changed, 109 insertions(+), 18 deletions(-) create mode 100644 website/docs/d/cam_role_detail.html.markdown create mode 100644 website/docs/d/cam_sub_accounts.html.markdown diff --git a/tencentcloud/provider.md b/tencentcloud/provider.md index 7b3a997ad9..f3ff56b525 100644 --- a/tencentcloud/provider.md +++ b/tencentcloud/provider.md @@ -253,6 +253,8 @@ Cloud Access Management(CAM) tencentcloud_cam_policy_granting_service_access tencentcloud_cam_oidc_config tencentcloud_cam_group_user_account + tencentcloud_cam_sub_accounts + tencentcloud_cam_role_detail Resource tencentcloud_cam_role diff --git a/tencentcloud/services/cam/data_source_tc_cam_role_detail.go b/tencentcloud/services/cam/data_source_tc_cam_role_detail.go index eb3e925ca1..4611d1031c 100644 --- a/tencentcloud/services/cam/data_source_tc_cam_role_detail.go +++ b/tencentcloud/services/cam/data_source_tc_cam_role_detail.go @@ -19,55 +19,55 @@ func DataSourceTencentCloudCamRoleDetail() *schema.Resource { "role_id": { Type: schema.TypeString, Optional: true, - Description: "Role ID, used to specify role. Input either `RoleId` or `RoleName`", + Description: "Role ID, used to specify role. Input either `RoleId` or `RoleName`.", }, "role_name": { Type: schema.TypeString, Optional: true, - Description: "Role name, used to specify role. Input either `RoleId` or `RoleName`", + Description: "Role name, used to specify role. Input either `RoleId` or `RoleName`.", }, "role_info": { Type: schema.TypeList, Computed: true, - Description: "Role details", + Description: "Role details.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "role_id": { Type: schema.TypeString, Required: true, - Description: "Role ID", + Description: "Role ID.", }, "role_name": { Type: schema.TypeString, Required: true, - Description: "Role name", + Description: "Role name.", }, "policy_document": { Type: schema.TypeString, Required: true, - Description: "Role policy document", + Description: "Role policy document.", }, "description": { Type: schema.TypeString, Required: true, - Description: "Role description", + Description: "Role description.", }, "add_time": { Type: schema.TypeString, Required: true, - Description: "Time role created", + Description: "Time role created.", }, "update_time": { Type: schema.TypeString, Required: true, - Description: "Time role last updated", + Description: "Time role last updated.", }, "console_login": { Type: schema.TypeInt, Required: true, - Description: "If login is allowed for the role", + Description: "If login is allowed for the role.", }, "role_type": { Type: schema.TypeString, diff --git a/tencentcloud/services/cam/data_source_tc_cam_sub_accounts.go b/tencentcloud/services/cam/data_source_tc_cam_sub_accounts.go index 671d40516f..be3ce41af7 100644 --- a/tencentcloud/services/cam/data_source_tc_cam_sub_accounts.go +++ b/tencentcloud/services/cam/data_source_tc_cam_sub_accounts.go @@ -34,12 +34,12 @@ func DataSourceTencentCloudCamSubAccounts() *schema.Resource { "uin": { Type: schema.TypeInt, Required: true, - Description: "Sub-user ID", + Description: "Sub-user ID.", }, "name": { Type: schema.TypeString, Required: true, - Description: "Sub-user name", + Description: "Sub-user name.", }, "uid": { Type: schema.TypeInt, @@ -49,7 +49,7 @@ func DataSourceTencentCloudCamSubAccounts() *schema.Resource { "remark": { Type: schema.TypeString, Required: true, - Description: "Sub-user remarks", + Description: "Sub-user remarks.", }, "create_time": { Type: schema.TypeString, @@ -59,15 +59,17 @@ func DataSourceTencentCloudCamSubAccounts() *schema.Resource { "user_type": { Type: schema.TypeInt, Required: true, - Description: "User type (1: root account; 2: sub-user; 3: WeCom sub-user; 4: collaborator; 5: message recipient)", + Description: "User type (1: root account; 2: sub-user; 3: WeCom sub-user; 4: collaborator; 5: message recipient).", }, "last_login_ip": { - Type: schema.TypeString, - Required: true, + Type: schema.TypeString, + Required: true, + Description: "Last login IP.", }, "last_login_time": { - Type: schema.TypeString, - Required: true, + Type: schema.TypeString, + Required: true, + Description: "Last login time.", }, }, }, diff --git a/website/docs/d/cam_role_detail.html.markdown b/website/docs/d/cam_role_detail.html.markdown new file mode 100644 index 0000000000..6653430d55 --- /dev/null +++ b/website/docs/d/cam_role_detail.html.markdown @@ -0,0 +1,46 @@ +--- +subcategory: "Cloud Access Management(CAM)" +layout: "tencentcloud" +page_title: "TencentCloud: tencentcloud_cam_role_detail" +sidebar_current: "docs-tencentcloud-datasource-cam_role_detail" +description: |- + Use this data source to query detailed information of cam role detail +--- + +# tencentcloud_cam_role_detail + +Use this data source to query detailed information of cam role detail + +## Example Usage + +### Query cam role detail by role ID + +```hcl +data "tencentcloud_cam_role_detail" "example" { + role_id = "4611686018441060141" +} +``` + +### Query cam role detail by role name + +```hcl +data "tencentcloud_cam_role_detail" "example" { + role_name = "tf-example" +} +``` + +## Argument Reference + +The following arguments are supported: + +* `result_output_file` - (Optional, String) Used to save results. +* `role_id` - (Optional, String) Role ID, used to specify role. Input either `RoleId` or `RoleName`. +* `role_name` - (Optional, String) Role name, used to specify role. Input either `RoleId` or `RoleName`. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `role_info` - Role details. + + diff --git a/website/docs/d/cam_sub_accounts.html.markdown b/website/docs/d/cam_sub_accounts.html.markdown new file mode 100644 index 0000000000..6e52fd8390 --- /dev/null +++ b/website/docs/d/cam_sub_accounts.html.markdown @@ -0,0 +1,35 @@ +--- +subcategory: "Cloud Access Management(CAM)" +layout: "tencentcloud" +page_title: "TencentCloud: tencentcloud_cam_sub_accounts" +sidebar_current: "docs-tencentcloud-datasource-cam_sub_accounts" +description: |- + Use this data source to query detailed information of cam sub accounts +--- + +# tencentcloud_cam_sub_accounts + +Use this data source to query detailed information of cam sub accounts + +## Example Usage + +```hcl +data "tencentcloud_cam_sub_accounts" "example" { + filter_sub_account_uin = ["100037718139"] +} +``` + +## Argument Reference + +The following arguments are supported: + +* `filter_sub_account_uin` - (Required, Set: [`Int`]) List of sub-user UINs. Up to 50 UINs are supported. +* `result_output_file` - (Optional, String) Used to save results. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `sub_accounts` - Sub-user list. + + diff --git a/website/tencentcloud.erb b/website/tencentcloud.erb index 3f24093f74..d41ed4c697 100644 --- a/website/tencentcloud.erb +++ b/website/tencentcloud.erb @@ -719,6 +719,9 @@