Configuring an Amazon S3 Route
Notehub allows you to route data to Amazon S3 buckets. This is most commonly used to archive Notefile data in one or more JSON files.
Creating a route for Amazon S3 requires access to the Development Edition of Notehub. Learn more about Notehub pricing.
Configuring the Route
To create an Amazon S3 route, open your Notehub project, head to the Settings tab and click the Archive menu item.
On the next screen you'll be asked to provide a variety of values to configure your Amazon S3 route. Below are the fields you'll need to provide to get a route up and running, but from there you can customize other pre-filled fields as necessary.
-
ArchiveID: This is a user-defined name for the archive. It will be the top-level directory name within the S3 bucket you create.
-
FileFolder: This provides a template for the folder structure within the S3 bucket (e.g.
[id]/[year]-[month]/[device]
). Only visible if Monthly Folder isfalse
. -
BucketEndpoint: The S3 bucket endpoint. If using AWS this can be left as "(default)", for other S3 compatible services this should be set to the endpoint URL.
-
BucketRegion: The AWS region for the S3 bucket (e.g.
us-east-2
). -
BucketName: The unique S3 bucket name (either an existing bucket or a new bucket that will be created when the first event is routed from Notehub).
-
KeyID: The identifier for the AWS Access Key (see "AWS Authentication" below).
-
KeySecret: The "Secret Access Key" associated with the AWS Access Key (see "AWS Authentication" below).
If you don't already have an access key configured, you may do so now in the AWS Console or follow the next set of instructions to create a root user access key.
AWS Authentication
The quickest and easiest way to provision access to an S3 bucket in the AWS Console is to create a root user access key. This is not recommended by AWS, so it's best to only be used as a temporary measure.
Read more about managing AWS access keys in the AWS documentation.
-
In your AWS Console, click on your user name in the upper-right corner, and choose Security credentials.
-
Scroll down to Access keys and click on Create access key.
-
Follow the prompts to create a new access key and copy the values for the Access key and the Secret access key to your clipboard.
Complete S3 Archive Route Configuration
-
Back in Notehub, copy and paste the Access key and the Secret access key values from your AWS Console into the KeyID and KeySecret fields of the Notehub route creation screen.
-
Scroll to the Filters section, set the Notefiles dropdown to Selected Notefiles, and select the Notefile you want to use this route for.
-
When you're all set, click the Apply changes button to save your new route.
Testing the Route
With the Amazon S3 route created, you're now ready to test it out. While the purpose of this route is to batch archive events over time, you can still test the route by sending a single event via the Notehub UI.
-
Within the details of an existing event you'd like to archive, click the Route event button:
-
In the modal dialog that appears, select the S3 archive route you just created and click the Route button to route the event immediately.
-
The response from AWS should be an empty JSON object
{}
, which means routing to the S3 bucket was successful. -
Back in your AWS Console, navigate to the the S3 Buckets management page. You should see the generated S3 bucket and be able to drill down into the event JSON file you just routed: