1. Packages
  2. Tencentcloud Provider
  3. API Docs
  4. getCamRoles
tencentcloud 1.82.34 published on Wednesday, Nov 5, 2025 by tencentcloudstack

tencentcloud.getCamRoles

Start a Neo task
Explain and create a tencentcloud.getCamRoles resource
tencentcloud logo
tencentcloud 1.82.34 published on Wednesday, Nov 5, 2025 by tencentcloudstack

    Use this data source to query detailed information of CAM roles

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    // query by role_id
    const foo = tencentcloud.getCamRoles({
        roleId: fooTencentcloudCamRole.id,
    });
    // query by name
    const bar = tencentcloud.getCamRoles({
        name: "cam-role-test",
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    # query by role_id
    foo = tencentcloud.get_cam_roles(role_id=foo_tencentcloud_cam_role["id"])
    # query by name
    bar = tencentcloud.get_cam_roles(name="cam-role-test")
    
    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 role_id
    		_, err := tencentcloud.GetCamRoles(ctx, &tencentcloud.GetCamRolesArgs{
    			RoleId: pulumi.StringRef(fooTencentcloudCamRole.Id),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		// query by name
    		_, err = tencentcloud.GetCamRoles(ctx, &tencentcloud.GetCamRolesArgs{
    			Name: pulumi.StringRef("cam-role-test"),
    		}, 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 role_id
        var foo = Tencentcloud.GetCamRoles.Invoke(new()
        {
            RoleId = fooTencentcloudCamRole.Id,
        });
    
        // query by name
        var bar = Tencentcloud.GetCamRoles.Invoke(new()
        {
            Name = "cam-role-test",
        });
    
    });
    
    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.GetCamRolesArgs;
    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 role_id
            final var foo = TencentcloudFunctions.getCamRoles(GetCamRolesArgs.builder()
                .roleId(fooTencentcloudCamRole.id())
                .build());
    
            // query by name
            final var bar = TencentcloudFunctions.getCamRoles(GetCamRolesArgs.builder()
                .name("cam-role-test")
                .build());
    
        }
    }
    
    variables:
      # query by role_id
      foo:
        fn::invoke:
          function: tencentcloud:getCamRoles
          arguments:
            roleId: ${fooTencentcloudCamRole.id}
      # query by name
      bar:
        fn::invoke:
          function: tencentcloud:getCamRoles
          arguments:
            name: cam-role-test
    

    Using getCamRoles

    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 getCamRoles(args: GetCamRolesArgs, opts?: InvokeOptions): Promise<GetCamRolesResult>
    function getCamRolesOutput(args: GetCamRolesOutputArgs, opts?: InvokeOptions): Output<GetCamRolesResult>
    def get_cam_roles(description: Optional[str] = None,
                      id: Optional[str] = None,
                      name: Optional[str] = None,
                      result_output_file: Optional[str] = None,
                      role_id: Optional[str] = None,
                      opts: Optional[InvokeOptions] = None) -> GetCamRolesResult
    def get_cam_roles_output(description: Optional[pulumi.Input[str]] = None,
                      id: Optional[pulumi.Input[str]] = None,
                      name: 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[GetCamRolesResult]
    func GetCamRoles(ctx *Context, args *GetCamRolesArgs, opts ...InvokeOption) (*GetCamRolesResult, error)
    func GetCamRolesOutput(ctx *Context, args *GetCamRolesOutputArgs, opts ...InvokeOption) GetCamRolesResultOutput

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

    public static class GetCamRoles 
    {
        public static Task<GetCamRolesResult> InvokeAsync(GetCamRolesArgs args, InvokeOptions? opts = null)
        public static Output<GetCamRolesResult> Invoke(GetCamRolesInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetCamRolesResult> getCamRoles(GetCamRolesArgs args, InvokeOptions options)
    public static Output<GetCamRolesResult> getCamRoles(GetCamRolesArgs args, InvokeOptions options)
    
    fn::invoke:
      function: tencentcloud:index/getCamRoles:getCamRoles
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Description string
    The description of the CAM role to be queried.
    Id string
    Name string
    Name of the CAM policy to be queried.
    ResultOutputFile string
    Used to save results.
    RoleId string
    ID of the CAM role to be queried.
    Description string
    The description of the CAM role to be queried.
    Id string
    Name string
    Name of the CAM policy to be queried.
    ResultOutputFile string
    Used to save results.
    RoleId string
    ID of the CAM role to be queried.
    description String
    The description of the CAM role to be queried.
    id String
    name String
    Name of the CAM policy to be queried.
    resultOutputFile String
    Used to save results.
    roleId String
    ID of the CAM role to be queried.
    description string
    The description of the CAM role to be queried.
    id string
    name string
    Name of the CAM policy to be queried.
    resultOutputFile string
    Used to save results.
    roleId string
    ID of the CAM role to be queried.
    description str
    The description of the CAM role to be queried.
    id str
    name str
    Name of the CAM policy to be queried.
    result_output_file str
    Used to save results.
    role_id str
    ID of the CAM role to be queried.
    description String
    The description of the CAM role to be queried.
    id String
    name String
    Name of the CAM policy to be queried.
    resultOutputFile String
    Used to save results.
    roleId String
    ID of the CAM role to be queried.

    getCamRoles Result

    The following output properties are available:

    Id string
    RoleLists List<GetCamRolesRoleList>
    A list of CAM roles. Each element contains the following attributes:
    Description string
    Description of CAM role.
    Name string
    Name of CAM role.
    ResultOutputFile string
    RoleId string
    Id of CAM role.
    Id string
    RoleLists []GetCamRolesRoleList
    A list of CAM roles. Each element contains the following attributes:
    Description string
    Description of CAM role.
    Name string
    Name of CAM role.
    ResultOutputFile string
    RoleId string
    Id of CAM role.
    id String
    roleLists List<GetCamRolesRoleList>
    A list of CAM roles. Each element contains the following attributes:
    description String
    Description of CAM role.
    name String
    Name of CAM role.
    resultOutputFile String
    roleId String
    Id of CAM role.
    id string
    roleLists GetCamRolesRoleList[]
    A list of CAM roles. Each element contains the following attributes:
    description string
    Description of CAM role.
    name string
    Name of CAM role.
    resultOutputFile string
    roleId string
    Id of CAM role.
    id str
    role_lists Sequence[GetCamRolesRoleList]
    A list of CAM roles. Each element contains the following attributes:
    description str
    Description of CAM role.
    name str
    Name of CAM role.
    result_output_file str
    role_id str
    Id of CAM role.
    id String
    roleLists List<Property Map>
    A list of CAM roles. Each element contains the following attributes:
    description String
    Description of CAM role.
    name String
    Name of CAM role.
    resultOutputFile String
    roleId String
    Id of CAM role.

    Supporting Types

    GetCamRolesRoleList

    ConsoleLogin bool
    Indicate whether the CAM role can be login or not.
    CreateTime string
    The create time of the CAM role.
    Description string
    The description of the CAM role to be queried.
    Document string
    Policy document of CAM role.
    Name string
    Name of the CAM policy to be queried.
    RoleId string
    ID of the CAM role to be queried.
    UpdateTime string
    The last update time of the CAM role.
    ConsoleLogin bool
    Indicate whether the CAM role can be login or not.
    CreateTime string
    The create time of the CAM role.
    Description string
    The description of the CAM role to be queried.
    Document string
    Policy document of CAM role.
    Name string
    Name of the CAM policy to be queried.
    RoleId string
    ID of the CAM role to be queried.
    UpdateTime string
    The last update time of the CAM role.
    consoleLogin Boolean
    Indicate whether the CAM role can be login or not.
    createTime String
    The create time of the CAM role.
    description String
    The description of the CAM role to be queried.
    document String
    Policy document of CAM role.
    name String
    Name of the CAM policy to be queried.
    roleId String
    ID of the CAM role to be queried.
    updateTime String
    The last update time of the CAM role.
    consoleLogin boolean
    Indicate whether the CAM role can be login or not.
    createTime string
    The create time of the CAM role.
    description string
    The description of the CAM role to be queried.
    document string
    Policy document of CAM role.
    name string
    Name of the CAM policy to be queried.
    roleId string
    ID of the CAM role to be queried.
    updateTime string
    The last update time of the CAM role.
    console_login bool
    Indicate whether the CAM role can be login or not.
    create_time str
    The create time of the CAM role.
    description str
    The description of the CAM role to be queried.
    document str
    Policy document of CAM role.
    name str
    Name of the CAM policy to be queried.
    role_id str
    ID of the CAM role to be queried.
    update_time str
    The last update time of the CAM role.
    consoleLogin Boolean
    Indicate whether the CAM role can be login or not.
    createTime String
    The create time of the CAM role.
    description String
    The description of the CAM role to be queried.
    document String
    Policy document of CAM role.
    name String
    Name of the CAM policy to be queried.
    roleId String
    ID of the CAM role to be queried.
    updateTime String
    The last update time of the CAM role.

    Package Details

    Repository
    tencentcloud tencentcloudstack/terraform-provider-tencentcloud
    License
    Notes
    This Pulumi package is based on the tencentcloud Terraform Provider.
    tencentcloud logo
    tencentcloud 1.82.34 published on Wednesday, Nov 5, 2025 by tencentcloudstack
      Meet Neo: Your AI Platform Teammate