getAccountAlias

The IAM Account Alias data source allows access to the account alias for the effective account in which this provider is working.

Example Usage

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var current = Output.Create(Aws.Iam.GetAccountAlias.InvokeAsync());
        this.AccountId = current.Apply(current => current.AccountAlias);
    }

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

import (
	"github.com/pulumi/pulumi-aws/sdk/v4/go/aws/iam"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		current, err := iam.LookupAccountAlias(ctx, nil, nil)
		if err != nil {
			return err
		}
		ctx.Export("accountId", current.AccountAlias)
		return nil
	})
}
import pulumi
import pulumi_aws as aws

current = aws.iam.get_account_alias()
pulumi.export("accountId", current.account_alias)
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const current = aws.iam.getAccountAlias({});
export const accountId = current.then(current => current.accountAlias);

Using getAccountAlias

function getAccountAlias(opts?: InvokeOptions): Promise<GetAccountAliasResult>
def get_account_alias(opts: Optional[InvokeOptions] = None) -> GetAccountAliasResult
func LookupAccountAlias(ctx *Context, opts ...InvokeOption) (*LookupAccountAliasResult, error)

Note: This function is named LookupAccountAlias in the Go SDK.

public static class GetAccountAlias {
    public static Task<GetAccountAliasResult> InvokeAsync(InvokeOptions? opts = null)
}

getAccountAlias Result

The following output properties are available:

AccountAlias string
The alias associated with the AWS account.
Id string
The provider-assigned unique ID for this managed resource.
AccountAlias string
The alias associated with the AWS account.
Id string
The provider-assigned unique ID for this managed resource.
accountAlias string
The alias associated with the AWS account.
id string
The provider-assigned unique ID for this managed resource.
account_alias str
The alias associated with the AWS account.
id str
The provider-assigned unique ID for this managed resource.

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.