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

tencentcloud.getCamRolePolicyAttachments

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 role policy attachments

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const foo = tencentcloud.getCamRolePolicyAttachments({
        roleId: tencentcloud_cam_role.foo.id,
    });
    const bar = tencentcloud.getCamRolePolicyAttachments({
        roleId: tencentcloud_cam_role.foo.id,
        policyId: tencentcloud_cam_policy.foo.id,
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    foo = tencentcloud.get_cam_role_policy_attachments(role_id=tencentcloud_cam_role["foo"]["id"])
    bar = tencentcloud.get_cam_role_policy_attachments(role_id=tencentcloud_cam_role["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.GetCamRolePolicyAttachments(ctx, &tencentcloud.GetCamRolePolicyAttachmentsArgs{
    			RoleId: tencentcloud_cam_role.Foo.Id,
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = tencentcloud.GetCamRolePolicyAttachments(ctx, &tencentcloud.GetCamRolePolicyAttachmentsArgs{
    			RoleId:   tencentcloud_cam_role.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.GetCamRolePolicyAttachments.Invoke(new()
        {
            RoleId = tencentcloud_cam_role.Foo.Id,
        });
    
        var bar = Tencentcloud.GetCamRolePolicyAttachments.Invoke(new()
        {
            RoleId = tencentcloud_cam_role.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.GetCamRolePolicyAttachmentsArgs;
    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.getCamRolePolicyAttachments(GetCamRolePolicyAttachmentsArgs.builder()
                .roleId(tencentcloud_cam_role.foo().id())
                .build());
    
            final var bar = TencentcloudFunctions.getCamRolePolicyAttachments(GetCamRolePolicyAttachmentsArgs.builder()
                .roleId(tencentcloud_cam_role.foo().id())
                .policyId(tencentcloud_cam_policy.foo().id())
                .build());
    
        }
    }
    
    variables:
      foo:
        fn::invoke:
          function: tencentcloud:getCamRolePolicyAttachments
          arguments:
            roleId: ${tencentcloud_cam_role.foo.id}
      bar:
        fn::invoke:
          function: tencentcloud:getCamRolePolicyAttachments
          arguments:
            roleId: ${tencentcloud_cam_role.foo.id}
            policyId: ${tencentcloud_cam_policy.foo.id}
    

    Using getCamRolePolicyAttachments

    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 getCamRolePolicyAttachments(args: GetCamRolePolicyAttachmentsArgs, opts?: InvokeOptions): Promise<GetCamRolePolicyAttachmentsResult>
    function getCamRolePolicyAttachmentsOutput(args: GetCamRolePolicyAttachmentsOutputArgs, opts?: InvokeOptions): Output<GetCamRolePolicyAttachmentsResult>
    def get_cam_role_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,
                                        role_id: Optional[str] = None,
                                        opts: Optional[InvokeOptions] = None) -> GetCamRolePolicyAttachmentsResult
    def get_cam_role_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,
                                        role_id: Optional[pulumi.Input[str]] = None,
                                        opts: Optional[InvokeOptions] = None) -> Output[GetCamRolePolicyAttachmentsResult]
    func GetCamRolePolicyAttachments(ctx *Context, args *GetCamRolePolicyAttachmentsArgs, opts ...InvokeOption) (*GetCamRolePolicyAttachmentsResult, error)
    func GetCamRolePolicyAttachmentsOutput(ctx *Context, args *GetCamRolePolicyAttachmentsOutputArgs, opts ...InvokeOption) GetCamRolePolicyAttachmentsResultOutput

    > Note: This function is named GetCamRolePolicyAttachments in the Go SDK.

    public static class GetCamRolePolicyAttachments 
    {
        public static Task<GetCamRolePolicyAttachmentsResult> InvokeAsync(GetCamRolePolicyAttachmentsArgs args, InvokeOptions? opts = null)
        public static Output<GetCamRolePolicyAttachmentsResult> Invoke(GetCamRolePolicyAttachmentsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetCamRolePolicyAttachmentsResult> getCamRolePolicyAttachments(GetCamRolePolicyAttachmentsArgs args, InvokeOptions options)
    public static Output<GetCamRolePolicyAttachmentsResult> getCamRolePolicyAttachments(GetCamRolePolicyAttachmentsArgs args, InvokeOptions options)
    
    fn::invoke:
      function: tencentcloud:index/getCamRolePolicyAttachments:getCamRolePolicyAttachments
      arguments:
        # arguments dictionary

    The following arguments are supported:

    RoleId string
    ID of the attached CAM role 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. Valid values are 'User', 'QCS'. 'User' means customer strategy and 'QCS' means preset strategy.
    ResultOutputFile string
    Used to save results.
    RoleId string
    ID of the attached CAM role 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. Valid values are 'User', 'QCS'. 'User' means customer strategy and 'QCS' means preset strategy.
    ResultOutputFile string
    Used to save results.
    roleId String
    ID of the attached CAM role 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. Valid values are 'User', 'QCS'. 'User' means customer strategy and 'QCS' means preset strategy.
    resultOutputFile String
    Used to save results.
    roleId string
    ID of the attached CAM role 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. Valid values are 'User', 'QCS'. 'User' means customer strategy and 'QCS' means preset strategy.
    resultOutputFile string
    Used to save results.
    role_id str
    ID of the attached CAM role 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. Valid values are 'User', 'QCS'. 'User' means customer strategy and 'QCS' means preset strategy.
    result_output_file str
    Used to save results.
    roleId String
    ID of the attached CAM role 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. Valid values are 'User', 'QCS'. 'User' means customer strategy and 'QCS' means preset strategy.
    resultOutputFile String
    Used to save results.

    getCamRolePolicyAttachments Result

    The following output properties are available:

    Id string
    RoleId string
    ID of CAM role.
    RolePolicyAttachmentLists List<GetCamRolePolicyAttachmentsRolePolicyAttachmentList>
    A list of CAM role policy attachments. Each element contains the following attributes:
    CreateMode double
    Mode of Creation of the CAM role policy attachment. 1 means the cam policy attachment is created by production, and the others indicate syntax strategy ways.
    PolicyId string
    Name of CAM role.
    PolicyType string
    Type of the policy strategy. 'User' means customer strategy and 'QCS' means preset strategy.
    ResultOutputFile string
    Id string
    RoleId string
    ID of CAM role.
    RolePolicyAttachmentLists []GetCamRolePolicyAttachmentsRolePolicyAttachmentList
    A list of CAM role policy attachments. Each element contains the following attributes:
    CreateMode float64
    Mode of Creation of the CAM role policy attachment. 1 means the cam policy attachment is created by production, and the others indicate syntax strategy ways.
    PolicyId string
    Name of CAM role.
    PolicyType string
    Type of the policy strategy. 'User' means customer strategy and 'QCS' means preset strategy.
    ResultOutputFile string
    id String
    roleId String
    ID of CAM role.
    rolePolicyAttachmentLists List<GetCamRolePolicyAttachmentsRolePolicyAttachmentList>
    A list of CAM role policy attachments. Each element contains the following attributes:
    createMode Double
    Mode of Creation of the CAM role policy attachment. 1 means the cam policy attachment is created by production, and the others indicate syntax strategy ways.
    policyId String
    Name of CAM role.
    policyType String
    Type of the policy strategy. 'User' means customer strategy and 'QCS' means preset strategy.
    resultOutputFile String
    id string
    roleId string
    ID of CAM role.
    rolePolicyAttachmentLists GetCamRolePolicyAttachmentsRolePolicyAttachmentList[]
    A list of CAM role policy attachments. Each element contains the following attributes:
    createMode number
    Mode of Creation of the CAM role policy attachment. 1 means the cam policy attachment is created by production, and the others indicate syntax strategy ways.
    policyId string
    Name of CAM role.
    policyType string
    Type of the policy strategy. 'User' means customer strategy and 'QCS' means preset strategy.
    resultOutputFile string
    id str
    role_id str
    ID of CAM role.
    role_policy_attachment_lists Sequence[GetCamRolePolicyAttachmentsRolePolicyAttachmentList]
    A list of CAM role policy attachments. Each element contains the following attributes:
    create_mode float
    Mode of Creation of the CAM role 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 role.
    policy_type str
    Type of the policy strategy. 'User' means customer strategy and 'QCS' means preset strategy.
    result_output_file str
    id String
    roleId String
    ID of CAM role.
    rolePolicyAttachmentLists List<Property Map>
    A list of CAM role policy attachments. Each element contains the following attributes:
    createMode Number
    Mode of Creation of the CAM role policy attachment. 1 means the cam policy attachment is created by production, and the others indicate syntax strategy ways.
    policyId String
    Name of CAM role.
    policyType String
    Type of the policy strategy. 'User' means customer strategy and 'QCS' means preset strategy.
    resultOutputFile String

    Supporting Types

    GetCamRolePolicyAttachmentsRolePolicyAttachmentList

    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
    Create time of the CAM role policy attachment.
    PolicyId string
    ID of CAM policy to be queried.
    PolicyName string
    Name of the policy.
    PolicyType string
    Type of the policy strategy. Valid values are 'User', 'QCS'. 'User' means customer strategy and 'QCS' means preset strategy.
    RoleId string
    ID of the attached CAM role 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
    Create time of the CAM role policy attachment.
    PolicyId string
    ID of CAM policy to be queried.
    PolicyName string
    Name of the policy.
    PolicyType string
    Type of the policy strategy. Valid values are 'User', 'QCS'. 'User' means customer strategy and 'QCS' means preset strategy.
    RoleId string
    ID of the attached CAM role 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
    Create time of the CAM role policy attachment.
    policyId String
    ID of CAM policy to be queried.
    policyName String
    Name of the policy.
    policyType String
    Type of the policy strategy. Valid values are 'User', 'QCS'. 'User' means customer strategy and 'QCS' means preset strategy.
    roleId String
    ID of the attached CAM role 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
    Create time of the CAM role policy attachment.
    policyId string
    ID of CAM policy to be queried.
    policyName string
    Name of the policy.
    policyType string
    Type of the policy strategy. Valid values are 'User', 'QCS'. 'User' means customer strategy and 'QCS' means preset strategy.
    roleId string
    ID of the attached CAM role 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
    Create time of the CAM role policy attachment.
    policy_id str
    ID of CAM policy to be queried.
    policy_name str
    Name of the policy.
    policy_type str
    Type of the policy strategy. Valid values are 'User', 'QCS'. 'User' means customer strategy and 'QCS' means preset strategy.
    role_id str
    ID of the attached CAM role 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
    Create time of the CAM role policy attachment.
    policyId String
    ID of CAM policy to be queried.
    policyName String
    Name of the policy.
    policyType String
    Type of the policy strategy. Valid values are 'User', 'QCS'. 'User' means customer strategy and 'QCS' means preset strategy.
    roleId String
    ID of the attached CAM role 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