I want to fetch documents form an opensearch index with read_only permissions using the Scroll API. I tried these permissions for my role
indices:data/read/scroll/clear
indices:data/read/scroll
read
and
read
But when I run (using the python sdk):
self.client.clear_scroll(scroll_id=scroll_ids_str)
when the opensearch package tries to run
return self.transport.perform_request(
"DELETE", "/_search/scroll", params=params, headers=headers, body=body
)
I get this autorization error as a warning:
AuthorizationException(403, 'security_exception', {'error': {'root_cause': [
{'type': 'security_exception', 'reason': 'no permissions for [indices:data/read/scroll/clear] and User [name=arn:aws:iam::<AWSID>:user/<NAME>, backend_roles=[], requestedTenant=null]'}],
'type': 'security_exception', 'reason': 'no permissions for [indices:data/read/scroll/clear] and User [name=arn:aws:iam::<AWSID>:user/<NAME>, backend_roles=[], requestedTenant=null]'}, 'status': 403})
Note that I explicitly added the suggested permission to my role. Also, I can successfully fetch all the desired documents, but I do not like that the warning suggests that I am not cleaning up some resources.
QUESTION: How do I successfully delete the scroll context with read only permissions?
Version: opensearch-py==2.2.0