Ready to level-up your engineering skills? Join a Pulumi Workshop. Register Now

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/v2/go/alicloud"
    "github.com/pulumi/pulumi/sdk/v2/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
    })
}
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({ async: true }));

export const currentAccountId = current.id;

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)
}

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 str

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.