github.com/vtorhonen/terraform@v0.9.0-beta2.0.20170307220345-5d894e4ffda7/website/source/docs/providers/aws/r/iam_instance_profile.html.markdown (about)

     1  ---
     2  layout: "aws"
     3  page_title: "AWS: aws_iam_instance_profile"
     4  sidebar_current: "docs-aws-resource-iam-instance-profile"
     5  description: |-
     6    Provides an IAM instance profile.
     7  ---
     8  
     9  # aws\_iam\_instance\_profile
    10  
    11  Provides an IAM instance profile.
    12  
    13  ## Example Usage
    14  
    15  ```
    16  resource "aws_iam_instance_profile" "test_profile" {
    17    name  = "test_profile"
    18    roles = ["${aws_iam_role.role.name}"]
    19  }
    20  
    21  resource "aws_iam_role" "role" {
    22    name = "test_role"
    23    path = "/"
    24  
    25    assume_role_policy = <<EOF
    26  {
    27      "Version": "2012-10-17",
    28      "Statement": [
    29          {
    30              "Action": "sts:AssumeRole",
    31              "Principal": {
    32                 "Service": "ec2.amazonaws.com"
    33              },
    34              "Effect": "Allow",
    35              "Sid": ""
    36          }
    37      ]
    38  }
    39  EOF
    40  }
    41  ```
    42  
    43  ## Argument Reference
    44  
    45  The following arguments are supported:
    46  
    47  * `name` - (Optional, Forces new resource) The profile's name.
    48  * `name_prefix` - (Optional, Forces new resource) Creates a unique name beginning with the specified prefix. Conflicts with `name`.
    49  * `path` - (Optional, default "/") Path in which to create the profile.
    50  * `roles` - (Required) A list of role names to include in the profile.  The current default is 1.  If you see an error message similar to `Cannot exceed quota for InstanceSessionsPerInstanceProfile: 1`, then you must contact AWS support and ask for a limit increase.
    51  
    52  ## Attribute Reference
    53  
    54  * `id` - The instance profile's ID.
    55  * `arn` - The ARN assigned by AWS to the instance profile.
    56  * `create_date` - The creation timestamp of the instance profile.
    57  * `name` - The instance profile's name.
    58  * `path` - The path of the instance profile in IAM.
    59  * `roles` - The list of roles assigned to the instance profile.
    60  * `unique_id` - The [unique ID][1] assigned by AWS.
    61  
    62    [1]: https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html#GUIDs
    63  
    64  
    65  ## Import
    66  
    67  Instance Profiles can be imported using the `name`, e.g.
    68  
    69  ```
    70  $ terraform import aws_iam_instance_profile.test_profile app-instance-profile-1
    71  ```