GetUser

This data source can be used to fetch information about a specific IAM user. By using this data source, you can reference IAM user properties without having to hard code ARNs or unique IDs as input.

Example Usage

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var example = Output.Create(Aws.Iam.GetUser.InvokeAsync(new Aws.Iam.GetUserArgs
        {
            UserName = "an_example_user_name",
        }));
    }

}
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 {
        _, err := iam.LookupUser(ctx, &iam.LookupUserArgs{
            UserName: "an_example_user_name",
        }, nil)
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_aws as aws

example = aws.iam.get_user(user_name="an_example_user_name")
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = pulumi.output(aws.iam.getUser({
    userName: "an_example_user_name",
}, { async: true }));

Using GetUser

function getUser(args: GetUserArgs, opts?: InvokeOptions): Promise<GetUserResult>
function  get_user(user_name=None, opts=None)
func LookupUser(ctx *Context, args *LookupUserArgs, opts ...InvokeOption) (*LookupUserResult, error)

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

public static class GetUser {
    public static Task<GetUserResult> InvokeAsync(GetUserArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

UserName string

The friendly IAM user name to match.

UserName string

The friendly IAM user name to match.

userName string

The friendly IAM user name to match.

user_name str

The friendly IAM user name to match.

GetUser Result

The following output properties are available:

Arn string

The Amazon Resource Name (ARN) assigned by AWS for this user.

Id string

The provider-assigned unique ID for this managed resource.

Path string

Path in which this user was created.

PermissionsBoundary string

The ARN of the policy that is used to set the permissions boundary for the user.

UserId string

The unique ID assigned by AWS for this user.

UserName string

The name associated to this User

Arn string

The Amazon Resource Name (ARN) assigned by AWS for this user.

Id string

The provider-assigned unique ID for this managed resource.

Path string

Path in which this user was created.

PermissionsBoundary string

The ARN of the policy that is used to set the permissions boundary for the user.

UserId string

The unique ID assigned by AWS for this user.

UserName string

The name associated to this User

arn string

The Amazon Resource Name (ARN) assigned by AWS for this user.

id string

The provider-assigned unique ID for this managed resource.

path string

Path in which this user was created.

permissionsBoundary string

The ARN of the policy that is used to set the permissions boundary for the user.

userId string

The unique ID assigned by AWS for this user.

userName string

The name associated to this User

arn str

The Amazon Resource Name (ARN) assigned by AWS for this user.

id str

The provider-assigned unique ID for this managed resource.

path str

Path in which this user was created.

permissions_boundary str

The ARN of the policy that is used to set the permissions boundary for the user.

user_id str

The unique ID assigned by AWS for this user.

user_name str

The name associated to this User

Package Details

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