Skip to content

Instantly share code, notes, and snippets.

@garystafford
Last active March 4, 2020 02:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save garystafford/4761097da42de29b6ce38b5a226ed2f3 to your computer and use it in GitHub Desktop.
Save garystafford/4761097da42de29b6ce38b5a226ed2f3 to your computer and use it in GitHub Desktop.
# Get data bucket name
DATA_BUCKET=$(aws cloudformation describe-stacks \
--stack-name redshift-stack \
| jq -r '.Stacks[].Outputs[] | select(.OutputKey == "DataBucket") | .OutputValue')
echo $DATA_BUCKET
# Copy data
aws s3 cp data/history.csv s3://${DATA_BUCKET}/history/history.csv
aws s3 cp data/location.csv s3://${DATA_BUCKET}/location/location.csv
aws s3 cp data/manufacturer.csv s3://${DATA_BUCKET}/manufacturer/manufacturer.csv
aws s3 cp data/sensor.csv s3://${DATA_BUCKET}/sensor/sensor.csv
aws s3 cp data/sensors.csv s3://${DATA_BUCKET}/sensors/sensors.csv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment