Ship S3 to Redshift using COPY command
- Ensure that Redshift can SSH into the host to copy file. Add the SSH key of Redshift to ~/.ssh/authorized_keys file
- Install AWS CLI. For simplicity, we use AWS CLI to download/upload s3 file
- Create a directory /s32rs, make it writable to user who runs this app
PG_USER
username of redshiftPG_PWD
passwordPG_DB
db namePG_HOST
redshift hostPG_PORT
redshift portAWS_KEY
an aws key to store manifestAWS_SECRET
secret keyAWS_BUCKET_S32RS
bucket name(above key/secret should have permission to write to this)SSH_USER
usernameSSH_IP
public ip
The S3 bucket is a place to store manifest file. Manifest is very small, just a couple of JSON. http://docs.aws.amazon.com/redshift/latest/dg/loading-data-files-using-manifest.html
Standalone mode to try
source run
make build
curl --data "project_id=...&aws_key=..&aws_secret=...&s3_bucket=..." https://127.0.0.1:3001/work