Prepare the bucket in AWS
Set up the S3 bucket that holds the files of usage events. Zenskar can then read the bucket. The bucket gets a bucket policy for the processor role and an event notification to the Zenskar SQS queue.Prerequisites
- You need a role with the Can Read Organisation Config permission. See Permissions.
- You need permission in AWS to create buckets, edit bucket policies, and create event notifications.
Copy the Zenskar ARNs
- Go to Settings > S3 Ingestion. If the bucket connection already exists, click Edit.
- Under Step 1 Configure your S3 bucket, copy Processor Role ARN. Keep it for the bucket policy.
- Copy SQS Queue ARN. Keep it for the event notification.
Choose the bucket
- In AWS, create a bucket in the region
us-east-1, or choose an existing bucket in that region. See Creating a bucket.
Add the bucket policy
-
Add the following statement to the bucket policy. See Adding a bucket policy by using the Amazon S3 console. If the bucket already has a policy, add the statement to its
Statementlist. -
Replace
<processor-role-arn>with the value of Processor Role ARN. Replace<bucket-name>with the name of the bucket. - Save the bucket policy.
Add the event notification
-
Create an event notification on the bucket with the following settings. See Enabling and configuring event notifications using the Amazon S3 console.
- Save the event notification.
Prepare an ingestion-error bucket
Set up an ingestion-error bucket. Zenskar then writes an error file for each file that it rejects. This task is optional.Prerequisites
- You need the value of Processor Role ARN. See Copy the Zenskar ARNs.
- You need permission in AWS to create buckets and edit bucket policies.
Choose the bucket
- In AWS, create a bucket, or choose an existing bucket. It can be the bucket that holds the files of usage events. See Creating a bucket.
Add the bucket policy
-
Add the following statement to the bucket policy. See Adding a bucket policy by using the Amazon S3 console. If the bucket already has a policy, add the statement to its
Statementlist. -
Replace
<processor-role-arn>with the value of Processor Role ARN. Replace<error-bucket-name>with the name of the bucket. - Save the bucket policy.
Connect the bucket in Zenskar
Enter the bucket in Zenskar to create the bucket connection of the organization. Add the ingestion-error bucket in the same step.Prerequisites
- You need a role with the Can Read Organisation Config and Can Update Organisation Config permissions. See Permissions.
- The bucket must have its bucket policy and event notification. See Prepare the bucket in AWS.
- If you add an ingestion-error bucket, it must have its bucket policy. See Prepare an ingestion-error bucket.
Enter the bucket details
- Go to Settings > S3 Ingestion. The screen shows Not Connected.
- Under Step 2 Enter your bucket details, in S3 Bucket Name, enter the name of the bucket, without the
s3://prefix. - Optional: In Ingestion Error Bucket (Optional), enter the name of the ingestion-error bucket, without the
s3://prefix. - Click Save Config.
Change the bucket connection
Change the bucket or the ingestion-error bucket of the bucket connection. Then move each usage-event collection to the new buckets.Prerequisites
- You need a role with the Can Read Organisation Config and Can Update Organisation Config permissions. To move the usage-event collections, you also need Can Read Usage Event and Can Update Usage Event. See Permissions.
- A new bucket must have its bucket policy and event notification. See Prepare the bucket in AWS.
- A new ingestion-error bucket must have its bucket policy. See Prepare an ingestion-error bucket.
Change the bucket details
- Go to Settings > S3 Ingestion. Click Edit. The fields show the current bucket names.
- Change S3 Bucket Name, Ingestion Error Bucket (Optional), or both. To remove the ingestion-error bucket, clear its field.
- Click Save Config. To discard the change, click Cancel.
Move the usage-event collections to the new buckets
- Go to Usage > Usage Events. The S3 Ingestion column shows the usage-event collections with S3 ingestion.
- Click a usage-event collection with S3 ingestion.
- Under S3 Ingestion, click Edit.
- Click SAVE. You do not need to change the folders.
- Repeat for each usage-event collection with S3 ingestion.
Disconnect the bucket
Remove the bucket connection of the organization. S3 ingestion stops for every usage-event collection.Prerequisites
- You need a role with the Can Read Organisation Config and Can Update Organisation Config permissions. See Permissions.
Disconnect
Disconnecting turns off S3 ingestion on every usage-event collection. It also clears the folder and the error folder of each usage-event collection. Connecting a bucket again does not restore them. Before you disconnect, note the folders of each usage-event collection.
- Go to Settings > S3 Ingestion.
- Click Disconnect. Zenskar asks you to confirm.
- Click Disconnect.
Check that S3 ingestion works
Upload a test file to the folder of a usage-event collection. Check that its usage events arrive.Prerequisites
- You need a role with the Can Read Usage Event permission. See Permissions.
- The usage-event collection must have S3 ingestion turned on. See Set up S3 ingestion for a usage-event collection.
- You need permission in AWS to upload files to the bucket.
Upload a test file
- Create a CSV file whose header row names every field of the data schema of the usage-event collection, including
customer_idandtimestamp. To start from the right columns, download the sample file of the usage-event collection. See Upload usage events from a CSV file. - Upload the file to the folder of the usage-event collection, such as
api_calls/test-2026-10-28.csv. See Uploading objects. - In Zenskar, go to Usage > Usage Events. Click the usage-event collection.
- Click REFRESH TABLE. The Events Table shows the usage events of the file.
When no usage events appear
- In the ingestion-error bucket, open the error folder of the usage-event collection. Without an error folder, open the folder
errors. - Open the error file whose name starts with the name of the test file. It names the error, or lists each rejected row.
- Correct the file. Upload it again.
.csv at the end of the file name. See Troubleshooting.
Webhook alerts can also report the result of each file. See Webhook alerts.