Take input from file for timestream-write write-records

0

I know of several workarounds, but still, it would be handy to be able to execute

aws timestream-write write-records --records ...

and specify records coming from a file. A workaround is you just create an input.json file then

aws timestream-write write-records --records $(cat input.json) ...

and that works, if you're on a unix-ish system. I seem to recall some other apps that let you use something like:

--records "@file.json"

but I can't remember exactly where.

I think this would be a useful feature, and I'd like to make a feature request, where should I make that request? Is mentioning it here good enough?

--Chris

profile picture
wz2b
asked 7 months ago178 views
1 Answer
1
Accepted Answer

AWS CLI command that is being referred by you is "aws timestream-write write-records" which takes "LIST" as a valid value in --records option. However, as per the below document, JSON Syntax can also be used to specify this value and you can have a JSON file to parse the data for --records option.

https://docs.aws.amazon.com/cli/latest/reference/timestream-write/write-records.html

I used the below command to test the use case and it executed correctly inserting the row value inside the Timestream table as per the JSON file. (The file name is "test.json" which is present in directory where the command is executed from)

aws timestream-write write-records --database-name database1 --table-name table1 --records file://test.json

Kindly try the same and see if this fulfills your use case.

AWS
SUPPORT ENGINEER
answered 7 months ago
  • Thanks! Does the document say file:// ? I don't see it - am I missing it?

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions