github.com/markdia/terraform@v0.5.1-0.20150508012022-f1ae920aa970/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" "my_developers" { 17 name = "developers" 18 path = "/users/" 19 } 20 21 resource "iam_group_policy" "my_developer_policy" { 22 name = "my_developer_policy" 23 group = "${aws_iam_group.my_developers.id}" 24 policy = <<EOF 25 { 26 "Version": "2012-10-17", 27 "Statement": [ 28 { 29 "Action": [ 30 "ec2:Describe*" 31 ], 32 "Effect": "Allow", 33 "Resource": "*" 34 } 35 ] 36 } 37 EOF 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` funciton is helpful here. 47 * `name` - (Required) Name of the policy. 48 * `user` - (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.