github.com/pmcatominey/terraform@v0.7.0-rc2.0.20160708105029-1401a52a5cc5/website/source/docs/providers/aws/r/iam_role_policy_attachment.markdown (about) 1 --- 2 layout: "aws" 3 page_title: "AWS: aws_iam_role_policy_attachment" 4 sidebar_current: "docs-aws-resource-iam-role-policy-attachment" 5 description: |- 6 Attaches a Managed IAM Policy to an IAM role 7 --- 8 9 # aws\_iam\_role\_policy\_attachment 10 11 Attaches a Managed IAM Policy to an IAM role 12 13 ``` 14 resource "aws_iam_role" "role" { 15 name = "test-role" 16 } 17 18 resource "aws_iam_policy" "policy" { 19 name = "test-policy" 20 description = "A test policy" 21 policy = #omitted 22 } 23 24 resource "aws_iam_role_policy_attachment" "test-attach" { 25 role = "${aws_iam_role.role.name}" 26 policy_arn = "${aws_iam_policy.policy.arn}" 27 } 28 ``` 29 30 ## Argument Reference 31 32 The following arguments are supported: 33 34 * `role` (Required) - The role the policy should be applied to 35 * `policy_arn` (Required) - The ARN of the policy you want to apply