1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. resourcemanager
  5. getAccounts
Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

alicloud.resourcemanager.getAccounts

Explore with Pulumi AI

Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

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

NOTE: Available in 1.86.0+.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const _default = alicloud.resourcemanager.getAccounts({});
export const firstAccountId = _default.then(_default => _default.accounts?.[0]?.id);
Copy
import pulumi
import pulumi_alicloud as alicloud

default = alicloud.resourcemanager.get_accounts()
pulumi.export("firstAccountId", default.accounts[0].id)
Copy
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("firstAccountId", _default.Accounts[0].Id)
		return nil
	})
}
Copy
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?>
    {
        ["firstAccountId"] = @default.Apply(@default => @default.Apply(getAccountsResult => getAccountsResult.Accounts[0]?.Id)),
    };
});
Copy
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();

        ctx.export("firstAccountId", default_.accounts()[0].id());
    }
}
Copy
variables:
  default:
    fn::invoke:
      function: alicloud:resourcemanager:getAccounts
      arguments: {}
outputs:
  firstAccountId: ${default.accounts[0].id}
Copy

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>
Copy
def get_accounts(enable_details: Optional[bool] = None,
                 ids: Optional[Sequence[str]] = None,
                 output_file: Optional[str] = None,
                 status: Optional[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,
                 opts: Optional[InvokeOptions] = None) -> Output[GetAccountsResult]
Copy
func GetAccounts(ctx *Context, args *GetAccountsArgs, opts ...InvokeOption) (*GetAccountsResult, error)
func GetAccountsOutput(ctx *Context, args *GetAccountsOutputArgs, opts ...InvokeOption) GetAccountsResultOutput
Copy

> 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)
}
Copy
public static CompletableFuture<GetAccountsResult> getAccounts(GetAccountsArgs args, InvokeOptions options)
public static Output<GetAccountsResult> getAccounts(GetAccountsArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: alicloud:resourcemanager/getAccounts:getAccounts
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

EnableDetails bool
Default to false. Set it to true can output more details about resource attributes.
Ids Changes to this property will trigger replacement. List<string>
A list of account IDs.
OutputFile string
File name where to save data source results (after running pulumi preview).
Status Changes to this property will trigger replacement. string
The status of account, valid values: CreateCancelled, CreateExpired, CreateFailed, CreateSuccess, CreateVerifying, InviteSuccess, PromoteCancelled, PromoteExpired, PromoteFailed, PromoteSuccess, and PromoteVerifying.
EnableDetails bool
Default to false. Set it to true can output more details about resource attributes.
Ids Changes to this property will trigger replacement. []string
A list of account IDs.
OutputFile string
File name where to save data source results (after running pulumi preview).
Status Changes to this property will trigger replacement. string
The status of account, valid values: CreateCancelled, CreateExpired, CreateFailed, CreateSuccess, CreateVerifying, InviteSuccess, PromoteCancelled, PromoteExpired, PromoteFailed, PromoteSuccess, and PromoteVerifying.
enableDetails Boolean
Default to false. Set it to true can output more details about resource attributes.
ids Changes to this property will trigger replacement. List<String>
A list of account IDs.
outputFile String
File name where to save data source results (after running pulumi preview).
status Changes to this property will trigger replacement. String
The status of account, valid values: CreateCancelled, CreateExpired, CreateFailed, CreateSuccess, CreateVerifying, InviteSuccess, PromoteCancelled, PromoteExpired, PromoteFailed, PromoteSuccess, and PromoteVerifying.
enableDetails boolean
Default to false. Set it to true can output more details about resource attributes.
ids Changes to this property will trigger replacement. string[]
A list of account IDs.
outputFile string
File name where to save data source results (after running pulumi preview).
status Changes to this property will trigger replacement. string
The status of account, valid values: CreateCancelled, CreateExpired, CreateFailed, CreateSuccess, CreateVerifying, InviteSuccess, PromoteCancelled, PromoteExpired, PromoteFailed, PromoteSuccess, and PromoteVerifying.
enable_details bool
Default to false. Set it to true can output more details about resource attributes.
ids Changes to this property will trigger replacement. Sequence[str]
A list of account IDs.
output_file str
File name where to save data source results (after running pulumi preview).
status Changes to this property will trigger replacement. str
The status of account, valid values: CreateCancelled, CreateExpired, CreateFailed, CreateSuccess, CreateVerifying, InviteSuccess, PromoteCancelled, PromoteExpired, PromoteFailed, PromoteSuccess, and PromoteVerifying.
enableDetails Boolean
Default to false. Set it to true can output more details about resource attributes.
ids Changes to this property will trigger replacement. List<String>
A list of account IDs.
outputFile String
File name where to save data source results (after running pulumi preview).
status Changes to this property will trigger replacement. String
The status of account, valid values: CreateCancelled, CreateExpired, CreateFailed, CreateSuccess, CreateVerifying, InviteSuccess, PromoteCancelled, PromoteExpired, PromoteFailed, PromoteSuccess, and PromoteVerifying.

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>
A list of account IDs.
EnableDetails bool
OutputFile string
Status string
The status of the member account.
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
A list of account IDs.
EnableDetails bool
OutputFile string
Status string
The status of the member account.
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>
A list of account IDs.
enableDetails Boolean
outputFile String
status String
The status of the member account.
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[]
A list of account IDs.
enableDetails boolean
outputFile string
status string
The status of the member account.
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]
A list of account IDs.
enable_details bool
output_file str
status str
The status of the member account.
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>
A list of account IDs.
enableDetails Boolean
outputFile String
status String
The status of the member account.

