1. Packages
  2. Tencentcloud Provider
  3. API Docs
  4. getCamRoles
tencentcloud 1.81.183 published on Wednesday, Apr 16, 2025 by tencentcloudstack

tencentcloud.getCamRoles

Explore with Pulumi AI

tencentcloud logo
tencentcloud 1.81.183 published on Wednesday, Apr 16, 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";
    
    const foo = tencentcloud.getCamRoles({
        roleId: tencentcloud_cam_role.foo.id,
    });
    const bar = tencentcloud.getCamRoles({
        name: "cam-role-test",
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    foo = tencentcloud.get_cam_roles(role_id=tencentcloud_cam_role["foo"]["id"])
    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 {
    		_, err := tencentcloud.GetCamRoles(ctx, &tencentcloud.GetCamRolesArgs{
    			RoleId: pulumi.StringRef(tencentcloud_cam_role.Foo.Id),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, 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(() => 
    {
        var foo = Tencentcloud.GetCamRoles.Invoke(new()
        {
            RoleId = tencentcloud_cam_role.Foo.Id,
        });
    
        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) {
            final var foo = TencentcloudFunctions.getCamRoles(GetCamRolesArgs.builder()
                .roleId(tencentcloud_cam_role.foo().id())
                .build());
    
            final var bar = TencentcloudFunctions.getCamRoles(GetCamRolesArgs.builder()
                .name("cam-role-test")
                .build());
    
        }
    }
    
    variables:
      foo:
        fn::invoke:
          function: tencentcloud:getCamRoles
          arguments:
            roleId: ${tencentcloud_cam_role.foo.id}
      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.81.183 published on Wednesday, Apr 16, 2025 by tencentcloudstack