This guide explains how Spoke manages data exports and how to configure them in your installation.
When a user requests a data export, Spoke prepares it behind the scenes. When the data is ready, it is uploaded to an Amazon Web Services (AWS) S3 bucket. A S3 bucket is a cloud storage container. Once the exported data has been added to the bucket, Spoke sends an email notification to the user who requested the export with a link to download the data file.
To enable data exporting, you will need:
- to configure Spoke to send emails,
- access to an AWS account, and
- a S3 bucket in that account.
If you have deployed Spoke to Heroku, you can use the Bucketeer add-on instead of configuring your own S3 bucket. Bucketeer automatically provisions S3 storage for you, enabling you to skip the numbered steps below. The tradeoff is that Bucketeer charges you a minimum of $5/month. Depending on your usage, this may well be more than you'd pay for your own S3 bucket, especially if you're new to AWS and taking advantage of the free tier.
To use Bucketeer, skip to the end of this document.
Skip this section if you are using Bucketeer.
- Configure Spoke to send emails.
- Create an AWS account. If you already have an AWS account, skip this step. Otherwise, see Amazon's documentation to create an AWS account.
- Sign up for S3. If you already have S3, skip this step. Otherwise, see Amazon's documentation to sign up for S3 using your AWS account.
- Create a S3 bucket. If you already have an S3 bucket, skip this step. Otherwise, see Amazon's documentation to create an S3 bucket. You don't need to enable public access to the bucket.
- Configure Spoke environment variables. In order for Spoke to connect to S3, the following environment variables must be set:
-
AWS_ACCESS_KEY_ID
-AWS_S3_BUCKET_NAME
-AWS_SECRET_ACCESS_KEY
If you've reached this point in application setup, you've probably configured environment variables already. Here are Heroku and AWS Lambda instructions. Locally, you can use a .env
file or the like.
Skip this section if you have set up your own S3 bucket.
- Provision the Bucketeer add-on. Use the Heroku CLI (instructions here) or the Heroku dashboard. You can migrate between plans at any time with no downtime.
- Modify the default environment variables. Bucketeer sets the following environment variables:
BUCKETEER_AWS_ACCESS_KEY_ID
BUCKETEER_AWS_SECRET_ACCESS_KEY
BUCKETEER_BUCKET_NAME
Spoke, however, expects these names:
AWS_ACCESS_KEY_ID
AWS_S3_BUCKET_NAME
AWS_SECRET_ACCESS_KEY
You can change the names in the dashboard or via the CLI. heroku config:edit
will open all environment variables in an interactive editor.