Files
opentf/website/source/docs/providers/aws/r/sqs_queue_policy.html.markdown
George Christou 61277c0dbd website/docs: Run terraform fmt on code examples (#12075)
* docs/vsphere: Fix code block

* docs: Convert `...` to `# ...` to allow `terraform fmt`ing

* docs: Trim trailing whitespace

* docs: First-pass run of `terraform fmt` on code examples
2017-02-19 00:48:50 +02:00

1.0 KiB

layout, page_title, sidebar_current, description
layout page_title sidebar_current description
aws AWS: aws_sqs_queue_policy docs-aws-resource-sqs-queue-policy Provides a SQS Queue Policy resource.

aws_sqs_queue_policy

Allows you to set a policy of an SQS Queue while referencing ARN of the queue within the policy.

Example Usage

resource "aws_sqs_queue" "q" {
  name = "examplequeue"
}

resource "aws_sqs_queue_policy" "test" {
  queue_url = "${aws_sqs_queue.q.id}"

  policy = <<POLICY
{
  "Version": "2012-10-17",
  "Id": "sqspolicy",
  "Statement": [
    {
      "Sid": "First",
      "Effect": "Allow",
      "Principal": "*",
      "Action": "sqs:SendMessage",
      "Resource": "${aws_sqs_queue.q.arn}",
      "Condition": {
        "ArnEquals": {
          "aws:SourceArn": "${aws_sqs_queue.q.arn}"
        }
      }
    }
  ]
}
POLICY
}

Argument Reference

The following arguments are supported:

  • queue_url - (Required) The URL of the SNS Queue to which to attach the policy
  • policy - (Required) The JSON policy for the SQS queue