github.com/ves/terraform@v0.8.0-beta2/website/source/docs/providers/aws/r/iam_policy.html.markdown (about) 1 --- 2 layout: "aws" 3 page_title: "AWS: aws_iam_policy" 4 sidebar_current: "docs-aws-resource-iam-policy" 5 description: |- 6 Provides an IAM policy. 7 --- 8 9 # aws\_iam\_policy 10 11 Provides an IAM policy. 12 13 ``` 14 resource "aws_iam_policy" "policy" { 15 name = "test_policy" 16 path = "/" 17 description = "My test policy" 18 policy = <<EOF 19 { 20 "Version": "2012-10-17", 21 "Statement": [ 22 { 23 "Action": [ 24 "ec2:Describe*" 25 ], 26 "Effect": "Allow", 27 "Resource": "*" 28 } 29 ] 30 } 31 EOF 32 } 33 ``` 34 35 ## Argument Reference 36 37 The following arguments are supported: 38 39 * `description` - (Optional) Description of the IAM policy. 40 * `path` - (Optional, default "/") Path in which to create the policy. 41 * `policy` - (Required) The policy document. This is a JSON formatted string. 42 The heredoc syntax, `file` function, or the [`aws_iam_policy_document` data 43 source](/docs/providers/aws/d/iam_policy_document.html) 44 are all helpful here. 45 * `name` (Required) - The name of the policy. 46 47 ## Attributes Reference 48 49 The following attributes are exported: 50 51 * `id` - The policy's ID. 52 * `arn` - The ARN assigned by AWS to this policy. 53 * `description` - The description of the policy. 54 * `name` - The name of the policy. 55 * `path` - The path of the policy in IAM. 56 * `policy` - The policy document.