Show / Hide Table of Contents

Class GetCallerIdentity

Inheritance
System.Object
GetCallerIdentity
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Pulumi.Aws
Assembly: Pulumi.Aws.dll
Syntax
public static class GetCallerIdentity

Methods

View Source

InvokeAsync(InvokeOptions)

Use this data source to get the access to the effective Account ID, User ID, and ARN in which this provider is authorized.

{{% examples %}}

Example Usage

{{% example %}}

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
public MyStack()
{
    var current = Output.Create(Aws.GetCallerIdentity.InvokeAsync());
    this.AccountId = current.Apply(current => current.AccountId);
    this.CallerArn = current.Apply(current => current.Arn);
    this.CallerUser = current.Apply(current => current.UserId);
}

[Output("accountId")]
public Output<string> AccountId { get; set; }
[Output("callerArn")]
public Output<string> CallerArn { get; set; }
[Output("callerUser")]
public Output<string> CallerUser { get; set; }
}

{{% /example %}} {{% /examples %}}

Declaration
public static Task<GetCallerIdentityResult> InvokeAsync(InvokeOptions options = null)
Parameters
Type Name Description
InvokeOptions options
Returns
Type Description
System.Threading.Tasks.Task<GetCallerIdentityResult>
  • View Source
Back to top Copyright 2016-2020, Pulumi Corporation.