Prepare the bucket in AWS
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.
- You need permission in AWS to create buckets, edit bucket policies, and create event notifications.
Steps
- 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.
-
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 following statement to the bucket policy. If the bucket already has a policy, add the statement to its
Statementlist. See Adding a bucket policy by using the Amazon S3 console. -
Replace
<processor-role-arn>with the value of Processor Role ARN. Replace<bucket-name>with the name of the bucket. - Save the bucket policy.
-
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
This task is optional. With an ingestion-error bucket, Zenskar writes an error file for each file that it rejects.Prerequisites
- You need the value of Processor Role ARN from Settings > S3 Ingestion. See Prepare the bucket in AWS.
- You need permission in AWS to create buckets and edit bucket policies.
Steps
- 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 following statement to the bucket policy. If the bucket already has a policy, add the statement to its
Statementlist. See Adding a bucket policy by using the Amazon S3 console. -
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
Prerequisites
- You need a role with the Can Read Organisation Config and Can Update Organisation Config 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.
Steps
- 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
Prerequisites
- You need a role with the Can Read Organisation Config and Can Update Organisation Config permissions.
- To move the usage-event collections to the new buckets, you also need the Can Read Usage Event and Can Update Usage Event 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.
Steps
- Go to Settings > S3 Ingestion, and 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. The dashboard confirms the change.
- 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 steps 5 to 7 for each usage-event collection with S3 ingestion.
Disconnect the bucket
Prerequisites
- You need a role with the Can Read Organisation Config and Can Update Organisation Config permissions.
Steps
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. The dashboard asks you to confirm.
- Click Disconnect.
Check that S3 ingestion works
Prerequisites
- You need a role with the Can Read Usage Event permission.
- 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.
Steps
-
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. Keep the file in the bucket until its usage events appear. If the processing fails, Zenskar can download the file again to retry it. - In Zenskar, go to Usage > Usage Events, and click the usage-event collection.
- Click REFRESH TABLE.