SQL Template and Script that can be used to import access logs generated by CloudFront and stored in an s3 bucket.
The script uses psql
to run the import script against Redshift, so the script should be ran in a location where psql
is on the PATH such as postgres:9.4
var | description |
---|---|
PGHOST |
Redshift hostname/ip |
PGPORT |
Redshift port |
PGDATABASE |
Redshift database name |
PGUSER |
Redshift user |
PGPASSWORD |
Redshift user password |
PGSCHEMA |
Redshift Schema |
PGTABLE |
Redshift table |
AWS_ACCESS_KEY_ID |
AWS API Access Key |
AWS_SECRET_ACCESS_KEY |
AWS API Secret Key |
AWS_BUCKET_URI_BASE |
AWS S3 bucket that contains the CloudFront access log zip files |
AWS_BUCKET_REGION |
AWS Region the bucket is in |