Alibaba Cloud

Pulumi Official
Package maintained by Pulumi
v3.21.0 published on Tuesday, Jun 14, 2022 by Pulumi

getAccount

This data source provides information about the current account.

Example Usage

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var current = Output.Create(AliCloud.GetAccount.InvokeAsync());
        this.CurrentAccountId = current.Apply(current => current.Id);
    }

    [Output("currentAccountId")]
    public Output<string> CurrentAccountId { get; set; }
}
package main

import (
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		current, err := alicloud.GetAccount(ctx, nil, nil)
		if err != nil {
			return err
		}
		ctx.Export("currentAccountId", current.Id)
		return nil
	})
}

Coming soon!

import pulumi
import pulumi_alicloud as alicloud

current = alicloud.get_account()
pulumi.export("currentAccountId", current.id)
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const current = pulumi.output(alicloud.getAccount());

export const currentAccountId = current.id;

Coming soon!

Using getAccount

function getAccount(opts?: InvokeOptions): Promise<GetAccountResult>
def get_account(opts: Optional[InvokeOptions] = None) -> GetAccountResult
func GetAccount(ctx *Context, opts ...InvokeOption) (*GetAccountResult, error)

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

public static class GetAccount 
{
    public static Task<GetAccountResult> InvokeAsync(InvokeOptions? opts = null)
}
public static CompletableFuture<GetAccountResult> getAccount(InvokeOptions options)
// Output-based functions aren't available in Java yet
Fn::Invoke:
  Function: alicloud:index/getAccount:getAccount
  Arguments:
    # Arguments dictionary

getAccount Result

The following output properties are available:

Id string

Account ID (e.g. "1239306421830812"). It can be used to construct an ARN.

Id string

Account ID (e.g. "1239306421830812"). It can be used to construct an ARN.

id String

Account ID (e.g. "1239306421830812"). It can be used to construct an ARN.

id string

Account ID (e.g. "1239306421830812"). It can be used to construct an ARN.

id str

Account ID (e.g. "1239306421830812"). It can be used to construct an ARN.

id String

Account ID (e.g. "1239306421830812"). It can be used to construct an ARN.

Package Details

Repository
https://github.com/pulumi/pulumi-alicloud
License
Apache-2.0
Notes

This Pulumi package is based on the alicloud Terraform Provider.