Class UserPolicyAttachment
Attaches a Managed IAM Policy to an IAM user
NOTE: The usage of this resource conflicts with the
aws.iam.PolicyAttachmentresource 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,
});
}
}
Inherited Members
Namespace: Pulumi.Aws.Iam
Assembly: Pulumi.Aws.dll
Syntax
public class UserPolicyAttachment : CustomResource
Constructors
View SourceUserPolicyAttachment(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 SourcePolicyArn
The ARN of the policy you want to apply
Declaration
public Output<string> PolicyArn { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
User
The user the policy should be applied to
Declaration
public Output<string> User { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Methods
View SourceGet(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 |