I'm wondering how to upload to S3 on IoT FleetWise.
I checked the demo.sh file on Github.
Should I create a CLI that I need to upload to S3 within the shell script?
Or does it automatically upload to S3 when I deploy the campaign?
The code below is the part I upload to S3 from the demo.sh file I checked.
`if ${S3_UPLOAD}; then
DELAY=1200
echo "Waiting 20 minutes for data to be collected and uploaded to S3..."
sleep ${DELAY}
echo "Downloading files from S3..."
S3_URL="s3://${BUCKET_NAME}/${NAME}-campaign-s3-${S3_SUFFIX}/processed-data/"
if ! COLLECTED_FILES=`aws s3 ls --recursive ${S3_URL}`; then
echo "Error: no collected data was found at ${S3_URL}"
exit -1
fi
echo "${COLLECTED_FILES}" | while read LINE; do
KEY=`echo ${LINE} | cut -d ' ' -f4`
aws s3 cp s3://${BUCKET_NAME}/${KEY} ${COLLECTED_DATA_DIR}
done`