github.com/hobbeswalsh/terraform@v0.3.7-0.20150619183303-ad17cf55a0fa/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 or `file` function is helpful here.
    43  * `name` (Required) - The name of the policy.
    44  
    45  ## Attributes Reference
    46  
    47  The following attributes are exported:
    48  
    49  * `id` - The policy's ID.
    50  * `arn` - The ARN assigned by AWS to this policy.
    51  * `description` - The description of the policy.
    52  * `name` - The name of the policy.
    53  * `path` - The path of the policy in IAM.
    54  * `policy` - The policy document.