Show / Hide Table of Contents

Class UserPolicyAttachment

Attaches a Managed IAM Policy to an IAM user

NOTE: The usage of this resource conflicts with the aws.iam.PolicyAttachment resource and will permanently show a difference if both are defined.

Example Usage

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
public MyStack()
{
    var user = new Aws.Iam.User("user", new Aws.Iam.UserArgs
    {
    });
    var policy = new Aws.Iam.Policy("policy", new Aws.Iam.PolicyArgs
    {
        Description = "A test policy",
        Policy = "",
    });
    // insert policy here
    var test_attach = new Aws.Iam.UserPolicyAttachment("test-attach", new Aws.Iam.UserPolicyAttachmentArgs
    {
        PolicyArn = policy.Arn,
        User = user.Name,
    });
}

}
Inheritance
System.Object
Resource
CustomResource
UserPolicyAttachment
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 UserPolicyAttachment : CustomResource

Constructors

View Source

UserPolicyAttachment(String, UserPolicyAttachmentArgs, CustomResourceOptions)

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

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

The unique name of the resource

UserPolicyAttachmentArgs 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

PolicyArn

The ARN of the policy you want to apply

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

User

The user the policy should be applied to

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

Methods

View Source

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

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

Declaration
public static UserPolicyAttachment Get(string name, Input<string> id, UserPolicyAttachmentState 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.

UserPolicyAttachmentState state

Any extra arguments used during the lookup.

CustomResourceOptions options

A bag of options that control this resource's behavior

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