github.com/danp/terraform@v0.9.5-0.20170426144147-39d740081351/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 ~> **NOTE:** Either `role` or `roles` (**deprecated**) must be specified. 14 15 ## Example Usage 16 17 ```hcl 18 resource "aws_iam_instance_profile" "test_profile" { 19 name = "test_profile" 20 role = "${aws_iam_role.role.name}" 21 } 22 23 resource "aws_iam_role" "role" { 24 name = "test_role" 25 path = "/" 26 27 assume_role_policy = <<EOF 28 { 29 "Version": "2012-10-17", 30 "Statement": [ 31 { 32 "Action": "sts:AssumeRole", 33 "Principal": { 34 "Service": "ec2.amazonaws.com" 35 }, 36 "Effect": "Allow", 37 "Sid": "" 38 } 39 ] 40 } 41 EOF 42 } 43 ``` 44 45 ## Argument Reference 46 47 The following arguments are supported: 48 49 * `name` - (Optional, Forces new resource) The profile's name. If omitted, Terraform will assign a random, unique name. 50 * `name_prefix` - (Optional, Forces new resource) Creates a unique name beginning with the specified prefix. Conflicts with `name`. 51 * `path` - (Optional, default "/") Path in which to create the profile. 52 * `roles` - (**Deprecated**) 53 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. 54 WARNING: This is deprecated since [version 0.9.3 (April 12, 2017)](https://github.com/hashicorp/terraform/blob/master/CHANGELOG.md#093-april-12-2017), as >= 2 roles are not possible. See [issue #11575](https://github.com/hashicorp/terraform/issues/11575). 55 * `role` - (Optional) The role name to include in the profile. 56 57 ## Attribute Reference 58 59 * `id` - The instance profile's ID. 60 * `arn` - The ARN assigned by AWS to the instance profile. 61 * `create_date` - The creation timestamp of the instance profile. 62 * `name` - The instance profile's name. 63 * `path` - The path of the instance profile in IAM. 64 * `role` - The role assigned to the instance profile. 65 * `roles` - The list of roles assigned to the instance profile. (**Deprecated**) 66 * `unique_id` - The [unique ID][1] assigned by AWS. 67 68 [1]: https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html#GUIDs 69 70 71 ## Import 72 73 Instance Profiles can be imported using the `name`, e.g. 74 75 ``` 76 $ terraform import aws_iam_instance_profile.test_profile app-instance-profile-1 77 ```