github.com/cbroglie/terraform@v0.7.0-rc3.0.20170410193827-735dfc416d46/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 `roles` or `role` must be specified in the IAM Instance Profile. 14 15 ## Example Usage 16 17 ``` 18 resource "aws_iam_instance_profile" "test_profile" { 19 name = "test_profile" 20 roles = ["${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` - (Optional) 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. `WARNING: This will be deprecated in a future version of Terraform`. 53 * `role` - (Optional) The role name to include in the profile. This. 54 55 ## Attribute Reference 56 57 * `id` - The instance profile's ID. 58 * `arn` - The ARN assigned by AWS to the instance profile. 59 * `create_date` - The creation timestamp of the instance profile. 60 * `name` - The instance profile's name. 61 * `path` - The path of the instance profile in IAM. 62 * `roles` - The list of roles assigned to the instance profile. 63 * `role` - The role assigned to the instance profile 64 * `unique_id` - The [unique ID][1] assigned by AWS. 65 66 [1]: https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html#GUIDs 67 68 69 ## Import 70 71 Instance Profiles can be imported using the `name`, e.g. 72 73 ``` 74 $ terraform import aws_iam_instance_profile.test_profile app-instance-profile-1 75 ```