tencentcloud 1.82.34 published on Wednesday, Nov 5, 2025 by tencentcloudstack
tencentcloud.getCamUserPolicyAttachments
Start a Neo task
Explain and create a tencentcloud.getCamUserPolicyAttachments resource
tencentcloud 1.82.34 published on Wednesday, Nov 5, 2025 by tencentcloudstack
Use this data source to query detailed information of CAM user policy attachments
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
// query by user_id
const foo = tencentcloud.getCamUserPolicyAttachments({
userId: fooTencentcloudCamUser.id,
});
// query by user_id and policy_id
const bar = tencentcloud.getCamUserPolicyAttachments({
userId: fooTencentcloudCamUser.id,
policyId: fooTencentcloudCamPolicy.id,
});
import pulumi
import pulumi_tencentcloud as tencentcloud
# query by user_id
foo = tencentcloud.get_cam_user_policy_attachments(user_id=foo_tencentcloud_cam_user["id"])
# query by user_id and policy_id
bar = tencentcloud.get_cam_user_policy_attachments(user_id=foo_tencentcloud_cam_user["id"],
policy_id=foo_tencentcloud_cam_policy["id"])
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
// query by user_id
_, err := tencentcloud.GetCamUserPolicyAttachments(ctx, &tencentcloud.GetCamUserPolicyAttachmentsArgs{
UserId: pulumi.StringRef(fooTencentcloudCamUser.Id),
}, nil)
if err != nil {
return err
}
// query by user_id and policy_id
_, err = tencentcloud.GetCamUserPolicyAttachments(ctx, &tencentcloud.GetCamUserPolicyAttachmentsArgs{
UserId: pulumi.StringRef(fooTencentcloudCamUser.Id),
PolicyId: pulumi.StringRef(fooTencentcloudCamPolicy.Id),
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Tencentcloud = Pulumi.Tencentcloud;
return await Deployment.RunAsync(() =>
{
// query by user_id
var foo = Tencentcloud.GetCamUserPolicyAttachments.Invoke(new()
{
UserId = fooTencentcloudCamUser.Id,
});
// query by user_id and policy_id
var bar = Tencentcloud.GetCamUserPolicyAttachments.Invoke(new()
{
UserId = fooTencentcloudCamUser.Id,
PolicyId = fooTencentcloudCamPolicy.Id,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tencentcloud.TencentcloudFunctions;
import com.pulumi.tencentcloud.inputs.GetCamUserPolicyAttachmentsArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
// query by user_id
final var foo = TencentcloudFunctions.getCamUserPolicyAttachments(GetCamUserPolicyAttachmentsArgs.builder()
.userId(fooTencentcloudCamUser.id())
.build());
// query by user_id and policy_id
final var bar = TencentcloudFunctions.getCamUserPolicyAttachments(GetCamUserPolicyAttachmentsArgs.builder()
.userId(fooTencentcloudCamUser.id())
.policyId(fooTencentcloudCamPolicy.id())
.build());
}
}
variables:
# query by user_id
foo:
fn::invoke:
function: tencentcloud:getCamUserPolicyAttachments
arguments:
userId: ${fooTencentcloudCamUser.id}
# query by user_id and policy_id
bar:
fn::invoke:
function: tencentcloud:getCamUserPolicyAttachments
arguments:
userId: ${fooTencentcloudCamUser.id}
policyId: ${fooTencentcloudCamPolicy.id}
Using getCamUserPolicyAttachments
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getCamUserPolicyAttachments(args: GetCamUserPolicyAttachmentsArgs, opts?: InvokeOptions): Promise<GetCamUserPolicyAttachmentsResult>
function getCamUserPolicyAttachmentsOutput(args: GetCamUserPolicyAttachmentsOutputArgs, opts?: InvokeOptions): Output<GetCamUserPolicyAttachmentsResult>def get_cam_user_policy_attachments(create_mode: Optional[float] = None,
id: Optional[str] = None,
policy_id: Optional[str] = None,
policy_type: Optional[str] = None,
result_output_file: Optional[str] = None,
user_id: Optional[str] = None,
user_name: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetCamUserPolicyAttachmentsResult
def get_cam_user_policy_attachments_output(create_mode: Optional[pulumi.Input[float]] = None,
id: Optional[pulumi.Input[str]] = None,
policy_id: Optional[pulumi.Input[str]] = None,
policy_type: Optional[pulumi.Input[str]] = None,
result_output_file: Optional[pulumi.Input[str]] = None,
user_id: Optional[pulumi.Input[str]] = None,
user_name: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetCamUserPolicyAttachmentsResult]func GetCamUserPolicyAttachments(ctx *Context, args *GetCamUserPolicyAttachmentsArgs, opts ...InvokeOption) (*GetCamUserPolicyAttachmentsResult, error)
func GetCamUserPolicyAttachmentsOutput(ctx *Context, args *GetCamUserPolicyAttachmentsOutputArgs, opts ...InvokeOption) GetCamUserPolicyAttachmentsResultOutput> Note: This function is named GetCamUserPolicyAttachments in the Go SDK.
public static class GetCamUserPolicyAttachments
{
public static Task<GetCamUserPolicyAttachmentsResult> InvokeAsync(GetCamUserPolicyAttachmentsArgs args, InvokeOptions? opts = null)
public static Output<GetCamUserPolicyAttachmentsResult> Invoke(GetCamUserPolicyAttachmentsInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetCamUserPolicyAttachmentsResult> getCamUserPolicyAttachments(GetCamUserPolicyAttachmentsArgs args, InvokeOptions options)
public static Output<GetCamUserPolicyAttachmentsResult> getCamUserPolicyAttachments(GetCamUserPolicyAttachmentsArgs args, InvokeOptions options)
fn::invoke:
function: tencentcloud:index/getCamUserPolicyAttachments:getCamUserPolicyAttachments
arguments:
# arguments dictionaryThe following arguments are supported:
- Create
Mode double - Mode of Creation of the CAM user policy attachment.
1means the CAM policy attachment is created by production, and the others indicate syntax strategy ways. - Id string
- Policy
Id string - ID of CAM policy to be queried.
- Policy
Type string - Type of the policy strategy. 'User' means customer strategy and 'QCS' means preset strategy.
- Result
Output stringFile - Used to save results.
- User
Id string - It has been deprecated from version 1.59.6. Use
user_nameinstead. ID of the attached CAM user to be queried. - User
Name string - Name of the attached CAM user as unique key to be queried.
- Create
Mode float64 - Mode of Creation of the CAM user policy attachment.
1means the CAM policy attachment is created by production, and the others indicate syntax strategy ways. - Id string
- Policy
Id string - ID of CAM policy to be queried.
- Policy
Type string - Type of the policy strategy. 'User' means customer strategy and 'QCS' means preset strategy.
- Result
Output stringFile - Used to save results.
- User
Id string - It has been deprecated from version 1.59.6. Use
user_nameinstead. ID of the attached CAM user to be queried. - User
Name string - Name of the attached CAM user as unique key to be queried.
- create
Mode Double - Mode of Creation of the CAM user policy attachment.
1means the CAM policy attachment is created by production, and the others indicate syntax strategy ways. - id String
- policy
Id String - ID of CAM policy to be queried.
- policy
Type String - Type of the policy strategy. 'User' means customer strategy and 'QCS' means preset strategy.
- result
Output StringFile - Used to save results.
- user
Id String - It has been deprecated from version 1.59.6. Use
user_nameinstead. ID of the attached CAM user to be queried. - user
Name String - Name of the attached CAM user as unique key to be queried.
- create
Mode number - Mode of Creation of the CAM user policy attachment.
1means the CAM policy attachment is created by production, and the others indicate syntax strategy ways. - id string
- policy
Id string - ID of CAM policy to be queried.
- policy
Type string - Type of the policy strategy. 'User' means customer strategy and 'QCS' means preset strategy.
- result
Output stringFile - Used to save results.
- user
Id string - It has been deprecated from version 1.59.6. Use
user_nameinstead. ID of the attached CAM user to be queried. - user
Name string - Name of the attached CAM user as unique key to be queried.
- create_
mode float - Mode of Creation of the CAM user policy attachment.
1means the CAM policy attachment is created by production, and the others indicate syntax strategy ways. - id str
- policy_
id str - ID of CAM policy to be queried.
- policy_
type str - Type of the policy strategy. 'User' means customer strategy and 'QCS' means preset strategy.
- result_
output_ strfile - Used to save results.
- user_
id str - It has been deprecated from version 1.59.6. Use
user_nameinstead. ID of the attached CAM user to be queried. - user_
name str - Name of the attached CAM user as unique key to be queried.
- create
Mode Number - Mode of Creation of the CAM user policy attachment.
1means the CAM policy attachment is created by production, and the others indicate syntax strategy ways. - id String
- policy
Id String - ID of CAM policy to be queried.
- policy
Type String - Type of the policy strategy. 'User' means customer strategy and 'QCS' means preset strategy.
- result
Output StringFile - Used to save results.
- user
Id String - It has been deprecated from version 1.59.6. Use
user_nameinstead. ID of the attached CAM user to be queried. - user
Name String - Name of the attached CAM user as unique key to be queried.
getCamUserPolicyAttachments Result
The following output properties are available:
- Id string
- User
Policy List<GetAttachment Lists Cam User Policy Attachments User Policy Attachment List> - A list of CAM user policy attachments. Each element contains the following attributes:
- Create
Mode double - Mode of Creation of the CAM user policy attachment.
1means the cam policy attachment is created by production, and the others indicate syntax strategy ways. - Policy
Id string - Name of CAM user.
- Policy
Type string - Type of the policy strategy. 'User' means customer strategy and 'QCS' means preset strategy.
- Result
Output stringFile - User
Id string - (Deprecated) It has been deprecated from version 1.59.6. Use
user_nameinstead. ID of CAM user. - User
Name string - Name of CAM user as unique key.
- Id string
- User
Policy []GetAttachment Lists Cam User Policy Attachments User Policy Attachment List - A list of CAM user policy attachments. Each element contains the following attributes:
- Create
Mode float64 - Mode of Creation of the CAM user policy attachment.
1means the cam policy attachment is created by production, and the others indicate syntax strategy ways. - Policy
Id string - Name of CAM user.
- Policy
Type string - Type of the policy strategy. 'User' means customer strategy and 'QCS' means preset strategy.
- Result
Output stringFile - User
Id string - (Deprecated) It has been deprecated from version 1.59.6. Use
user_nameinstead. ID of CAM user. - User
Name string - Name of CAM user as unique key.
- id String
- user
Policy List<GetAttachment Lists Cam User Policy Attachments User Policy Attachment List> - A list of CAM user policy attachments. Each element contains the following attributes:
- create
Mode Double - Mode of Creation of the CAM user policy attachment.
1means the cam policy attachment is created by production, and the others indicate syntax strategy ways. - policy
Id String - Name of CAM user.
- policy
Type String - Type of the policy strategy. 'User' means customer strategy and 'QCS' means preset strategy.
- result
Output StringFile - user
Id String - (Deprecated) It has been deprecated from version 1.59.6. Use
user_nameinstead. ID of CAM user. - user
Name String - Name of CAM user as unique key.
- id string
- user
Policy GetAttachment Lists Cam User Policy Attachments User Policy Attachment List[] - A list of CAM user policy attachments. Each element contains the following attributes:
- create
Mode number - Mode of Creation of the CAM user policy attachment.
1means the cam policy attachment is created by production, and the others indicate syntax strategy ways. - policy
Id string - Name of CAM user.
- policy
Type string - Type of the policy strategy. 'User' means customer strategy and 'QCS' means preset strategy.
- result
Output stringFile - user
Id string - (Deprecated) It has been deprecated from version 1.59.6. Use
user_nameinstead. ID of CAM user. - user
Name string - Name of CAM user as unique key.
- id str
- user_
policy_ Sequence[Getattachment_ lists Cam User Policy Attachments User Policy Attachment List] - A list of CAM user policy attachments. Each element contains the following attributes:
- create_
mode float - Mode of Creation of the CAM user policy attachment.
1means the cam policy attachment is created by production, and the others indicate syntax strategy ways. - policy_
id str - Name of CAM user.
- policy_
type str - Type of the policy strategy. 'User' means customer strategy and 'QCS' means preset strategy.
- result_
output_ strfile - user_
id str - (Deprecated) It has been deprecated from version 1.59.6. Use
user_nameinstead. ID of CAM user. - user_
name str - Name of CAM user as unique key.
- id String
- user
Policy List<Property Map>Attachment Lists - A list of CAM user policy attachments. Each element contains the following attributes:
- create
Mode Number - Mode of Creation of the CAM user policy attachment.
1means the cam policy attachment is created by production, and the others indicate syntax strategy ways. - policy
Id String - Name of CAM user.
- policy
Type String - Type of the policy strategy. 'User' means customer strategy and 'QCS' means preset strategy.
- result
Output StringFile - user
Id String - (Deprecated) It has been deprecated from version 1.59.6. Use
user_nameinstead. ID of CAM user. - user
Name String - Name of CAM user as unique key.
Supporting Types
GetCamUserPolicyAttachmentsUserPolicyAttachmentList
- Create
Mode double - Mode of Creation of the CAM user policy attachment.
1means the CAM policy attachment is created by production, and the others indicate syntax strategy ways. - Create
Time string - The create time of the CAM user policy attachment.
- Policy
Id string - ID of CAM policy to be queried.
- Policy
Name string - The name of the policy.
- Policy
Type string - Type of the policy strategy. 'User' means customer strategy and 'QCS' means preset strategy.
- User
Id string - It has been deprecated from version 1.59.6. Use
user_nameinstead. ID of the attached CAM user to be queried. - User
Name string - Name of the attached CAM user as unique key to be queried.
- Create
Mode float64 - Mode of Creation of the CAM user policy attachment.
1means the CAM policy attachment is created by production, and the others indicate syntax strategy ways. - Create
Time string - The create time of the CAM user policy attachment.
- Policy
Id string - ID of CAM policy to be queried.
- Policy
Name string - The name of the policy.
- Policy
Type string - Type of the policy strategy. 'User' means customer strategy and 'QCS' means preset strategy.
- User
Id string - It has been deprecated from version 1.59.6. Use
user_nameinstead. ID of the attached CAM user to be queried. - User
Name string - Name of the attached CAM user as unique key to be queried.
- create
Mode Double - Mode of Creation of the CAM user policy attachment.
1means the CAM policy attachment is created by production, and the others indicate syntax strategy ways. - create
Time String - The create time of the CAM user policy attachment.
- policy
Id String - ID of CAM policy to be queried.
- policy
Name String - The name of the policy.
- policy
Type String - Type of the policy strategy. 'User' means customer strategy and 'QCS' means preset strategy.
- user
Id String - It has been deprecated from version 1.59.6. Use
user_nameinstead. ID of the attached CAM user to be queried. - user
Name String - Name of the attached CAM user as unique key to be queried.
- create
Mode number - Mode of Creation of the CAM user policy attachment.
1means the CAM policy attachment is created by production, and the others indicate syntax strategy ways. - create
Time string - The create time of the CAM user policy attachment.
- policy
Id string - ID of CAM policy to be queried.
- policy
Name string - The name of the policy.
- policy
Type string - Type of the policy strategy. 'User' means customer strategy and 'QCS' means preset strategy.
- user
Id string - It has been deprecated from version 1.59.6. Use
user_nameinstead. ID of the attached CAM user to be queried. - user
Name string - Name of the attached CAM user as unique key to be queried.
- create_
mode float - Mode of Creation of the CAM user policy attachment.
1means the CAM policy attachment is created by production, and the others indicate syntax strategy ways. - create_
time str - The create time of the CAM user policy attachment.
- policy_
id str - ID of CAM policy to be queried.
- policy_
name str - The name of the policy.
- policy_
type str - Type of the policy strategy. 'User' means customer strategy and 'QCS' means preset strategy.
- user_
id str - It has been deprecated from version 1.59.6. Use
user_nameinstead. ID of the attached CAM user to be queried. - user_
name str - Name of the attached CAM user as unique key to be queried.
- create
Mode Number - Mode of Creation of the CAM user policy attachment.
1means the CAM policy attachment is created by production, and the others indicate syntax strategy ways. - create
Time String - The create time of the CAM user policy attachment.
- policy
Id String - ID of CAM policy to be queried.
- policy
Name String - The name of the policy.
- policy
Type String - Type of the policy strategy. 'User' means customer strategy and 'QCS' means preset strategy.
- user
Id String - It has been deprecated from version 1.59.6. Use
user_nameinstead. ID of the attached CAM user to be queried. - user
Name String - Name of the attached CAM user as unique key to be queried.
Package Details
- Repository
- tencentcloud tencentcloudstack/terraform-provider-tencentcloud
- License
- Notes
- This Pulumi package is based on the
tencentcloudTerraform Provider.
tencentcloud 1.82.34 published on Wednesday, Nov 5, 2025 by tencentcloudstack
