github.com/armen/terraform@v0.5.2-0.20150529052519-caa8117a08f1/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 policy = <<EOF 20 { 21 "Version": "2012-10-17", 22 "Statement": [ 23 { 24 "Action": [ 25 "ec2:Describe*" 26 ], 27 "Effect": "Allow", 28 "Resource": "*" 29 } 30 ] 31 } 32 EOF 33 } 34 35 resource "aws_iam_group" "my_developers" { 36 name = "developers" 37 path = "/users/" 38 } 39 ``` 40 41 ## Argument Reference 42 43 The following arguments are supported: 44 45 * `policy` - (Required) The policy document. This is a JSON formatted string. 46 The heredoc syntax or `file` function is helpful here. 47 * `name` - (Required) Name of the policy. 48 * `group` - (Required) The IAM group to attach to the policy. 49 50 ## Attributes Reference 51 52 * `id` - The group policy ID. 53 * `group` - The group to which this policy applies. 54 * `name` - The name of the policy. 55 * `policy` - The policy document attached to the group.