Amazon S3
BInbox reads delimited text files (.csv, .tsv and .txt) and Excel workbooks (.xlsx) from one bucket and one
folder in it. BInbox only lists and reads, so it calls ListBucket and GetObject and never makes a write call. If a
file is replaced while BInbox reads it, BInbox refuses the file rather than mix the old and new contents. The folder’s
own folders appear as groups of files, and its files appear as tables.
Which files BInbox reads
Section titled “Which files BInbox reads”BInbox lists the files directly in the folder whose names end in .csv, .tsv, .txt or .xlsx, in any case. Other
files and the folder’s own folders’ files are not offered. Each file is a table.
- A delimited text file (
.csv,.tsv,.txt) is read the same way as a file you upload, including the header step. - An Excel workbook (
.xlsx) is read by its sheets, as an uploaded workbook is. You choose the sheets in the setup’s sheet step, and the chosen sheets are put one under another as a single table. With no sheet step, BInbox reads the sheets it suggests. In the schema browser, a workbook’s columns are the header of the suggested sheets. BInbox reads only the parts of the workbook it needs, so its pictures and the sheets you did not choose are not downloaded. - A file over the connection’s byte limit is refused before BInbox reads any of it.
A scheduled copy
Section titled “A scheduled copy”A dataset made from a file can keep a copy of the file on an extract schedule, as a warehouse’s table does. Each run copies the whole file within the connection’s limits and keeps the copy sealed with the dataset. When a copy holds a later complete month or day than the copy before it, that counts as new data, and a report scheduled on new data is queued. When a file no longer parses, or a workbook no longer has a chosen sheet, the copy fails with a message that says why, and nothing is kept. Setting up a dataset from one of these files is not built in the app yet.
What you will paste into BInbox
Section titled “What you will paste into BInbox”On New connection, choose Amazon S3.
| Field | What to enter |
|---|---|
| Bucket | The bucket’s name. |
| Region | The bucket’s region, such as us-east-1. |
| Folder | Optional. The path in the bucket the files are in, such as exports/sales. Leave it empty for the bucket’s top. |
| How BInbox signs in | A service account’s user name and password or key file (an access key) or BInbox’s own identity, trusted by the warehouse (no secret kept) (a role). |
| Access key id | 20 letters and digits starting AKIA. |
| Secret access key | The secret half of the key. |
| Role ARN | Managed identity only. A role’s ARN, arn:aws:iam::<account>:role/<name>. |
Path 1: an IAM user with an access key
Section titled “Path 1: an IAM user with an access key”Save this policy as policy.json, and replace the bucket and folder with your own.
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": "s3:ListBucket", "Resource": "arn:aws:s3:::<bucket>", "Condition": { "StringLike": { "s3:prefix": ["<folder>/", "<folder>/*"] } } }, { "Effect": "Allow", "Action": "s3:GetObject", "Resource": "arn:aws:s3:::<bucket>/<folder>/*" } ]}For the bucket’s top, remove the Condition and use arn:aws:s3:::<bucket>/* for the second statement.
With the command line
Section titled “With the command line”aws iam create-user --user-name binbox-readeraws iam put-user-policy --user-name binbox-reader --policy-name binbox-read --policy-document file://policy.jsonaws iam create-access-key --user-name binbox-readerThe last command prints AccessKeyId and SecretAccessKey, and it shows the secret only once.
In the console
Section titled “In the console”- Open IAM, Users, Create user. Name it
binbox-reader, and do not give it console access. - Choose Attach policies directly, Create policy, the JSON tab, and paste the policy above. Name it
binbox-read, then attach it to the user. - Open the user, Security credentials, Create access key, choose Application running outside AWS, and copy the Access key and Secret access key.
A bucket that uses a customer-managed KMS key also needs kms:Decrypt on that key.
Path 2: a role BInbox assumes
Section titled “Path 2: a role BInbox assumes”Choose this only when BInbox tells you the issuer and subject to trust. Until BInbox gives each account its own token, its identity is shared by every account (see Connect a warehouse), so use Path 1.
BInbox presents its identity token to AWS Security Token Service with the audience sts.amazonaws.com, and assumes the
role for one hour at a time.
aws iam create-open-id-connect-provider --url <issuer> --client-id-list sts.amazonaws.comGive the role a trust policy that names the issuer and the one subject (write the issuer’s host name without
https:// in the condition keys), and attach the policy above to the role:
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": { "Federated": "arn:aws:iam::<account>:oidc-provider/<issuer host>" }, "Action": "sts:AssumeRoleWithWebIdentity", "Condition": { "StringEquals": { "<issuer host>:aud": "sts.amazonaws.com", "<issuer host>:sub": "<subject>" } } } ]}Paste the role’s ARN into Role ARN.
Least permissions
Section titled “Least permissions”| Permission | On | Why BInbox needs it |
|---|---|---|
s3:ListBucket |
The bucket, limited to the folder’s prefix | To list the folder. |
s3:GetObject |
The objects in the folder | To read a file’s first bytes and the rest. |
Do not grant s3:PutObject, s3:DeleteObject or s3:*.
Check: the test-connection report
Section titled “Check: the test-connection report”Choose Test connection in BInbox. All three permissions must be Granted:
| Permission | Granted when |
|---|---|
| Sign in | AWS accepts the key, or the role is assumed. |
| List the files in the folder | The credential may list the folder. |
| Read a file | BInbox reads the first byte of the first non-empty CSV, TSV, text or Excel file in the folder. |
If Read a file says the folder holds no CSV, TSV, text or Excel file to try, the folder is empty or the Folder path is wrong. The folder name is case-sensitive.
Add it in BInbox
Section titled “Add it in BInbox”An owner or admin opens the Data tab at app.binbox.ai, chooses Connect, then New connection, fills in the fields above, and chooses Test and save. Connections describes the screen.
Setting up a dataset from one of the connection’s files is not built in the app yet. Pick a table covers tables and views.