github.com/danp/terraform@v0.9.5-0.20170426144147-39d740081351/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 ```hcl 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 24 policy = <<POLICY 25 { 26 "Version": "2012-10-17", 27 "Id": "sqspolicy", 28 "Statement": [ 29 { 30 "Sid": "First", 31 "Effect": "Allow", 32 "Principal": "*", 33 "Action": "sqs:SendMessage", 34 "Resource": "${aws_sqs_queue.q.arn}", 35 "Condition": { 36 "ArnEquals": { 37 "aws:SourceArn": "${aws_sqs_queue.q.arn}" 38 } 39 } 40 } 41 ] 42 } 43 POLICY 44 } 45 ``` 46 47 ## Argument Reference 48 49 The following arguments are supported: 50 51 * `queue_url` - (Required) The URL of the SQS Queue to which to attach the policy 52 * `policy` - (Required) The JSON policy for the SQS queue