Skip to content

AWS Amplify Hosting

--preset aws-amplify writes the deployment bundle Amplify Hosting reads. It is chosen when AWS_APP_ID is set, which Amplify sets in its builds, or by name.

Reference

Presetaws-amplify
Runs onAWS Amplify Hosting
event.runtime.nameaws-amplify
Server targetnode
Lifetime, startupprocess, load

Output

text
.amplify-hosting/
  deploy-manifest.json
  static/                    the public files and /_hamur/, under app.baseURL
  compute/default/index.mjs  a Node server on port 3000, with server/ and public/ beside it

Config keys

This preset has no key of its own.

Detection

The build selects it when AWS_APP_ID is set, unless --preset, preset or HAMUR_PRESET names another. It is a row of the one table of markers in Choosing a preset.

Deploy command

No hamur deploy command: it exits 1 for this preset. Amplify deploys .amplify-hosting/ through its git integration.

Limits

  • Runs: streamed answers, private app/env.ts entries read at run time.
  • Does not run: WebSockets and server.syncedState, server.pubsub, server.metrics, image transforms at run time, Durable Object classes.
  • The server bundle is at most 220 MB uncompressed and a request at most 15 minutes; the only writable path is /tmp.

The levels are the features of the preset: hamur build warns or fails when the app uses a feature the preset does not run (see Preset features).

text
.amplify-hosting/
  deploy-manifest.json
  static/                    the public files and /_hamur/, under app.baseURL
  compute/default/index.mjs  a Node server on port 3000, with server/ and public/ beside it

Set the Amplify build to run hamur build and the output directory to .amplify-hosting; Amplify deploys it through its git integration. The manifest names nodejs24.x as the runtime. It lists three routes, never the public files (Amplify allows 25): /_hamur/* as static with a one-year immutable Cache-Control, /*.* as static with the server as the fallback for a miss, and the catch-all /* to the server. A file without an extension is not matched by /*.*; it reaches the server, which has the files. With app.baseURL: "/r/" the files are written under static/r/ and the first two paths start with /r; the catch-all does not.

Amplify limits the server bundle to 220 MB uncompressed and a request to 15 minutes, and the only writable path is /tmp. The fs storage driver therefore has nothing to write to; use s3 or another network driver.