Setting up SQS queue permissions

You must set up SQS queue permissions for users to access the queue.

Before you begin

You must complete Creating the SQS queue that is used to receive ObjectCreated notifications.

You can set the SQS queue permissions by using either the Permissions Editor or a JSON policy document.

Procedure

  1. Log in to the AWS Management Console as an administrator.
  2. Go to the SQS Management Console, and then select the queue that you created from the list.
  3. From the Properties window, select Details, and record the ARN field value.

    Example: arn:aws:sqs:us-east-1:123456789012:MySQSQueueName

  4. To set the SQS queue permissions by using the Permissions Editor, complete the following steps.
    1. From the Properties window, select Permissions > Add a Permission, and then configure the following parameters:
      Table 1. Permission parameters
      Parameter Value
      Effect Click Allow.
      Principal Click Everybody (*).
      Actions From the list, select SendMessage
    2. Click Add Conditionals (Optional), and then configure the following parameters:
      Table 2. Add Conditionals (Optional) parameters
      Parameter Value
      Qualifier None
      Condition ARNLike
      Key Type aws:SourceArn.
      Value The ARN of the S3 bucket from when you completed the Finding the S3 bucket that contains the data that you want to collect procedure.

      Example: aws:s3:::my-example-s3bucket

    3. Click Add Condition > Add Permission.
  5. To set the SQS queue permissions by using a JSON Policy Document, complete the following steps.
    1. In the Properties window, select Edit Policy Document (Advanced).
    2. Copy and paste the following JSON policy into the Edit Policy Document window:

      Copy and paste might not preserve the white space in the JSON policy. The white space is required. If the white space is not preserved when you paste the JSON policy, paste it into a text editor and restore the white space. Then, copy and paste the JSON policy from your text editor into the Edit Policy Document window.

      {
        "Version": "2008-10-17",
        "Id": "example-ID",
        "Statement": [
          {
            "Sid": "example-statement-ID",
            "Effect": "Allow",
            "Principal": {
              "AWS": "*"
            },
            "Action": "SQS:SendMessage",
            "Resource": "arn:aws:sqs:us-east-1:123456789012:MySQSQueueName",
            "Condition": {
              "ArnLike": {
                "aws:SourceArn": "arn:aws:s3:::my-example-s3bucket"
              }
            }
          }
        ]
      }
  6. Click Review Policy. Ensure that the data is correct, and then click Save Changes.

What to do next

Creating ObjectCreated notifications