1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. resourcemanager
  5. getAccounts
Alibaba Cloud v3.85.0 published on Tuesday, Sep 9, 2025 by Pulumi

alicloud.resourcemanager.getAccounts

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.85.0 published on Tuesday, Sep 9, 2025 by Pulumi

    This data source provides the Resource Manager Accounts of the current Alibaba Cloud user.

    NOTE: Available since v1.86.0.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const _default = alicloud.resourcemanager.getAccounts({});
    export const resourceManagerAccountId0 = _default.then(_default => _default.accounts?.[0]?.id);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    default = alicloud.resourcemanager.get_accounts()
    pulumi.export("resourceManagerAccountId0", default.accounts[0].id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/resourcemanager"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_default, err := resourcemanager.GetAccounts(ctx, &resourcemanager.GetAccountsArgs{}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("resourceManagerAccountId0", _default.Accounts[0].Id)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var @default = AliCloud.ResourceManager.GetAccounts.Invoke();
    
        return new Dictionary<string, object?>
        {
            ["resourceManagerAccountId0"] = @default.Apply(@default => @default.Apply(getAccountsResult => getAccountsResult.Accounts[0]?.Id)),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.resourcemanager.ResourcemanagerFunctions;
    import com.pulumi.alicloud.resourcemanager.inputs.GetAccountsArgs;
    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 default = ResourcemanagerFunctions.getAccounts(GetAccountsArgs.builder()
                .build());
    
            ctx.export("resourceManagerAccountId0", default_.accounts()[0].id());
        }
    }
    
    variables:
      default:
        fn::invoke:
          function: alicloud:resourcemanager:getAccounts
          arguments: {}
    outputs:
      resourceManagerAccountId0: ${default.accounts[0].id}
    

    Using getAccounts

    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 getAccounts(args: GetAccountsArgs, opts?: InvokeOptions): Promise<GetAccountsResult>
    function getAccountsOutput(args: GetAccountsOutputArgs, opts?: InvokeOptions): Output<GetAccountsResult>
    def get_accounts(enable_details: Optional[bool] = None,
                     ids: Optional[Sequence[str]] = None,
                     output_file: Optional[str] = None,
                     status: Optional[str] = None,
                     tags: Optional[Mapping[str, str]] = None,
                     opts: Optional[InvokeOptions] = None) -> GetAccountsResult
    def get_accounts_output(enable_details: Optional[pulumi.Input[bool]] = None,
                     ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                     output_file: Optional[pulumi.Input[str]] = None,
                     status: Optional[pulumi.Input[str]] = None,
                     tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
                     opts: Optional[InvokeOptions] = None) -> Output[GetAccountsResult]
    func GetAccounts(ctx *Context, args *GetAccountsArgs, opts ...InvokeOption) (*GetAccountsResult, error)
    func GetAccountsOutput(ctx *Context, args *GetAccountsOutputArgs, opts ...InvokeOption) GetAccountsResultOutput

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

    public static class GetAccounts 
    {
        public static Task<GetAccountsResult> InvokeAsync(GetAccountsArgs args, InvokeOptions? opts = null)
        public static Output<GetAccountsResult> Invoke(GetAccountsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetAccountsResult> getAccounts(GetAccountsArgs args, InvokeOptions options)
    public static Output<GetAccountsResult> getAccounts(GetAccountsArgs args, InvokeOptions options)
    
    fn::invoke:
      function: alicloud:resourcemanager/getAccounts:getAccounts
      arguments:
        # arguments dictionary

    The following arguments are supported:

    EnableDetails bool
    Whether to query the detailed list of resource attributes. Default value: false.
    Ids List<string>
    A list of Account IDs.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    Status string
    The status of account. Valid values: CreateCancelled, CreateExpired, CreateFailed, CreateSuccess, CreateVerifying, InviteSuccess, PromoteCancelled, PromoteExpired, PromoteFailed, PromoteSuccess, PromoteVerifying.
    Tags Dictionary<string, string>
    A mapping of tags to assign to the resource.
    EnableDetails bool
    Whether to query the detailed list of resource attributes. Default value: false.
    Ids []string
    A list of Account IDs.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    Status string
    The status of account. Valid values: CreateCancelled, CreateExpired, CreateFailed, CreateSuccess, CreateVerifying, InviteSuccess, PromoteCancelled, PromoteExpired, PromoteFailed, PromoteSuccess, PromoteVerifying.
    Tags map[string]string
    A mapping of tags to assign to the resource.
    enableDetails Boolean
    Whether to query the detailed list of resource attributes. Default value: false.
    ids List<String>
    A list of Account IDs.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    status String
    The status of account. Valid values: CreateCancelled, CreateExpired, CreateFailed, CreateSuccess, CreateVerifying, InviteSuccess, PromoteCancelled, PromoteExpired, PromoteFailed, PromoteSuccess, PromoteVerifying.
    tags Map<String,String>
    A mapping of tags to assign to the resource.
    enableDetails boolean
    Whether to query the detailed list of resource attributes. Default value: false.
    ids string[]
    A list of Account IDs.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    status string
    The status of account. Valid values: CreateCancelled, CreateExpired, CreateFailed, CreateSuccess, CreateVerifying, InviteSuccess, PromoteCancelled, PromoteExpired, PromoteFailed, PromoteSuccess, PromoteVerifying.
    tags {[key: string]: string}
    A mapping of tags to assign to the resource.
    enable_details bool
    Whether to query the detailed list of resource attributes. Default value: false.
    ids Sequence[str]
    A list of Account IDs.
    output_file str
    File name where to save data source results (after running pulumi preview).
    status str
    The status of account. Valid values: CreateCancelled, CreateExpired, CreateFailed, CreateSuccess, CreateVerifying, InviteSuccess, PromoteCancelled, PromoteExpired, PromoteFailed, PromoteSuccess, PromoteVerifying.
    tags Mapping[str, str]
    A mapping of tags to assign to the resource.
    enableDetails Boolean
    Whether to query the detailed list of resource attributes. Default value: false.
    ids List<String>
    A list of Account IDs.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    status String
    The status of account. Valid values: CreateCancelled, CreateExpired, CreateFailed, CreateSuccess, CreateVerifying, InviteSuccess, PromoteCancelled, PromoteExpired, PromoteFailed, PromoteSuccess, PromoteVerifying.
    tags Map<String>
    A mapping of tags to assign to the resource.

    getAccounts Result

    The following output properties are available:

    Accounts List<Pulumi.AliCloud.ResourceManager.Outputs.GetAccountsAccount>
    A list of accounts. Each element contains the following attributes:
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    EnableDetails bool
    OutputFile string
    Status string
    The status of the member.
    Tags Dictionary<string, string>
    (Available since v1.259.0) The tags that are added to the member.
    Accounts []GetAccountsAccount
    A list of accounts. Each element contains the following attributes:
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    EnableDetails bool
    OutputFile string
    Status string
    The status of the member.
    Tags map[string]string
    (Available since v1.259.0) The tags that are added to the member.
    accounts List<GetAccountsAccount>
    A list of accounts. Each element contains the following attributes:
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    enableDetails Boolean
    outputFile String
    status String
    The status of the member.
    tags Map<String,String>
    (Available since v1.259.0) The tags that are added to the member.
    accounts GetAccountsAccount[]
    A list of accounts. Each element contains the following attributes:
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    enableDetails boolean
    outputFile string
    status string
    The status of the member.
    tags {[key: string]: string}
    (Available since v1.259.0) The tags that are added to the member.
    accounts Sequence[GetAccountsAccount]
    A list of accounts. Each element contains the following attributes:
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    enable_details bool
    output_file str
    status str
    The status of the member.
    tags Mapping[str, str]
    (Available since v1.259.0) The tags that are added to the member.
    accounts List<Property Map>
    A list of accounts. Each element contains the following attributes:
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    enableDetails Boolean
    outputFile String
    status String
    The status of the member.
    tags Map<String>
    (Available since v1.259.0) The tags that are added to the member.

    Supporting Types

    GetAccountsAccount

    AccountId string
    The Alibaba Cloud account ID of the member.
    AccountName string
    (Available since v1.125.0) The Alibaba Cloud account name of the member. Note: account_name takes effect only if enable_details is set to true.
    DisplayName string
    The display name of the member.
    FolderId string
    The ID of the folder.
    Id string
    The ID of the Account.
    JoinMethod string
    The way in which the member joins the resource directory.
    JoinTime string
    The time when the member joined the resource directory.
    ModifyTime string
    The time when the member was modified.
    PayerAccountId string
    (Available since v1.124.3) The ID of the settlement account. Note: payer_account_id takes effect only if enable_details is set to true.
    ResourceDirectoryId string
    The ID of the resource directory.
    Status string
    The status of account. Valid values: CreateCancelled, CreateExpired, CreateFailed, CreateSuccess, CreateVerifying, InviteSuccess, PromoteCancelled, PromoteExpired, PromoteFailed, PromoteSuccess, PromoteVerifying.
    Tags Dictionary<string, string>
    A mapping of tags to assign to the resource.
    Type string
    The type of the member.
    AccountId string
    The Alibaba Cloud account ID of the member.
    AccountName string
    (Available since v1.125.0) The Alibaba Cloud account name of the member. Note: account_name takes effect only if enable_details is set to true.
    DisplayName string
    The display name of the member.
    FolderId string
    The ID of the folder.
    Id string
    The ID of the Account.
    JoinMethod string
    The way in which the member joins the resource directory.
    JoinTime string
    The time when the member joined the resource directory.
    ModifyTime string
    The time when the member was modified.
    PayerAccountId string
    (Available since v1.124.3) The ID of the settlement account. Note: payer_account_id takes effect only if enable_details is set to true.
    ResourceDirectoryId string
    The ID of the resource directory.
    Status string
    The status of account. Valid values: CreateCancelled, CreateExpired, CreateFailed, CreateSuccess, CreateVerifying, InviteSuccess, PromoteCancelled, PromoteExpired, PromoteFailed, PromoteSuccess, PromoteVerifying.
    Tags map[string]string
    A mapping of tags to assign to the resource.
    Type string
    The type of the member.
    accountId String
    The Alibaba Cloud account ID of the member.
    accountName String
    (Available since v1.125.0) The Alibaba Cloud account name of the member. Note: account_name takes effect only if enable_details is set to true.
    displayName String
    The display name of the member.
    folderId String
    The ID of the folder.
    id String
    The ID of the Account.
    joinMethod String
    The way in which the member joins the resource directory.
    joinTime String
    The time when the member joined the resource directory.
    modifyTime String
    The time when the member was modified.
    payerAccountId String
    (Available since v1.124.3) The ID of the settlement account. Note: payer_account_id takes effect only if enable_details is set to true.
    resourceDirectoryId String
    The ID of the resource directory.
    status String
    The status of account. Valid values: CreateCancelled, CreateExpired, CreateFailed, CreateSuccess, CreateVerifying, InviteSuccess, PromoteCancelled, PromoteExpired, PromoteFailed, PromoteSuccess, PromoteVerifying.
    tags Map<String,String>
    A mapping of tags to assign to the resource.
    type String
    The type of the member.
    accountId string
    The Alibaba Cloud account ID of the member.
    accountName string
    (Available since v1.125.0) The Alibaba Cloud account name of the member. Note: account_name takes effect only if enable_details is set to true.
    displayName string
    The display name of the member.
    folderId string
    The ID of the folder.
    id string
    The ID of the Account.
    joinMethod string
    The way in which the member joins the resource directory.
    joinTime string
    The time when the member joined the resource directory.
    modifyTime string
    The time when the member was modified.
    payerAccountId string
    (Available since v1.124.3) The ID of the settlement account. Note: payer_account_id takes effect only if enable_details is set to true.
    resourceDirectoryId string
    The ID of the resource directory.
    status string
    The status of account. Valid values: CreateCancelled, CreateExpired, CreateFailed, CreateSuccess, CreateVerifying, InviteSuccess, PromoteCancelled, PromoteExpired, PromoteFailed, PromoteSuccess, PromoteVerifying.
    tags {[key: string]: string}
    A mapping of tags to assign to the resource.
    type string
    The type of the member.
    account_id str
    The Alibaba Cloud account ID of the member.
    account_name str
    (Available since v1.125.0) The Alibaba Cloud account name of the member. Note: account_name takes effect only if enable_details is set to true.
    display_name str
    The display name of the member.
    folder_id str
    The ID of the folder.
    id str
    The ID of the Account.
    join_method str
    The way in which the member joins the resource directory.
    join_time str
    The time when the member joined the resource directory.
    modify_time str
    The time when the member was modified.
    payer_account_id str
    (Available since v1.124.3) The ID of the settlement account. Note: payer_account_id takes effect only if enable_details is set to true.
    resource_directory_id str
    The ID of the resource directory.
    status str
    The status of account. Valid values: CreateCancelled, CreateExpired, CreateFailed, CreateSuccess, CreateVerifying, InviteSuccess, PromoteCancelled, PromoteExpired, PromoteFailed, PromoteSuccess, PromoteVerifying.
    tags Mapping[str, str]
    A mapping of tags to assign to the resource.
    type str
    The type of the member.
    accountId String
    The Alibaba Cloud account ID of the member.
    accountName String
    (Available since v1.125.0) The Alibaba Cloud account name of the member. Note: account_name takes effect only if enable_details is set to true.
    displayName String
    The display name of the member.
    folderId String
    The ID of the folder.
    id String
    The ID of the Account.
    joinMethod String
    The way in which the member joins the resource directory.
    joinTime String
    The time when the member joined the resource directory.
    modifyTime String
    The time when the member was modified.
    payerAccountId String
    (Available since v1.124.3) The ID of the settlement account. Note: payer_account_id takes effect only if enable_details is set to true.
    resourceDirectoryId String
    The ID of the resource directory.
    status String
    The status of account. Valid values: CreateCancelled, CreateExpired, CreateFailed, CreateSuccess, CreateVerifying, InviteSuccess, PromoteCancelled, PromoteExpired, PromoteFailed, PromoteSuccess, PromoteVerifying.
    tags Map<String>
    A mapping of tags to assign to the resource.
    type String
    The type of the member.

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.85.0 published on Tuesday, Sep 9, 2025 by Pulumi