github.com/ves/terraform@v0.8.0-beta2/website/source/docs/providers/aws/r/sqs_queue_policy.html.markdown (about) 1 --- 2 layout: "aws" 3 page_title: "AWS: aws_sqs_queue_policy" 4 sidebar_current: "docs-aws-resource-sqs-queue-policy" 5 description: |- 6 Provides a SQS Queue Policy resource. 7 --- 8 9 # aws\_sqs\_queue\_policy 10 11 Allows you to set a policy of an SQS Queue 12 while referencing ARN of the queue within the policy. 13 14 ## Example Usage 15 16 ``` 17 resource "aws_sqs_queue" "q" { 18 name = "examplequeue" 19 } 20 21 resource "aws_sqs_queue_policy" "test" { 22 queue_url = "${aws_sqs_queue.q.id}" 23 policy = <<POLICY 24 { 25 "Version": "2012-10-17", 26 "Id": "sqspolicy", 27 "Statement": [ 28 { 29 "Sid": "First", 30 "Effect": "Allow", 31 "Principal": "*", 32 "Action": "sqs:SendMessage", 33 "Resource": "${aws_sqs_queue.q.arn}", 34 "Condition": { 35 "ArnEquals": { 36 "aws:SourceArn": "${aws_sqs_queue.q.arn}" 37 } 38 } 39 } 40 ] 41 } 42 POLICY 43 } 44 ``` 45 46 ## Argument Reference 47 48 The following arguments are supported: 49 50 * `queue_url` - (Required) The URL of the SNS Queue to which to attach the policy 51 * `policy` - (Required) The JSON policy for the SQS queue