Show / Hide Table of Contents

Class User

Provides an IAM user.

NOTE: If policies are attached to the user via the aws.iam.PolicyAttachment resource and you are modifying the user name or path, the force_destroy argument must be set to true and applied before attempting the operation otherwise you will encounter a DeleteConflict error. The aws.iam.UserPolicyAttachment resource (recommended) does not have this requirement.

Example Usage

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
public MyStack()
{
    var lbUser = new Aws.Iam.User("lbUser", new Aws.Iam.UserArgs
    {
        Path = "/system/",
        Tags = 
        {
            { "tag-key", "tag-value" },
        },
    });
    var lbAccessKey = new Aws.Iam.AccessKey("lbAccessKey", new Aws.Iam.AccessKeyArgs
    {
        User = lbUser.Name,
    });
    var lbRo = new Aws.Iam.UserPolicy("lbRo", new Aws.Iam.UserPolicyArgs
    {
        Policy = @"{
""Version"": ""2012-10-17"",
""Statement"": [
{
  ""Action"": [
    ""ec2:Describe*""
  ],
  ""Effect"": ""Allow"",
  ""Resource"": ""*""
}
]
}

",
        User = lbUser.Name,
    });
}

}
Inheritance
System.Object
Resource
CustomResource
User
Inherited Members
CustomResource.Id
Resource.GetResourceType()
Resource.GetResourceName()
Resource.Urn
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.Iam
Assembly: Pulumi.Aws.dll
Syntax
public class User : CustomResource

Constructors

View Source

User(String, UserArgs, CustomResourceOptions)

Create a User resource with the given unique name, arguments, and options.

Declaration
public User(string name, UserArgs args = null, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resource

UserArgs args

The arguments used to populate this resource's properties

CustomResourceOptions options

A bag of options that control this resource's behavior

Properties

View Source

Arn

The ARN assigned by AWS for this user.

Declaration
public Output<string> Arn { get; }
Property Value
Type Description
Output<System.String>
View Source

ForceDestroy

When destroying this user, destroy even if it has non-provider-managed IAM access keys, login profile or MFA devices. Without force_destroy a user with non-provider-managed access keys and login profile will fail to be destroyed.

Declaration
public Output<bool?> ForceDestroy { get; }
Property Value
Type Description
Output<System.Nullable<System.Boolean>>
View Source

Name

The user's name. The name must consist of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: =,.@-_.. User names are not distinguished by case. For example, you cannot create users named both "TESTUSER" and "testuser".

Declaration
public Output<string> Name { get; }
Property Value
Type Description
Output<System.String>
View Source

Path

Path in which to create the user.

Declaration
public Output<string> Path { get; }
Property Value
Type Description
Output<System.String>
View Source

PermissionsBoundary

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

Declaration
public Output<string> PermissionsBoundary { get; }
Property Value
Type Description
Output<System.String>
View Source

Tags

Key-value mapping of tags for the IAM user

Declaration
public Output<ImmutableDictionary<string, object>> Tags { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableDictionary<System.String, System.Object>>
View Source

UniqueId

The [unique ID][1] assigned by AWS.

Declaration
public Output<string> UniqueId { get; }
Property Value
Type Description
Output<System.String>

Methods

View Source

Get(String, Input<String>, UserState, CustomResourceOptions)

Get an existing User resource's state with the given name, ID, and optional extra properties used to qualify the lookup.

Declaration
public static User Get(string name, Input<string> id, UserState state = null, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resulting resource.

Input<System.String> id

The unique provider ID of the resource to lookup.

UserState state

Any extra arguments used during the lookup.

CustomResourceOptions options

A bag of options that control this resource's behavior

Returns
Type Description
User
  • View Source
Back to top Copyright 2016-2020, Pulumi Corporation.