1. Registry
  2. Packages
  3. Tencentcloud Provider
  4. API Docs
  5. getCamAccounts
Viewing docs for tencentcloud 1.83.32
published on Thursday, Sep 17, 2026 by tencentcloudstack
Viewing docs for tencentcloud 1.83.32
published on Thursday, Sep 17, 2026 by tencentcloudstack

    Use this data source to query the list of CAM accounts via the CAM ListAccounts API, including sub users, collaborators, message receivers and other account types. All pages are fetched automatically, so the users list contains every account visible to the credentials.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    // query all CAM accounts
    const all = tencentcloud.getCamAccounts({});
    // query accounts filtered by user type
    const subUsers = tencentcloud.getCamAccounts({
        userType: "SubUser",
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    # query all CAM accounts
    all = tencentcloud.get_cam_accounts()
    # query accounts filtered by user type
    sub_users = tencentcloud.get_cam_accounts(user_type="SubUser")
    
    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 all CAM accounts
    		_, err := tencentcloud.GetCamAccounts(ctx, &tencentcloud.GetCamAccountsArgs{}, nil)
    		if err != nil {
    			return err
    		}
    		// query accounts filtered by user type
    		_, err = tencentcloud.GetCamAccounts(ctx, &tencentcloud.GetCamAccountsArgs{
    			UserType: pulumi.StringRef("SubUser"),
    		}, 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 all CAM accounts
        var all = Tencentcloud.GetCamAccounts.Invoke();
    
        // query accounts filtered by user type
        var subUsers = Tencentcloud.GetCamAccounts.Invoke(new()
        {
            UserType = "SubUser",
        });
    
    });
    
    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.GetCamAccountsArgs;
    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 all CAM accounts
            final var all = TencentcloudFunctions.getCamAccounts(GetCamAccountsArgs.builder()
                .build());
    
            // query accounts filtered by user type
            final var subUsers = TencentcloudFunctions.getCamAccounts(GetCamAccountsArgs.builder()
                .userType("SubUser")
                .build());
    
        }
    }
    
    variables:
      # query all CAM accounts
      all:
        fn::invoke:
          function: tencentcloud:getCamAccounts
          arguments: {}
      # query accounts filtered by user type
      subUsers:
        fn::invoke:
          function: tencentcloud:getCamAccounts
          arguments:
            userType: SubUser
    
    Example coming soon!
    

    Using getCamAccounts

    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 getCamAccounts(args: GetCamAccountsArgs, opts?: InvokeOptions): Promise<GetCamAccountsResult>
    function getCamAccountsOutput(args: GetCamAccountsOutputArgs, opts?: InvokeOutputOptions): Output<GetCamAccountsResult>
    def get_cam_accounts(id: Optional[str] = None,
                         result_output_file: Optional[str] = None,
                         user_type: Optional[str] = None,
                         opts: Optional[InvokeOptions] = None) -> GetCamAccountsResult
    def get_cam_accounts_output(id: pulumi.Input[Optional[str]] = None,
                         result_output_file: pulumi.Input[Optional[str]] = None,
                         user_type: pulumi.Input[Optional[str]] = None,
                         opts: Optional[InvokeOutputOptions] = None) -> Output[GetCamAccountsResult]
    func GetCamAccounts(ctx *Context, args *GetCamAccountsArgs, opts ...InvokeOption) (*GetCamAccountsResult, error)
    func GetCamAccountsOutput(ctx *Context, args *GetCamAccountsOutputArgs, opts ...InvokeOption) GetCamAccountsResultOutput

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

    public static class GetCamAccounts 
    {
        public static Task<GetCamAccountsResult> InvokeAsync(GetCamAccountsArgs args, InvokeOptions? opts = null)
        public static Output<GetCamAccountsResult> Invoke(GetCamAccountsInvokeArgs args, InvokeOptions? opts = null)
        public static Output<GetCamAccountsResult> Invoke(GetCamAccountsInvokeArgs args, InvokeOutputOptions opts)
    }
    public static CompletableFuture<GetCamAccountsResult> getCamAccounts(GetCamAccountsArgs args, InvokeOptions options)
    public static Output<GetCamAccountsResult> getCamAccounts(GetCamAccountsArgs args, InvokeOptions options)
    public static Output<GetCamAccountsResult> getCamAccounts(GetCamAccountsArgs args, InvokeOutputOptions options)
    
    fn::invoke:
      function: tencentcloud:index/getCamAccounts:getCamAccounts
      arguments:
        # arguments dictionary
    data "tencentcloud_get_cam_accounts" "name" {
        # arguments
    }

    The following arguments are supported:

    Id string
    ResultOutputFile string
    Used to save results.
    UserType string
    Account type to filter by. Valid values: Owner (master account), SubUser (sub user), CICUser (CIC sub user), WechatCorpUser (WeCom sub user), AgentIdentity (AgentIdentity sub user), Collaborator (collaborator), MessageReceiver (message receiver).
    Id string
    ResultOutputFile string
    Used to save results.
    UserType string
    Account type to filter by. Valid values: Owner (master account), SubUser (sub user), CICUser (CIC sub user), WechatCorpUser (WeCom sub user), AgentIdentity (AgentIdentity sub user), Collaborator (collaborator), MessageReceiver (message receiver).
    id string
    result_output_file string
    Used to save results.
    user_type string
    Account type to filter by. Valid values: Owner (master account), SubUser (sub user), CICUser (CIC sub user), WechatCorpUser (WeCom sub user), AgentIdentity (AgentIdentity sub user), Collaborator (collaborator), MessageReceiver (message receiver).
    id String
    resultOutputFile String
    Used to save results.
    userType String
    Account type to filter by. Valid values: Owner (master account), SubUser (sub user), CICUser (CIC sub user), WechatCorpUser (WeCom sub user), AgentIdentity (AgentIdentity sub user), Collaborator (collaborator), MessageReceiver (message receiver).
    id string
    resultOutputFile string
    Used to save results.
    userType string
    Account type to filter by. Valid values: Owner (master account), SubUser (sub user), CICUser (CIC sub user), WechatCorpUser (WeCom sub user), AgentIdentity (AgentIdentity sub user), Collaborator (collaborator), MessageReceiver (message receiver).
    id str
    result_output_file str
    Used to save results.
    user_type str
    Account type to filter by. Valid values: Owner (master account), SubUser (sub user), CICUser (CIC sub user), WechatCorpUser (WeCom sub user), AgentIdentity (AgentIdentity sub user), Collaborator (collaborator), MessageReceiver (message receiver).
    id String
    resultOutputFile String
    Used to save results.
    userType String
    Account type to filter by. Valid values: Owner (master account), SubUser (sub user), CICUser (CIC sub user), WechatCorpUser (WeCom sub user), AgentIdentity (AgentIdentity sub user), Collaborator (collaborator), MessageReceiver (message receiver).

    getCamAccounts Result

    The following output properties are available:

    Id string
    Users List<GetCamAccountsUser>
    A list of CAM accounts. Each element contains the following attributes:
    ResultOutputFile string
    UserType string
    Account type. Valid values: Owner, SubUser, CICUser, WechatCorpUser, AgentIdentity, Collaborator, MessageReceiver, Unknown.
    Id string
    Users []GetCamAccountsUser
    A list of CAM accounts. Each element contains the following attributes:
    ResultOutputFile string
    UserType string
    Account type. Valid values: Owner, SubUser, CICUser, WechatCorpUser, AgentIdentity, Collaborator, MessageReceiver, Unknown.
    id string
    users list(object)
    A list of CAM accounts. Each element contains the following attributes:
    result_output_file string
    user_type string
    Account type. Valid values: Owner, SubUser, CICUser, WechatCorpUser, AgentIdentity, Collaborator, MessageReceiver, Unknown.
    id String
    users List<GetCamAccountsUser>
    A list of CAM accounts. Each element contains the following attributes:
    resultOutputFile String
    userType String
    Account type. Valid values: Owner, SubUser, CICUser, WechatCorpUser, AgentIdentity, Collaborator, MessageReceiver, Unknown.
    id string
    users GetCamAccountsUser[]
    A list of CAM accounts. Each element contains the following attributes:
    resultOutputFile string
    userType string
    Account type. Valid values: Owner, SubUser, CICUser, WechatCorpUser, AgentIdentity, Collaborator, MessageReceiver, Unknown.
    id str
    users Sequence[GetCamAccountsUser]
    A list of CAM accounts. Each element contains the following attributes:
    result_output_file str
    user_type str
    Account type. Valid values: Owner, SubUser, CICUser, WechatCorpUser, AgentIdentity, Collaborator, MessageReceiver, Unknown.
    id String
    users List<Property Map>
    A list of CAM accounts. Each element contains the following attributes:
    resultOutputFile String
    userType String
    Account type. Valid values: Owner, SubUser, CICUser, WechatCorpUser, AgentIdentity, Collaborator, MessageReceiver, Unknown.

    Supporting Types

    GetCamAccountsUser

    ConsoleLogin double
    Whether the account can log in to the console. Returned as the raw int value from the API.
    CountryCode string
    Country code.
    CreateTime string
    Creation time. Format: YYYY-MM-DD hh:mm:ss.
    Email string
    Email.
    Name string
    Account name.
    PhoneNum string
    Phone number.
    Remark string
    Account remark.
    Uid double
    Account UID.
    Uin double
    Account ID (Uin).
    UserType string
    Account type to filter by. Valid values: Owner (master account), SubUser (sub user), CICUser (CIC sub user), WechatCorpUser (WeCom sub user), AgentIdentity (AgentIdentity sub user), Collaborator (collaborator), MessageReceiver (message receiver).
    ConsoleLogin float64
    Whether the account can log in to the console. Returned as the raw int value from the API.
    CountryCode string
    Country code.
    CreateTime string
    Creation time. Format: YYYY-MM-DD hh:mm:ss.
    Email string
    Email.
    Name string
    Account name.
    PhoneNum string
    Phone number.
    Remark string
    Account remark.
    Uid float64
    Account UID.
    Uin float64
    Account ID (Uin).
    UserType string
    Account type to filter by. Valid values: Owner (master account), SubUser (sub user), CICUser (CIC sub user), WechatCorpUser (WeCom sub user), AgentIdentity (AgentIdentity sub user), Collaborator (collaborator), MessageReceiver (message receiver).
    console_login number
    Whether the account can log in to the console. Returned as the raw int value from the API.
    country_code string
    Country code.
    create_time string
    Creation time. Format: YYYY-MM-DD hh:mm:ss.
    email string
    Email.
    name string
    Account name.
    phone_num string
    Phone number.
    remark string
    Account remark.
    uid number
    Account UID.
    uin number
    Account ID (Uin).
    user_type string
    Account type to filter by. Valid values: Owner (master account), SubUser (sub user), CICUser (CIC sub user), WechatCorpUser (WeCom sub user), AgentIdentity (AgentIdentity sub user), Collaborator (collaborator), MessageReceiver (message receiver).
    consoleLogin Double
    Whether the account can log in to the console. Returned as the raw int value from the API.
    countryCode String
    Country code.
    createTime String
    Creation time. Format: YYYY-MM-DD hh:mm:ss.
    email String
    Email.
    name String
    Account name.
    phoneNum String
    Phone number.
    remark String
    Account remark.
    uid Double
    Account UID.
    uin Double
    Account ID (Uin).
    userType String
    Account type to filter by. Valid values: Owner (master account), SubUser (sub user), CICUser (CIC sub user), WechatCorpUser (WeCom sub user), AgentIdentity (AgentIdentity sub user), Collaborator (collaborator), MessageReceiver (message receiver).
    consoleLogin number
    Whether the account can log in to the console. Returned as the raw int value from the API.
    countryCode string
    Country code.
    createTime string
    Creation time. Format: YYYY-MM-DD hh:mm:ss.
    email string
    Email.
    name string
    Account name.
    phoneNum string
    Phone number.
    remark string
    Account remark.
    uid number
    Account UID.
    uin number
    Account ID (Uin).
    userType string
    Account type to filter by. Valid values: Owner (master account), SubUser (sub user), CICUser (CIC sub user), WechatCorpUser (WeCom sub user), AgentIdentity (AgentIdentity sub user), Collaborator (collaborator), MessageReceiver (message receiver).
    console_login float
    Whether the account can log in to the console. Returned as the raw int value from the API.
    country_code str
    Country code.
    create_time str
    Creation time. Format: YYYY-MM-DD hh:mm:ss.
    email str
    Email.
    name str
    Account name.
    phone_num str
    Phone number.
    remark str
    Account remark.
    uid float
    Account UID.
    uin float
    Account ID (Uin).
    user_type str
    Account type to filter by. Valid values: Owner (master account), SubUser (sub user), CICUser (CIC sub user), WechatCorpUser (WeCom sub user), AgentIdentity (AgentIdentity sub user), Collaborator (collaborator), MessageReceiver (message receiver).
    consoleLogin Number
    Whether the account can log in to the console. Returned as the raw int value from the API.
    countryCode String
    Country code.
    createTime String
    Creation time. Format: YYYY-MM-DD hh:mm:ss.
    email String
    Email.
    name String
    Account name.
    phoneNum String
    Phone number.
    remark String
    Account remark.
    uid Number
    Account UID.
    uin Number
    Account ID (Uin).
    userType String
    Account type to filter by. Valid values: Owner (master account), SubUser (sub user), CICUser (CIC sub user), WechatCorpUser (WeCom sub user), AgentIdentity (AgentIdentity sub user), Collaborator (collaborator), MessageReceiver (message receiver).

    Package Details

    Repository
    tencentcloud tencentcloudstack/terraform-provider-tencentcloud
    License
    Notes
    This Pulumi package is based on the tencentcloud Terraform Provider.
    Viewing docs for tencentcloud 1.83.32
    published on Thursday, Sep 17, 2026 by tencentcloudstack

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial