github.com/danp/terraform@v0.9.5-0.20170426144147-39d740081351/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 ```hcl 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` - (Optional) The name of the policy. If omitted, Terraform will 49 assign a random, unique name. 50 * `name_prefix` - (Optional) Creates a unique name beginning with the specified 51 prefix. Conflicts with `name`. 52 * `group` - (Required) The IAM group to attach to the policy. 53 54 ## Attributes Reference 55 56 * `id` - The group policy ID. 57 * `group` - The group to which this policy applies. 58 * `name` - The name of the policy. 59 * `policy` - The policy document attached to the group.