Skip to content

Bake

A stock create installs the harnesses under cloud-init, which takes minutes. Baking pays that cost once:

pier bake # one throwaway instance + your .pier-bake.sh, snapshotted as an AMI

Creates from a baked image drop to about 60-90 seconds.

Baked images are keyed to the repo, so one project’s toolchain never bleeds into another’s. pier bake installs tools. Deps, migrations, and env belong to .pier-setup.sh at boot.

Cloud-init is guarded and identical on stock and baked images. Every install step is a no-op when the image already has it. Baking is an optimization, never a requirement.

Re-baking supersedes the old image. pier teardown sweeps all baked images by tag.

  • Bake hooks live only in baked images. A repo with a .pier-bake.sh that was never baked runs stock. Setup then fails loudly, not silently.
  • Bake needs three extra AWS permissions: ec2:CreateImage, ec2:DeregisterImage and ec2:DeleteSnapshot.