page:guides:express:object client

Configure S3-compatible access for Express

Summary

Configure S3-compatible access for a Express app on Ample. Create a bucket with ample bucket create, pass its endpoint, region, bucket name and keys as encrypted environment variables, and use @aws-sdk/client-s3 with forcePathStyle: true. The app writes and reads objects through the S3-compatible endpoint; the bucket stays private.

Prerequisites

Workflow Steps

  1. Create the bucket
    Create it once and keep the issued credentials out of the repository. Command: ample bucket create --name

  2. Configure the client with path-style addressing
    Use @aws-sdk/client-s3 with forcePathStyle: true; virtual-host addressing is not verified.

  3. Deploy with the credentials as encrypted env
    Pass the five S3_* variables with --env; they are stored encrypted and reused on redeploys. Command: ample deploy . --name --public --env S3_ENDPOINT=... --env S3_REGION=... --env S3_BUCKET=... --env S3_ACCESS_KEY_ID=... --env S3_SECRET_ACCESS_KEY=...

  4. Test through the app
    Expose a route (/storage) that writes then reads an object and reports s3=ok.

  5. Verify
    Fetch the live URL and run the success checks below. On failure read the build log, then the runtime log, fix the cause and deploy again; do not blind-retry. Command: ample logs --kind build

Success Checks

Limitations

Examples

Cost Estimate