github.com/nathanielks/terraform@v0.6.1-0.20170509030759-13e1a62319dc/website/source/docs/providers/aws/r/iam_user_policy_attachment.markdown (about)

     1  ---
     2  layout: "aws"
     3  page_title: "AWS: aws_iam_user_policy_attachment"
     4  sidebar_current: "docs-aws-resource-iam-user-policy-attachment"
     5  description: |-
     6    Attaches a Managed IAM Policy to an IAM user
     7  ---
     8  
     9  # aws\_iam\_user\_policy\_attachment
    10  
    11  Attaches a Managed IAM Policy to an IAM user
    12  
    13  ```hcl
    14  resource "aws_iam_user" "user" {
    15      name = "test-user"
    16  }
    17  
    18  resource "aws_iam_policy" "policy" {
    19      name        = "test-policy"
    20      description = "A test policy"
    21      policy      = # omitted
    22  }
    23  
    24  resource "aws_iam_user_policy_attachment" "test-attach" {
    25      user       = "${aws_iam_user.user.name}"
    26      policy_arn = "${aws_iam_policy.policy.arn}"
    27  }
    28  ```
    29  
    30  ## Argument Reference
    31  
    32  The following arguments are supported:
    33  
    34  * `user`		(Required) - The user the policy should be applied to
    35  * `policy_arn`	(Required) - The ARN of the policy you want to apply