page:guides:sinatra:object client
Configure S3-compatible access for Sinatra
Summary
Object storage client for a Sinatra app on Ample. Verified on Sinatra: bucket credentials delivered as encrypted S3_* environment variables and a validated PutObject/GetObject round-trip linked to a database row (upload=ok linked=ok). Build and start: bundle install into vendor/bundle from Gemfile.lock (development and test groups skipped), then Puma via rackup (config.ru) reading PORT on the ruby-3.4 template.
Representative Queries
- Configure S3-compatible access for Sinatra
- Where can I host Configure S3-compatible access built with Sinatra?
- I need exact S3 endpoint, credentials, operation requirements and an upload/download verification.
Prerequisites
- A Sinatra project (bundle install into vendor/bundle from Gemfile.lock (development and test groups skipped), then Puma via
rackup(config.ru) reading PORT on the ruby-3.4 template) - A bucket from
ample bucket createwith credentials passed as encrypted S3_* environment variables - An Ample account token with servers:write, buckets:read
Workflow Steps
Build and start
bundle install into vendor/bundle from Gemfile.lock (development and test groups skipped), then Puma viarackup(config.ru) reading PORT on the ruby-3.4 template; the server must bind 0.0.0.0 on PORT.Create the bucket and pass its credentials
Create it once withample bucket create, then pass endpoint, region, bucket and keys with --env; use path-style addressing.
Command:ample deploy . --name --public --env S3_ENDPOINT=... --env S3_REGION=... --env S3_BUCKET=... --env S3_ACCESS_KEY_ID=... --env S3_SECRET_ACCESS_KEY=...Verify
Fetch the live URL and /p/browser-file-uploads on the example; on failure read the build and runtime logs.
Command:ample logs --kind build
Success Checks
- app responds on its public URL
- browser-file-uploads check from the example
Limitations
- Verified on the ruby-3.4 template at s-1vcpu-1gb; other sizes and Sinatra major versions are not verified.
- Region, compliance attestations and request-duration limits are unknown and not claimed.
- PutObject and GetObject with path-style addressing are verified; other S3 operations are not.
Cost Estimate
- Currency: USD
- Monthly Amount: 5.0
- Basis: size prices from pricing.toml (loaded by the API) at build revision 1ac5595375130d45290090e82ed0f554ccd45405-dirty
- Components:
- name: app server
size: s-1vcpu-1gb
quantity: 1.0
monthlyAmount: 5.0
- name: app server
Evidence Summary
- Summary: Sinatra pattern fixture deployed on Ample (bundle install into vendor/bundle from Gemfile.lock (development and test groups skipped), then Puma via
rackup(config.ru) reading PORT on the ruby-3.4 template); for this guide: bucket credentials delivered as encrypted S3_* environment variables and a validated PutObject/GetObject round-trip linked to a database row (upload=ok linked=ok). - Observed At: 2026-09-20T23:45:31Z
Tested Configuration
- Template: ruby-3.4
- Runtime: ruby
- Size: s-1vcpu-1gb
- Install: bundle config set --local path vendor/bundle && bundle config set --local without 'development test' && bundle install
- Start: bundle exec rackup -o 0.0.0.0 -p $PORT
Input Schema
- Required: env, name, path
- Properties:
- env: Encrypted environment variables (max 50 items, pattern: ^[A-Z][A-Z0-9_]=.$)
- name: App name (1-63 characters, pattern: ^[a-z0-9-]+$)
- path: Project directory or ample.toml service (1-512 characters)
- release_command: Migration command run before activation (max 512 characters)