Error in cloudwatch logs while attempting to indexing data in an Amazon ES cluster -


i'm following this tutorial automatically index dynamodb streams amazon elasticsearch service cluster created .

i followed step step , created permissions policies.

however, when testing, nothing indexed in amazon es cluster. when check cloudwatch, see log:

('error: ', 'traceback (most recent call last):  file "/var/task/lambda_function.py", line 123, in lambda_handler  return _lambda_handler(event, context)  file "/var/task/lambda_function.py", line 219, in _lambda_handler  post_to_es(es_payload) # post es exponential backoff  file "/var/task/lambda_function.py", line 86, in post_to_es  es_ret_str = post_data_to_es(payload, es_region, creds, es_endpoint, \'/_bulk\')  file "/var/task/lambda_function.py", line 53, in post_data_to_es  req = botocore.awsrequest.create_request_object(params)  file "/var/runtime/botocore/awsrequest.py", line 314, in create_request_object  request_object.context.update(r[\'context\']) keyerror: \'context\' ') 

i don't understand issue. know lambda function trigger each dynamodb streams , can send logs cloudwatch, cannot index these data in amazon es.

someone please can me solve issue?

there recent breaking change in botocore code being used aws lambda.

the effected line of code is:
req = botocore.awsrequest.create_request_object(params)

with new changes, expecting argument params contain 'context' field.

so please add context field params argument: example: params = {'method': method, 'url': proto + host + path, 'region': region, 'headers': {'host': host}, 'body': payload,'context': {'signing': {'region': 'us-east-1'}}}

once make above changes, lambda should able run successfully.

details: in file botocore.awsrequest, code change @ line 314 causing issue. https://github.com/boto/botocore/commit/28b8831f5f8518bef5accf994fc377c58a3569f7#diff-cb00fc815f8f80ae15e7d0cecc74b395


Comments

Popular posts from this blog

java - Suppress Jboss version details from HTTP error response -

gridview - Yii2 DataPorivider $totalSum for a column -

Sass watch command compiles .scss files before full sftp upload -