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

     1  ---
     2  layout: "aws"
     3  page_title: "AWS: aws_group_policy"
     4  sidebar_current: "docs-aws-resource-iam-group-policy"
     5  description: |-
     6    Provides an IAM policy attached to a group.
     7  ---
     8  
     9  # aws\_iam\_group\_policy
    10  
    11  Provides an IAM policy attached to a group.
    12  
    13  ## Example Usage
    14  
    15  ```
    16  resource "aws_iam_group_policy" "my_developer_policy" {
    17    name  = "my_developer_policy"
    18    group = "${aws_iam_group.my_developers.id}"
    19  
    20    policy = <<EOF
    21  {
    22    "Version": "2012-10-17",
    23    "Statement": [
    24      {
    25        "Action": [
    26          "ec2:Describe*"
    27        ],
    28        "Effect": "Allow",
    29        "Resource": "*"
    30      }
    31    ]
    32  }
    33  EOF
    34  }
    35  
    36  resource "aws_iam_group" "my_developers" {
    37    name = "developers"
    38    path = "/users/"
    39  }
    40  ```
    41  
    42  ## Argument Reference
    43  
    44  The following arguments are supported:
    45  
    46  * `policy` - (Required) The policy document. This is a JSON formatted string.
    47    The heredoc syntax or `file` function is helpful here.
    48  * `name` - (Required) Name of the policy.
    49  * `group` - (Required) The IAM group to attach to the policy.
    50  
    51  ## Attributes Reference
    52  
    53  * `id` - The group policy ID.
    54  * `group` - The group to which this policy applies.
    55  * `name` - The name of the policy.
    56  * `policy` - The policy document attached to the group.