- Newest
- Most votes
- Most comments
That error means OpenSearch can write the temporary test file to your S3 bucket but can’t delete it afterward during repository verification. The snapshot repository plugin needs both write and delete access to the target bucket and its objects. In your IAM policy, you likely have s3:PutObject and s3:ListBucket, but either s3:DeleteObject or the correct bucket ARN is missing. The resource ARNs must point to the exact bucket and prefix, for example arn:aws:s3:::my-snapshot-bucket for ListBucket and arn:aws:s3:::my-snapshot-bucket/* for object-level actions.
—Taz
answered 10 months ago
The error you're encountering when creating an S3 snapshot repository in OpenSearch is related to permissions issues. While your repository is being created and test directories are appearing in S3, the service is unable to delete these test files, resulting in the "Access Denied" error.
Based on your IAM policy and trust relationship configuration, here are some potential issues and solutions:
-
S3 Bucket Policy: Check if your S3 bucket has a bucket policy that might be restricting delete operations. Even though your IAM role has the necessary permissions, the bucket itself might have restrictions.
-
S3 Bucket Ownership: Ensure that the bucket ownership settings aren't causing conflicts. If Object Ownership is set to "Bucket owner preferred" or "Object writer", it might affect permissions.
-
Fine-grained Access Control: If you have fine-grained access control enabled on your OpenSearch domain, you need to ensure that:
- The user making the request has the appropriate role mappings in OpenSearch
- The role has permissions for
cluster:admin/repository/putand other snapshot-related actions
-
Authentication Method: When registering a snapshot repository with fine-grained access control enabled, you need to make a signed request with AWS Signature Version 4 authentication. If you're using the Dev Tools console in OpenSearch Dashboards, you might be making an unsigned request as an "anonymous" user from AWS's perspective.
-
Role Mapping: Ensure that your IAM role is properly mapped to a role in OpenSearch that has snapshot permissions. In OpenSearch Dashboards, go to Security > Roles > manage_snapshots, then choose Mapped users > Manage mapping, and add the ARN of your IAM role under Backend roles.
-
Trust Relationship: Your trust relationship looks correct with both
es.amazonaws.comandopensearch.amazonaws.comas trusted services.
Try using a tool like Postman to make properly signed requests when registering the repository, as this can help ensure proper authentication with your AWS credentials.
Sources
OpenSearch snapshots repo registration error: User: anonymous is not authorized to perform: iam:PassRole | AWS re:Post
[OpenSearch error: no permissions for [cluster:admin/repository/put] and User name=arn:aws-us-gov:iam::123456789012:user/opensearch-repo-user | AWS re:Post
Creating index snapshots in Amazon OpenSearch Service - Amazon OpenSearch Service
Opensearch manual snapshot issues | AWS re:Post
answered 10 months ago

I've bumped the policy to the following and I'm still getting the same error. Please note that I'm able to create the test files, so the
PutObjectpermission is working, and it's defined on the same block as theDeleteObject