Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

streaming data from DynamoDB to elasticsearch is failing with "no permissions for [indices:data/write/bulk]"

I'm trying to stream data from DynamoDB to ElasticSearch. I've checked the documentation by AWS + some other sources online but I'm stuck on a security issue. So I'm using a lambda function, the process of retrieving data from DynamoDB is fine, but then when I try to write back to ElasticSearch I get an error:

"no permissions for [indices:data/write/bulk] and User [name=arn:aws:iam::account number:role/dynamodb_to_es, backend_roles=[arn:aws:iam::account number:role/dynamodb_to_es], requestedTenant=null]"

This is my Lambda function. I realized it would always fail because of the "_bulk" extension. Thank you!!

My Lambda function: https://github.com/YassineRjl/Lambda-Func---DynamoDB-to-ElasticSearch/blob/master/lambda_func.py

My IAM role: enter image description here

like image 499
legacycode Avatar asked Dec 22 '22 18:12

legacycode


1 Answers

You don't have to disable "fine-grained access control". Instead, you can edit role mapping.

For detailed information & steps please check:

https://aws.amazon.com/tr/premiumsupport/knowledge-center/es-troubleshoot-cloudwatch-logs/

"I'm unable to stream my CloudWatch log group to an Amazon ES domain when fine-grained access control is enabled." subject.

like image 158
Alper Avatar answered Apr 26 '23 04:04

Alper