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

     1  ---
     2  layout: "aws"
     3  page_title: "AWS: aws_iam_user"
     4  sidebar_current: "docs-aws-resource-iam-user"
     5  description: |-
     6    Provides an IAM user.
     7  ---
     8  
     9  # aws\_iam\_user
    10  
    11  Provides an IAM user.
    12  
    13  ## Example Usage
    14  
    15  ```hcl
    16  resource "aws_iam_user" "lb" {
    17    name = "loadbalancer"
    18    path = "/system/"
    19  }
    20  
    21  resource "aws_iam_access_key" "lb" {
    22    user = "${aws_iam_user.lb.name}"
    23  }
    24  
    25  resource "aws_iam_user_policy" "lb_ro" {
    26    name = "test"
    27    user = "${aws_iam_user.lb.name}"
    28  
    29    policy = <<EOF
    30  {
    31    "Version": "2012-10-17",
    32    "Statement": [
    33      {
    34        "Action": [
    35          "ec2:Describe*"
    36        ],
    37        "Effect": "Allow",
    38        "Resource": "*"
    39      }
    40    ]
    41  }
    42  EOF
    43  }
    44  ```
    45  
    46  ## Argument Reference
    47  
    48  The following arguments are supported:
    49  
    50  * `name` - (Required) 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".
    51  * `path` - (Optional, default "/") Path in which to create the user.
    52  * `force_destroy` - (Optional, default false) When destroying this user, destroy even if it
    53    has non-Terraform-managed IAM access keys, login profile or MFA devices. Without `force_destroy`
    54    a user with non-Terraform-managed access keys and login profile will fail to be destroyed.
    55  
    56  ## Attributes Reference
    57  
    58  The following attributes are exported:
    59  
    60  * `arn` - The ARN assigned by AWS for this user.
    61  * `name` - The user's name.
    62  * `unique_id` - The [unique ID][1] assigned by AWS.
    63  
    64    [1]: https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html#GUIDs
    65  
    66  
    67  ## Import
    68  
    69  IAM Users can be imported using the `name`, e.g.
    70  
    71  ```
    72  $ terraform import aws_iam_user.lb loadbalancer
    73  ```