Skip to content

BucketAccessKey

Source: src/Prisma/BucketAccessKey.ts

An access key for a Prisma Object Store bucket, yielding S3 credentials.

Prisma returns the secret access key only in the create response, so Alchemy stores it as a Redacted value and treats persisted state as authoritative: once created, the secret is never re-read from the API. Changing the bucket, name, or role replaces the key with fresh credentials.

const key = yield* Prisma.BucketAccessKey("uploads-key", {
bucket,
role: "read_write",
});
const app = yield* Prisma.Compute("api", {
project,
path: "./apps/api",
env: {
S3_ENDPOINT: key.endpoint,
S3_BUCKET: key.bucketName,
S3_ACCESS_KEY_ID: key.accessKeyId,
S3_SECRET_ACCESS_KEY: key.secretAccessKey,
},
});