Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi
alicloud.resourcemanager.getAccounts
Explore with Pulumi AI
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);
import pulumi
import pulumi_alicloud as alicloud
default = alicloud.resourcemanager.get_accounts()
pulumi.export("firstAccountId", 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, nil, nil)
if err != nil {
return err
}
ctx.Export("firstAccountId", _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?>
{
["firstAccountId"] = @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();
ctx.export("firstAccountId", default_.accounts()[0].id());
}
}
variables:
default:
fn::invoke:
Function: alicloud:resourcemanager:getAccounts
Arguments: {}
outputs:
firstAccountId: ${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,
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]
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)
// Output-based functions aren't available in Java yet
fn::invoke:
function: alicloud:resourcemanager/getAccounts:getAccounts
arguments:
# arguments dictionary
The following arguments are supported:
- Enable
Details bool - Default to
false
. Set it totrue
can output more details about resource attributes. - Ids List<string>
- A list of account IDs.
- Output
File 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
, andPromoteVerifying
.
- Enable
Details bool - Default to
false
. Set it totrue
can output more details about resource attributes. - Ids []string
- A list of account IDs.
- Output
File 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
, andPromoteVerifying
.
- enable
Details Boolean - Default to
false
. Set it totrue
can output more details about resource attributes. - ids List<String>
- A list of account IDs.
- output
File 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
, andPromoteVerifying
.
- enable
Details boolean - Default to
false
. Set it totrue
can output more details about resource attributes. - ids string[]
- A list of account IDs.
- output
File 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
, andPromoteVerifying
.
- enable_
details bool - Default to
false
. Set it totrue
can output more details about resource attributes. - 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
, andPromoteVerifying
.
- enable
Details Boolean - Default to
false
. Set it totrue
can output more details about resource attributes. - ids List<String>
- A list of account IDs.
- output
File 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
, andPromoteVerifying
.
getAccounts Result
The following output properties are available:
- Accounts
List<Pulumi.
Ali Cloud. Resource Manager. Outputs. Get Accounts Account> - 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.
- Enable
Details bool - Output
File string - Status string
- The status of the member account.
- Accounts
[]Get
Accounts Account - 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.
- Enable
Details bool - Output
File string - Status string
- The status of the member account.
- accounts
List<Get
Accounts Account> - 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.
- enable
Details Boolean - output
File String - status String
- The status of the member account.
- accounts
Get
Accounts Account[] - 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.
- enable
Details boolean - output
File string - status string
- The status of the member account.
- accounts
Sequence[Get
Accounts Account] - 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.
- enable
Details Boolean - output
File String - status String
- The status of the member account.
Supporting Types
GetAccountsAccount
- Account
Id string - The ID of the account.
- Account
Name string - (Available in v1.125.0+) The Alibaba Cloud account name of the member account.
- Display
Name string - The name of the member account.
- Folder
Id string - The ID of the folder.
- Id string
- The ID of the resource.
- Join
Method string - The way in which the member account joined the resource directory.
- Join
Time string - The time when the member account joined the resource directory.
- Modify
Time string - The time when the member account was modified.
- Payer
Account stringId - (Available in v1.124.3+) Settlement account ID. If the value is empty, the current account will be used for settlement.
- Resource
Directory stringId - The ID of the resource directory.
- Status string
- The status of account, valid values:
CreateCancelled
,CreateExpired
,CreateFailed
,CreateSuccess
,CreateVerifying
,InviteSuccess
,PromoteCancelled
,PromoteExpired
,PromoteFailed
,PromoteSuccess
, andPromoteVerifying
. - Type string
- The type of the member account.
- Account
Id string - The ID of the account.
- Account
Name string - (Available in v1.125.0+) The Alibaba Cloud account name of the member account.
- Display
Name string - The name of the member account.
- Folder
Id string - The ID of the folder.
- Id string
- The ID of the resource.
- Join
Method string - The way in which the member account joined the resource directory.
- Join
Time string - The time when the member account joined the resource directory.
- Modify
Time string - The time when the member account was modified.
- Payer
Account stringId - (Available in v1.124.3+) Settlement account ID. If the value is empty, the current account will be used for settlement.
- Resource
Directory stringId - The ID of the resource directory.
- Status string
- The status of account, valid values:
CreateCancelled
,CreateExpired
,CreateFailed
,CreateSuccess
,CreateVerifying
,InviteSuccess
,PromoteCancelled
,PromoteExpired
,PromoteFailed
,PromoteSuccess
, andPromoteVerifying
. - Type string
- The type of the member account.
- account
Id String - The ID of the account.
- account
Name String - (Available in v1.125.0+) The Alibaba Cloud account name of the member account.
- display
Name String - The name of the member account.
- folder
Id String - The ID of the folder.
- id String
- The ID of the resource.
- join
Method String - The way in which the member account joined the resource directory.
- join
Time String - The time when the member account joined the resource directory.
- modify
Time String - The time when the member account was modified.
- payer
Account StringId - (Available in v1.124.3+) Settlement account ID. If the value is empty, the current account will be used for settlement.
- resource
Directory StringId - The ID of the resource directory.
- status String
- The status of account, valid values:
CreateCancelled
,CreateExpired
,CreateFailed
,CreateSuccess
,CreateVerifying
,InviteSuccess
,PromoteCancelled
,PromoteExpired
,PromoteFailed
,PromoteSuccess
, andPromoteVerifying
. - type String
- The type of the member account.
- account
Id string - The ID of the account.
- account
Name string - (Available in v1.125.0+) The Alibaba Cloud account name of the member account.
- display
Name string - The name of the member account.
- folder
Id string - The ID of the folder.
- id string
- The ID of the resource.
- join
Method string - The way in which the member account joined the resource directory.
- join
Time string - The time when the member account joined the resource directory.
- modify
Time string - The time when the member account was modified.
- payer
Account stringId - (Available in v1.124.3+) Settlement account ID. If the value is empty, the current account will be used for settlement.
- resource
Directory stringId - The ID of the resource directory.
- status string
- The status of account, valid values:
CreateCancelled
,CreateExpired
,CreateFailed
,CreateSuccess
,CreateVerifying
,InviteSuccess
,PromoteCancelled
,PromoteExpired
,PromoteFailed
,PromoteSuccess
, andPromoteVerifying
. - type string
- The type of the member account.
- account_
id str - The ID of the account.
- account_
name str - (Available in v1.125.0+) The Alibaba Cloud account name of the member account.
- display_
name str - The name of the member account.
- folder_
id str - The ID of the folder.
- id str
- The ID of the resource.
- join_
method str - The way in which the member account joined the resource directory.
- join_
time str - The time when the member account joined the resource directory.
- modify_
time str - The time when the member account was modified.
- payer_
account_ strid - (Available in v1.124.3+) Settlement account ID. If the value is empty, the current account will be used for settlement.
- resource_
directory_ strid - The ID of the resource directory.
- status str
- The status of account, valid values:
CreateCancelled
,CreateExpired
,CreateFailed
,CreateSuccess
,CreateVerifying
,InviteSuccess
,PromoteCancelled
,PromoteExpired
,PromoteFailed
,PromoteSuccess
, andPromoteVerifying
. - type str
- The type of the member account.
- account
Id String - The ID of the account.
- account
Name String - (Available in v1.125.0+) The Alibaba Cloud account name of the member account.
- display
Name String - The name of the member account.
- folder
Id String - The ID of the folder.
- id String
- The ID of the resource.
- join
Method String - The way in which the member account joined the resource directory.
- join
Time String - The time when the member account joined the resource directory.
- modify
Time String - The time when the member account was modified.
- payer
Account StringId - (Available in v1.124.3+) Settlement account ID. If the value is empty, the current account will be used for settlement.
- resource
Directory StringId - The ID of the resource directory.
- status String
- The status of account, valid values:
CreateCancelled
,CreateExpired
,CreateFailed
,CreateSuccess
,CreateVerifying
,InviteSuccess
,PromoteCancelled
,PromoteExpired
,PromoteFailed
,PromoteSuccess
, andPromoteVerifying
. - type 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.