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/v2/go/aws/iam"
"github.com/pulumi/pulumi/sdk/v2/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 = pulumi.output(aws.iam.getAccountAlias({ async: true }));
export const accountId = current.accountAlias;Using GetAccountAlias
function getAccountAlias(opts?: InvokeOptions): Promise<GetAccountAliasResult>function get_account_alias(opts=None)func LookupAccountAlias(ctx *Context, opts ...InvokeOption) (*LookupAccountAliasResult, error)Note: This function is named
LookupAccountAliasin the Go SDK.
public static class GetAccountAlias {
public static Task<GetAccountAliasResult> InvokeAsync(InvokeOptions? opts = null)
}GetAccountAlias Result
The following output properties are available:
- Account
Alias string The alias associated with the AWS account.
- Id string
The provider-assigned unique ID for this managed resource.
- Account
Alias string The alias associated with the AWS account.
- Id string
The provider-assigned unique ID for this managed resource.
- account
Alias 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
awsTerraform Provider.