Function 'GetDynamodb' failed to execute for rule. Not able to retrieve and/or parse the requested item from dynamo.

0

We have a rule where the condition is based on data from dynamodb. We wanted the filtering based on if given key had an item in the database. The query looks like:

SELECT * FROM '$aws/events/presence/connected/+' WHERE NOT isNull(get_dynamodb(MY_TABLE, 'HashKey', MY_HASHKEY, 'RangeKey', MY_RANGEKEY, MY_ROLE))

When the data is present the rule works as expected, but when it is not we get these errors logged in CloudWatch:

details: Not able to retrieve and/or parse the requested item from dynamo. ErrorMessage:
eventType: FunctionExecution
logLevel: ERROR
details: Function 'GetDynamodb' failed to execute for rule MY_RULE. Not able to retrieve and/or parse the requested item from dynamo. ErrorMessage:
eventType: RuleExecution
logLevel: ERROR
reason: ExternFunctionException

So the questions are:

  1. Can i use the get_dynamodb function to check if a item exists in the database, or can I only use this function if I know that the data for a given key is present?
  2. Should I expect my error action to trigger in the case described above (testing indicates that my error action is not triggered)?
Magne
질문됨 2년 전391회 조회
1개 답변
1
수락된 답변

Hi Magne.

  1. You can use it when an item is not present, but it will cause the FunctionExecution error you're seeing. So it's probably not the behaviour you're wanting.
  2. No. The error action is only triggered if a rule action suffers an error. Your rule query failed to produce a match (because the error occurred in the WHERE clause) and hence no action was triggered.
profile pictureAWS
전문가
Greg_B
답변함 2년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