Create the S3 buckets

Create the knowledge-base bucket and the Langfuse bucket that Meko BYOC uses

Meko uses two S3 buckets. Create both before you install.

Bucket Variable Holds Region
Knowledge base KB_S3_BUCKET Documents users upload. The API server writes them and the knowledge-base workers read them. Must be BEDROCK_REGION
Langfuse LANGFUSE_S3_BUCKET Every conversation event Langfuse ingests, plus its media and exports. Traces and observations are stored in the database. Any Region

The knowledge-base workers use one Region setting for both Bedrock and S3, so the knowledge-base bucket must be in the Region where you use Bedrock (BEDROCK_REGION, default us-east-1).

Create the buckets

Set the names and Regions. S3 bucket names are global, so choose names that are unique to you.

export BEDROCK_REGION=us-east-1
export KB_S3_BUCKET=meko-kb-store
export LANGFUSE_S3_REGION=us-east-2
export LANGFUSE_S3_BUCKET=meko-traces-store

Create the knowledge-base bucket. In us-east-1, S3 rejects a location constraint, so there is none:

aws s3api create-bucket --bucket "$KB_S3_BUCKET" --region "$BEDROCK_REGION"

In any other Region, add --create-bucket-configuration "LocationConstraint=$BEDROCK_REGION".

Create the Langfuse bucket. This example uses us-east-2, so it needs the location constraint:

aws s3api create-bucket --bucket "$LANGFUSE_S3_BUCKET" --region "$LANGFUSE_S3_REGION" \
  --create-bucket-configuration "LocationConstraint=$LANGFUSE_S3_REGION"

Block all public access on both:

for b in "$KB_S3_BUCKET:$BEDROCK_REGION" "$LANGFUSE_S3_BUCKET:$LANGFUSE_S3_REGION"; do
  aws s3api put-public-access-block --bucket "${b%%:*}" --region "${b##*:}" \
    --public-access-block-configuration \
    BlockPublicAcls=true,IgnorePublicAcls=true,BlockPublicPolicy=true,RestrictPublicBuckets=true
done

CORS on the knowledge-base bucket

The web UI uploads documents straight from the browser to the knowledge-base bucket, so the bucket needs a CORS rule that allows Meko's address. You don't create it by hand. The install adds it for you, using your own AWS CLI credentials, once it knows the address. That needs s3:GetBucketCORS and s3:PutBucketCORS on the bucket for the AWS identity you run the install as. If it can't set the rule, it prints the rule for you to add.

Next

Create the IAM users.