#!/usr/bin/env bash
IFS=" " read AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY AWS_SESSION_TOKEN <<< $(aws sts assume-role --role-arn="$S3_UPLOAD_ROLE_ARN" --role-session-name=tcagent-bench-s3-upload --query 'Credentials.[AccessKeyId,SecretAccessKey,SessionToken]' --output=text)
export AWS_ACCESS_KEY_ID ; export AWS_SECRET_ACCESS_KEY ; export AWS_SESSION_TOKEN

aws s3 sync ./output s3://$S3_BUCKET/$START_TIME
aws s3 sync ./output s3://$S3_BUCKET/$START_TIME
