Skip to content

Connect Amazon S3

Updated 29 November 2026

Have your CDN write its logs to an S3 bucket and give Brandexa a read-only IAM role to collect them. No access key is shared.

What to know

Your CDN writes its access logs to an S3 bucket in your AWS account. Brandexa reads the new files every few minutes through an IAM role you create. The role allows read and list on one bucket and prefix. Brandexa stores no access key for you. The logs must be newline-delimited JSON, plain or gzip.

Supported log sources

  • Cloudflare Logpush. A job for the http_requests dataset with an Amazon S3 destination and the NDJSON output type.
  • Fastly. An Amazon S3 logging endpoint with the Fastly log format, gzip, and Select a log line format set to Blank.

Other CDNs that write JSON lines to S3 may work later. Brandexa reads only the two formats above today.

Steps in Brandexa

  1. Open Agent analytics, then Logs, and choose Connect request logs.
  2. Choose Amazon S3, pick the domain and the log format.
  3. Enter the bucket name and, if your logs sit under a folder, the key prefix. Choose Show the policies.
  4. Brandexa shows your external ID, a trust policy and a permissions policy, written for that bucket and prefix.

Create the role in AWS

  1. In the IAM console open Roles, then Create role, then Custom trust policy.
  2. Paste the trust policy from Brandexa. It lets Brandexa assume the role only when it presents your external ID.
  3. Skip the managed policies and create the role. Then open it and add an inline policy with the permissions policy from Brandexa.
  4. Copy the role ARN.

The trust policy has this shape. Use the one Brandexa shows, because it holds your own values:

Trust policy
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Principal": { "AWS": "<BRANDEXA_PRINCIPAL_ARN>" },
      "Action": "sts:AssumeRole",
      "Condition": { "StringEquals": { "sts:ExternalId": "<YOUR_EXTERNAL_ID>" } }
    }
  ]
}

The permissions policy lists one prefix and reads the files in it, and nothing else:

Permissions policy
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": "s3:ListBucket",
      "Resource": "arn:aws:s3:::<BUCKET>",
      "Condition": { "StringLike": { "s3:prefix": "<PREFIX>*" } }
    },
    {
      "Effect": "Allow",
      "Action": "s3:GetObject",
      "Resource": "arn:aws:s3:::<BUCKET>/<PREFIX>*"
    }
  ]
}

Finish in Brandexa

  1. Enter the role ARN and the bucket's region, for example us-east-1.
  2. Choose whether to import the files already in the bucket. Without the import, Brandexa starts with files written after you add the bucket, plus up to six hours before.
  3. Choose Add bucket. Brandexa assumes the role and lists the bucket once to check access.
  4. Choose Check status.

Brandexa checks the bucket about every five minutes. Use a prefix that holds only these logs, and a lifecycle rule that deletes old files, because Brandexa lists the whole prefix on each check.

Brandexa keeps only requests from recognised AI crawlers and search engines. For each one it stores the time, host, path without the query string, method, status, size, country and crawler name. It does not store visitor addresses, query strings, cookies or the user agent text.

If something goes wrong

  • Brandexa cannot assume the role. Check the role ARN, that the trust policy names the principal Brandexa showed, and that the external ID matches exactly.
  • Access denied. The permissions policy is missing or names another bucket or prefix. If the bucket uses a KMS key, the role also needs permission to decrypt with it.
  • Bucket not found. Check the bucket name and its region.
  • Nothing appears. Download one file and check that each line starts with an opening brace. Other formats are not read.
  • To stop access, delete the role in IAM. Brandexa never held a key.

Still need help?

If you have a question or something is not working, get in touch.

Contact us