S3 Backup ... suspect access issue

AI-generated summary

The original poster, merefield, is experiencing an Access Denied issue when attempting to backup to S3, causing Sidekiq to pause. To resolve the issue, merefield consulted a guide on IAM and bucket policy for S3 access and setting up file and image uploads to S3. Initially, merefield implemented the policy from the guide, but later found it necessary to modify it to include the s3:GetBucketLocation action in the top-level policy. The updated policy now includes:

"Statement": [
  {
    "Effect": "Allow",
    "Action": [
      "s3:HeadBucket",
      "s3:GetBucketLocation",
      "s3:ListAllMyBuckets"
    ],
    "Resource": "*"
  },

merefield is monitoring the situation to confirm if this updated policy resolves the issue.

Getting an Access Denied issue in error log … which seems to be causing Sidekiq to stay paused after backups!! (which is interesting on its own) - is my access policy on IAM not generous enough?:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "s3:GetBucketLocation",
                "s3:ListAllMyBuckets"
            ],
            "Resource": "*"
        },
        {
            "Effect": "Allow",
            "Action": [
                "s3:ListBucket"
            ],
            "Resource": [
                "arn:aws:s3:::my-discourse-backups"
            ]
        },
        {
            "Effect": "Allow",
            "Action": [
                "s3:PutObject",
                "s3:GetObject"
            ],
            "Resource": [
                "arn:aws:s3:::my-discourse-backups/*"
            ]
        }
    ]
}

Going to try an element of this policy here:

Went with policy in the guide, will monitor for a few days before accepting this as solution:

Actually had to use a slightly different policy to make mine work,

I had to add:

       "s3:GetBucketLocation",

my top level one now looks like:

  "Statement": [
      {
       "Effect": "Allow",
       "Action": [
           "s3:HeadBucket",
           "s3:GetBucketLocation",
           "s3:ListAllMyBuckets"
      ],
       "Resource": "*"
    },

But otherwise based on: