Recipes
Complete examples for common setups.
Each recipe is a full set of files that you can copy into a repository and adapt.
Web app with Postgres
A public web app on a verified domain, reading its database credentials from a lease.
# yaml-language-server: $schema=https://a-line.cloud/schemas/iac/v1.json
version: 1
provider: hetzner
region: fsn1
pools:
- name: control-plane
role: control_plane
- name: general# yaml-language-server: $schema=https://a-line.cloud/schemas/iac/v1.json
version: 1
name: blog
cluster: hetzner-fsn1# yaml-language-server: $schema=https://a-line.cloud/schemas/iac/v1.json
version: 1
source:
template: postgres
version: "16"
databases:
blog:
roles:
app:
owner: true
backup:
enabled: true# yaml-language-server: $schema=https://a-line.cloud/schemas/iac/v1.json
version: 1
source:
image: ghcr.io/example/blog:1.0.0
port: 3000
domains:
- domain: blog.example.com
http:
https_redirect: true
env:
DATABASE_URL:
from: app/db
lease: blog/app
output: url
connections:
- to: db
ports:
- port: 5432blog.example.com must be covered by a verified domain.
Making app the owner is held until someone confirms
it.
Public assets in a bucket
A bucket whose public/ folder anyone can read, with the app told where it
is.
# yaml-language-server: $schema=https://a-line.cloud/schemas/iac/v1.json
version: 1
provider: hetzner
region: fsn1
pools:
- name: control-plane
role: control_plane
- name: general# yaml-language-server: $schema=https://a-line.cloud/schemas/iac/v1.json
version: 1
name: media
cluster: hetzner-fsn1
buckets:
- name: media-assets
quota_gb: 25
public_paths:
- public/# yaml-language-server: $schema=https://a-line.cloud/schemas/iac/v1.json
version: 1
source:
image: ghcr.io/example/uploader:2.3.0
port: 8080
env:
ASSETS_PUBLIC_URL:
from: bucket/media-assets
output: public_url
storage_bindings:
- bucket: media-assetsThe binding gives the app the bucket's credentials as S3_* variables; the
reference adds its public URL. See references and
bucket access.
A locked-down project
A project whose apps can only reach one outside API.
# yaml-language-server: $schema=https://a-line.cloud/schemas/iac/v1.json
version: 1
provider: hetzner
region: fsn1
pools:
- name: control-plane
role: control_plane
- name: general# yaml-language-server: $schema=https://a-line.cloud/schemas/iac/v1.json
version: 1
name: billing
cluster: hetzner-fsn1
egress:
mode: isolated
rules:
- kind: fqdn
value: api.example.net
port: 443
protocol: tcp# yaml-language-server: $schema=https://a-line.cloud/schemas/iac/v1.json
version: 1
source:
image: ghcr.io/example/invoicer:1.2.0
port: 8080See outbound traffic.