Supporting Types

GetAccountsAccount

AccountId This property is required. string
The ID of the account.
AccountName This property is required. string
(Available in v1.125.0+) The Alibaba Cloud account name of the member account.
DisplayName This property is required. string
The name of the member account.
FolderId This property is required. string
The ID of the folder.
Id This property is required. string
The ID of the resource.
JoinMethod This property is required. string
The way in which the member account joined the resource directory.
JoinTime This property is required. string
The time when the member account joined the resource directory.
ModifyTime This property is required. string
The time when the member account was modified.
PayerAccountId This property is required. string
(Available in v1.124.3+) Settlement account ID. If the value is empty, the current account will be used for settlement.
ResourceDirectoryId This property is required. string
The ID of the resource directory.
Status This property is required. string
The status of account, valid values: CreateCancelled, CreateExpired, CreateFailed, CreateSuccess, CreateVerifying, InviteSuccess, PromoteCancelled, PromoteExpired, PromoteFailed, PromoteSuccess, and PromoteVerifying.
Type This property is required. string
The type of the member account.
AccountId This property is required. string
The ID of the account.
AccountName This property is required. string
(Available in v1.125.0+) The Alibaba Cloud account name of the member account.
DisplayName This property is required. string
The name of the member account.
FolderId This property is required. string
The ID of the folder.
Id This property is required. string
The ID of the resource.
JoinMethod This property is required. string
The way in which the member account joined the resource directory.
JoinTime This property is required. string
The time when the member account joined the resource directory.
ModifyTime This property is required. string
The time when the member account was modified.
PayerAccountId This property is required. string
(Available in v1.124.3+) Settlement account ID. If the value is empty, the current account will be used for settlement.
ResourceDirectoryId This property is required. string
The ID of the resource directory.
Status This property is required. string
The status of account, valid values: CreateCancelled, CreateExpired, CreateFailed, CreateSuccess, CreateVerifying, InviteSuccess, PromoteCancelled, PromoteExpired, PromoteFailed, PromoteSuccess, and PromoteVerifying.
Type This property is required. string
The type of the member account.
accountId This property is required. String
The ID of the account.
accountName This property is required. String
(Available in v1.125.0+) The Alibaba Cloud account name of the member account.
displayName This property is required. String
The name of the member account.
folderId This property is required. String
The ID of the folder.
id This property is required. String
The ID of the resource.
joinMethod This property is required. String
The way in which the member account joined the resource directory.
joinTime This property is required. String
The time when the member account joined the resource directory.
modifyTime This property is required. String
The time when the member account was modified.
payerAccountId This property is required. String
(Available in v1.124.3+) Settlement account ID. If the value is empty, the current account will be used for settlement.
resourceDirectoryId This property is required. String
The ID of the resource directory.
status This property is required. String
The status of account, valid values: CreateCancelled, CreateExpired, CreateFailed, CreateSuccess, CreateVerifying, InviteSuccess, PromoteCancelled, PromoteExpired, PromoteFailed, PromoteSuccess, and PromoteVerifying.
type This property is required. String
The type of the member account.
accountId This property is required. string
The ID of the account.
accountName This property is required. string
(Available in v1.125.0+) The Alibaba Cloud account name of the member account.
displayName This property is required. string
The name of the member account.
folderId This property is required. string
The ID of the folder.
id This property is required. string
The ID of the resource.
joinMethod This property is required. string
The way in which the member account joined the resource directory.
joinTime This property is required. string
The time when the member account joined the resource directory.
modifyTime This property is required. string
The time when the member account was modified.
payerAccountId This property is required. string
(Available in v1.124.3+) Settlement account ID. If the value is empty, the current account will be used for settlement.
resourceDirectoryId This property is required. string
The ID of the resource directory.
status This property is required. string
The status of account, valid values: CreateCancelled, CreateExpired, CreateFailed, CreateSuccess, CreateVerifying, InviteSuccess, PromoteCancelled, PromoteExpired, PromoteFailed, PromoteSuccess, and PromoteVerifying.
type This property is required. string
The type of the member account.
account_id This property is required. str
The ID of the account.
account_name This property is required. str
(Available in v1.125.0+) The Alibaba Cloud account name of the member account.
display_name This property is required. str
The name of the member account.
folder_id This property is required. str
The ID of the folder.
id This property is required. str
The ID of the resource.
join_method This property is required. str
The way in which the member account joined the resource directory.
join_time This property is required. str
The time when the member account joined the resource directory.
modify_time This property is required. str
The time when the member account was modified.
payer_account_id This property is required. str
(Available in v1.124.3+) Settlement account ID. If the value is empty, the current account will be used for settlement.
resource_directory_id This property is required. str
The ID of the resource directory.
status This property is required. str
The status of account, valid values: CreateCancelled, CreateExpired, CreateFailed, CreateSuccess, CreateVerifying, InviteSuccess, PromoteCancelled, PromoteExpired, PromoteFailed, PromoteSuccess, and PromoteVerifying.
type This property is required. str
The type of the member account.
accountId This property is required. String
The ID of the account.
accountName This property is required. String
(Available in v1.125.0+) The Alibaba Cloud account name of the member account.
displayName This property is required. String
The name of the member account.
folderId This property is required. String
The ID of the folder.
id This property is required. String
The ID of the resource.
joinMethod This property is required. String
The way in which the member account joined the resource directory.
joinTime This property is required. String
The time when the member account joined the resource directory.
modifyTime This property is required. String
The time when the member account was modified.
payerAccountId This property is required. String
(Available in v1.124.3+) Settlement account ID. If the value is empty, the current account will be used for settlement.
resourceDirectoryId This property is required. String
The ID of the resource directory.
status This property is required. String
The status of account, valid values: CreateCancelled, CreateExpired, CreateFailed, CreateSuccess, CreateVerifying, InviteSuccess, PromoteCancelled, PromoteExpired, PromoteFailed, PromoteSuccess, and PromoteVerifying.
type This property is required. String
The type of the member account.

Package Details

Repository
Alibaba Cloud pulumi/pulumi-alicloud
License
Apache-2.0
Notes
This Pulumi package is based on the alicloud Terraform Provider.
Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi