GetCallerIdentity

This data source provides the identity of the current user.

NOTE: Available in 1.65.0+.

Example Usage

using Pulumi;
using AliCloud = Pulumi.AliCloud;

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

    [Output("currentUserArn")]
    public Output<string> CurrentUserArn { get; set; }
}

Coming soon!

import pulumi
import pulumi_alicloud as alicloud

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

const current = pulumi.output(alicloud.getCallerIdentity({ async: true }));

export const currentUserArn = current.id;

Using GetCallerIdentity

function getCallerIdentity(opts?: InvokeOptions): Promise<GetCallerIdentityResult>
function  get_caller_identity(opts=None)
func GetCallerIdentity(ctx *Context, opts ...InvokeOption) (*GetCallerIdentityResult, error)
public static class GetCallerIdentity {
    public static Task<GetCallerIdentityResult> InvokeAsync(InvokeOptions? opts = null)
}

GetCallerIdentity Result

The following output properties are available:

AccountId string

Account ID.

Arn string

The Alibaba Cloud Resource Name (ARN) of the user making the call.

Id string

The provider-assigned unique ID for this managed resource.

IdentityType string

The type of the princiapal. RAMUser for users.

AccountId string

Account ID.

Arn string

The Alibaba Cloud Resource Name (ARN) of the user making the call.

Id string

The provider-assigned unique ID for this managed resource.

IdentityType string

The type of the princiapal. RAMUser for users.

accountId string

Account ID.

arn string

The Alibaba Cloud Resource Name (ARN) of the user making the call.

id string

The provider-assigned unique ID for this managed resource.

identityType string

The type of the princiapal. RAMUser for users.

account_id str

Account ID.

arn str

The Alibaba Cloud Resource Name (ARN) of the user making the call.

id str

The provider-assigned unique ID for this managed resource.

identity_type str

The type of the princiapal. RAMUser for users.

Package Details

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