- Newest
- Most votes
- Most comments
The error you're encountering is related to permissions required for passing an IAM role to the OpenSearch service. When using internal users (fine-grained access control) with OpenSearch, there's still a need to properly configure IAM permissions for certain operations like S3 snapshots.
To resolve the "not authorized to perform: iam:PassRole" error, you need to:
-
Create or modify an IAM user/role that you'll use to make the API call to register the snapshot repository.
-
Attach a policy to this IAM user/role that explicitly allows the
iam:PassRolepermission for your snapshot role. The policy should look similar to:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "iam:PassRole",
"Resource": "arn:aws:iam::<AWS_ACC>:role/opensearch-snapshot-role"
},
{
"Effect": "Allow",
"Action": "es:ESHttpPut",
"Resource": "arn:aws:es:<region>:<AWS_ACC>:domain/<domain-name>/*"
}
]
}
- Instead of using the OpenSearch dashboard's Dev Tools to register the repository, you'll need to use the AWS SDK or CLI with the IAM credentials of the user/role that has the PassRole permission.
The key issue is that when using internal users in OpenSearch, those users don't have AWS IAM permissions. The "anonymous" in the error message indicates that the request isn't being made with valid IAM credentials that have the PassRole permission. Even though you're authenticated to the OpenSearch dashboard as the master user, that authentication doesn't provide IAM permissions.
For operations that require IAM permissions like registering an S3 snapshot repository, you need to use AWS credentials with the appropriate IAM permissions outside of the OpenSearch dashboard interface.
Sources
Creating index snapshots in Amazon OpenSearch Service - Amazon OpenSearch Service
Resolve the IAM error "not authorized to perform iam:PassRole" | AWS re:Post
answered a year ago
