1. Packages
  2. Tencentcloud Provider
  3. API Docs
  4. getCamUserPolicyAttachments
tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack

tencentcloud.getCamUserPolicyAttachments

Explore with Pulumi AI

tencentcloud logo
tencentcloud 1.81.189 published on Wednesday, Apr 30, 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";
    
    const foo = tencentcloud.getCamUserPolicyAttachments({
        userId: tencentcloud_cam_user.foo.id,
    });
    const bar = tencentcloud.getCamUserPolicyAttachments({
        userId: tencentcloud_cam_user.foo.id,
        policyId: tencentcloud_cam_policy.foo.id,
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    foo = tencentcloud.get_cam_user_policy_attachments(user_id=tencentcloud_cam_user["foo"]["id"])
    bar = tencentcloud.get_cam_user_policy_attachments(user_id=tencentcloud_cam_user["foo"]["id"],
        policy_id=tencentcloud_cam_policy["foo"]["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 {
    		_, err := tencentcloud.GetCamUserPolicyAttachments(ctx, &tencentcloud.GetCamUserPolicyAttachmentsArgs{
    			UserId: pulumi.StringRef(tencentcloud_cam_user.Foo.Id),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = tencentcloud.GetCamUserPolicyAttachments(ctx, &tencentcloud.GetCamUserPolicyAttachmentsArgs{
    			UserId:   pulumi.StringRef(tencentcloud_cam_user.Foo.Id),
    			PolicyId: pulumi.StringRef(tencentcloud_cam_policy.Foo.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(() => 
    {
        var foo = Tencentcloud.GetCamUserPolicyAttachments.Invoke(new()
        {
            UserId = tencentcloud_cam_user.Foo.Id,
        });
    
        var bar = Tencentcloud.GetCamUserPolicyAttachments.Invoke(new()
        {
            UserId = tencentcloud_cam_user.Foo.Id,
            PolicyId = tencentcloud_cam_policy.Foo.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) {
            final var foo = TencentcloudFunctions.getCamUserPolicyAttachments(GetCamUserPolicyAttachmentsArgs.builder()
                .userId(tencentcloud_cam_user.foo().id())
                .build());
    
            final var bar = TencentcloudFunctions.getCamUserPolicyAttachments(GetCamUserPolicyAttachmentsArgs.builder()
                .userId(tencentcloud_cam_user.foo().id())
                .policyId(tencentcloud_cam_policy.foo().id())
                .build());
    
        }
    }
    
    variables:
      foo:
        fn::invoke:
          function: tencentcloud:getCamUserPolicyAttachments
          arguments:
            userId: ${tencentcloud_cam_user.foo.id}
      bar:
        fn::invoke:
          function: tencentcloud:getCamUserPolicyAttachments
          arguments:
            userId: ${tencentcloud_cam_user.foo.id}
            policyId: ${tencentcloud_cam_policy.foo.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 dictionary

    The following arguments are supported:

    CreateMode double
    Mode of Creation of the CAM user policy attachment. 1 means the CAM policy attachment is created by production, and the others indicate syntax strategy ways.
    Id string
    PolicyId string
    ID of CAM policy to be queried.
    PolicyType string
    Type of the policy strategy. 'User' means customer strategy and 'QCS' means preset strategy.
    ResultOutputFile string
    Used to save results.
    UserId string
    It has been deprecated from version 1.59.6. Use user_name instead. ID of the attached CAM user to be queried.

    Deprecated: Deprecated

    UserName string
    Name of the attached CAM user as unique key to be queried.
    CreateMode float64
    Mode of Creation of the CAM user policy attachment. 1 means the CAM policy attachment is created by production, and the others indicate syntax strategy ways.
    Id string
    PolicyId string
    ID of CAM policy to be queried.
    PolicyType string
    Type of the policy strategy. 'User' means customer strategy and 'QCS' means preset strategy.
    ResultOutputFile string
    Used to save results.
    UserId string
    It has been deprecated from version 1.59.6. Use user_name instead. ID of the attached CAM user to be queried.

    Deprecated: Deprecated

    UserName string
    Name of the attached CAM user as unique key to be queried.
    createMode Double
    Mode of Creation of the CAM user policy attachment. 1 means the CAM policy attachment is created by production, and the others indicate syntax strategy ways.
    id String
    policyId String
    ID of CAM policy to be queried.
    policyType String
    Type of the policy strategy. 'User' means customer strategy and 'QCS' means preset strategy.
    resultOutputFile String
    Used to save results.
    userId String
    It has been deprecated from version 1.59.6. Use user_name instead. ID of the attached CAM user to be queried.

    Deprecated: Deprecated

    userName String
    Name of the attached CAM user as unique key to be queried.
    createMode number
    Mode of Creation of the CAM user policy attachment. 1 means the CAM policy attachment is created by production, and the others indicate syntax strategy ways.
    id string
    policyId string
    ID of CAM policy to be queried.
    policyType string
    Type of the policy strategy. 'User' means customer strategy and 'QCS' means preset strategy.
    resultOutputFile string
    Used to save results.
    userId string
    It has been deprecated from version 1.59.6. Use user_name instead. ID of the attached CAM user to be queried.

    Deprecated: Deprecated

    userName 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. 1 means 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_file str
    Used to save results.
    user_id str
    It has been deprecated from version 1.59.6. Use user_name instead. ID of the attached CAM user to be queried.

    Deprecated: Deprecated

    user_name str
    Name of the attached CAM user as unique key to be queried.
    createMode Number
    Mode of Creation of the CAM user policy attachment. 1 means the CAM policy attachment is created by production, and the others indicate syntax strategy ways.
    id String
    policyId String
    ID of CAM policy to be queried.
    policyType String
    Type of the policy strategy. 'User' means customer strategy and 'QCS' means preset strategy.
    resultOutputFile String
    Used to save results.
    userId String
    It has been deprecated from version 1.59.6. Use user_name instead. ID of the attached CAM user to be queried.

    Deprecated: Deprecated

    userName String
    Name of the attached CAM user as unique key to be queried.

    getCamUserPolicyAttachments Result

    The following output properties are available:

    Id string
    UserPolicyAttachmentLists List<GetCamUserPolicyAttachmentsUserPolicyAttachmentList>
    A list of CAM user policy attachments. Each element contains the following attributes:
    CreateMode double
    Mode of Creation of the CAM user policy attachment. 1 means the cam policy attachment is created by production, and the others indicate syntax strategy ways.
    PolicyId string
    Name of CAM user.
    PolicyType string
    Type of the policy strategy. 'User' means customer strategy and 'QCS' means preset strategy.
    ResultOutputFile string
    UserId string
    (Deprecated) It has been deprecated from version 1.59.6. Use user_name instead. ID of CAM user.

    Deprecated: Deprecated

    UserName string
    Name of CAM user as unique key.
    Id string
    UserPolicyAttachmentLists []GetCamUserPolicyAttachmentsUserPolicyAttachmentList
    A list of CAM user policy attachments. Each element contains the following attributes:
    CreateMode float64
    Mode of Creation of the CAM user policy attachment. 1 means the cam policy attachment is created by production, and the others indicate syntax strategy ways.
    PolicyId string
    Name of CAM user.
    PolicyType string
    Type of the policy strategy. 'User' means customer strategy and 'QCS' means preset strategy.
    ResultOutputFile string
    UserId string
    (Deprecated) It has been deprecated from version 1.59.6. Use user_name instead. ID of CAM user.

    Deprecated: Deprecated

    UserName string
    Name of CAM user as unique key.
    id String
    userPolicyAttachmentLists List<GetCamUserPolicyAttachmentsUserPolicyAttachmentList>
    A list of CAM user policy attachments. Each element contains the following attributes:
    createMode Double
    Mode of Creation of the CAM user policy attachment. 1 means the cam policy attachment is created by production, and the others indicate syntax strategy ways.
    policyId String
    Name of CAM user.
    policyType String
    Type of the policy strategy. 'User' means customer strategy and 'QCS' means preset strategy.
    resultOutputFile String
    userId String
    (Deprecated) It has been deprecated from version 1.59.6. Use user_name instead. ID of CAM user.

    Deprecated: Deprecated

    userName String
    Name of CAM user as unique key.
    id string
    userPolicyAttachmentLists GetCamUserPolicyAttachmentsUserPolicyAttachmentList[]
    A list of CAM user policy attachments. Each element contains the following attributes:
    createMode number
    Mode of Creation of the CAM user policy attachment. 1 means the cam policy attachment is created by production, and the others indicate syntax strategy ways.
    policyId string
    Name of CAM user.
    policyType string
    Type of the policy strategy. 'User' means customer strategy and 'QCS' means preset strategy.
    resultOutputFile string
    userId string
    (Deprecated) It has been deprecated from version 1.59.6. Use user_name instead. ID of CAM user.

    Deprecated: Deprecated

    userName string
    Name of CAM user as unique key.
    id str
    user_policy_attachment_lists Sequence[GetCamUserPolicyAttachmentsUserPolicyAttachmentList]
    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. 1 means 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_file str
    user_id str
    (Deprecated) It has been deprecated from version 1.59.6. Use user_name instead. ID of CAM user.

    Deprecated: Deprecated

    user_name str
    Name of CAM user as unique key.
    id String
    userPolicyAttachmentLists List<Property Map>
    A list of CAM user policy attachments. Each element contains the following attributes:
    createMode Number
    Mode of Creation of the CAM user policy attachment. 1 means the cam policy attachment is created by production, and the others indicate syntax strategy ways.
    policyId String
    Name of CAM user.
    policyType String
    Type of the policy strategy. 'User' means customer strategy and 'QCS' means preset strategy.
    resultOutputFile String
    userId String
    (Deprecated) It has been deprecated from version 1.59.6. Use user_name instead. ID of CAM user.

    Deprecated: Deprecated

    userName String
    Name of CAM user as unique key.

    Supporting Types

    GetCamUserPolicyAttachmentsUserPolicyAttachmentList

    CreateMode double
    Mode of Creation of the CAM user policy attachment. 1 means the CAM policy attachment is created by production, and the others indicate syntax strategy ways.
    CreateTime string
    The create time of the CAM user policy attachment.
    PolicyId string
    ID of CAM policy to be queried.
    PolicyName string
    The name of the policy.
    PolicyType string
    Type of the policy strategy. 'User' means customer strategy and 'QCS' means preset strategy.
    UserId string
    It has been deprecated from version 1.59.6. Use user_name instead. ID of the attached CAM user to be queried.
    UserName string
    Name of the attached CAM user as unique key to be queried.
    CreateMode float64
    Mode of Creation of the CAM user policy attachment. 1 means the CAM policy attachment is created by production, and the others indicate syntax strategy ways.
    CreateTime string
    The create time of the CAM user policy attachment.
    PolicyId string
    ID of CAM policy to be queried.
    PolicyName string
    The name of the policy.
    PolicyType string
    Type of the policy strategy. 'User' means customer strategy and 'QCS' means preset strategy.
    UserId string
    It has been deprecated from version 1.59.6. Use user_name instead. ID of the attached CAM user to be queried.
    UserName string
    Name of the attached CAM user as unique key to be queried.
    createMode Double
    Mode of Creation of the CAM user policy attachment. 1 means the CAM policy attachment is created by production, and the others indicate syntax strategy ways.
    createTime String
    The create time of the CAM user policy attachment.
    policyId String
    ID of CAM policy to be queried.
    policyName String
    The name of the policy.
    policyType String
    Type of the policy strategy. 'User' means customer strategy and 'QCS' means preset strategy.
    userId String
    It has been deprecated from version 1.59.6. Use user_name instead. ID of the attached CAM user to be queried.
    userName String
    Name of the attached CAM user as unique key to be queried.
    createMode number
    Mode of Creation of the CAM user policy attachment. 1 means the CAM policy attachment is created by production, and the others indicate syntax strategy ways.
    createTime string
    The create time of the CAM user policy attachment.
    policyId string
    ID of CAM policy to be queried.
    policyName string
    The name of the policy.
    policyType string
    Type of the policy strategy. 'User' means customer strategy and 'QCS' means preset strategy.
    userId string
    It has been deprecated from version 1.59.6. Use user_name instead. ID of the attached CAM user to be queried.
    userName 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. 1 means 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_name instead. ID of the attached CAM user to be queried.
    user_name str
    Name of the attached CAM user as unique key to be queried.
    createMode Number
    Mode of Creation of the CAM user policy attachment. 1 means the CAM policy attachment is created by production, and the others indicate syntax strategy ways.
    createTime String
    The create time of the CAM user policy attachment.
    policyId String
    ID of CAM policy to be queried.
    policyName String
    The name of the policy.
    policyType String
    Type of the policy strategy. 'User' means customer strategy and 'QCS' means preset strategy.
    userId String
    It has been deprecated from version 1.59.6. Use user_name instead. ID of the attached CAM user to be queried.
    userName 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 tencentcloud Terraform Provider.
    tencentcloud logo
    tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack