Support Questions
Find answers, ask questions, and share your expertise

PutDynamoDb example


PutDynamoDb example

New Contributor

Can someone please post an example of how to configure a PutDynamoDB processor.

I have a table kv where:

Primary partition key: k Primary sort key: v

example json string {"k":"123","v":"value123"}

What should I use for:

Hash Key Name?

Range Key Name?

Json Document attribute?

You are welcome to provide a better example with corresponding properties and values.


Re: PutDynamoDb example


take a look at the mock tests for dynamodb processors for examples and here's the jira describing the effort

here's a snippet from tests

putRunner.setProperty(AbstractDynamoDBProcessor.CREDENTIALS_FILE, CREDENTIALS_FILE);
putRunner.setProperty(AbstractDynamoDBProcessor.REGION, REGION);
putRunner.setProperty(AbstractDynamoDBProcessor.TABLE, stringHashStringRangeTableName);
putRunner.setProperty(AbstractDynamoDBProcessor.HASH_KEY_NAME, "hashS");
putRunner.setProperty(AbstractDynamoDBProcessor.HASH_KEY_VALUE, "h1");
putRunner.setProperty(AbstractDynamoDBProcessor.RANGE_KEY_NAME, "rangeS");
putRunner.setProperty(AbstractDynamoDBProcessor.RANGE_KEY_VALUE, "r1");
putRunner.setProperty(AbstractWriteDynamoDBProcessor.JSON_DOCUMENT, "document");

Re: PutDynamoDb example

New Contributor

@Artem Ervits this example doesnt show how to parse the json. I tried ${keyName} and the default one. both didnt work.

Re: PutDynamoDb example

Were you able to figure out how it should be configured? These set of processors are poorly documented.


Re: PutDynamoDb example


@tcpip001to set hash key in your case you must create an EvaluateJsonPath and add a new attribute for each property that you're using, following your example:

For Hash Key:

Property: hashKey

Value: $.k

For Range Key I believe that is the same process:

Property: rangeKey

Value: $.v


And finally go to PutDynamoDb processor and put in the properties:

Hash Key Value: ${hashKey}

Range Key Value: ${rangeKey}


I hope this could help you.