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
已提問 7 個月前檢視次數 193 次
1 個回答
1
已接受的答案

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
支援工程師
已回答 7 個月前
  • Thanks! Does the document say file:// ? I don't see it - am I missing it?

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南