Stacks
Deploy a complete system from one file in your repository.
Stacks reads anythingcloud.yaml
from your repository and makes AnythingCloud match it. You describe the
Workers, databases, queues, buckets, routes, triggers, and secrets; each
push applies the difference. A deployment shows every step, keeps a
history, and can be rolled back.
Stacks is the AnythingCloud equivalent of wrangler plus
Workers Builds, for the whole service catalog. Your CI builds the Worker
bundle and uploads it; AnythingCloud does not clone your repository, hold
repository credentials, or run build commands.
Quick start
- Open Stacks and choose
Create stack. Give it a name such as
storefront. Aproductionenvironment onmainis created with it. - Open the stack's Settings tab and create a deploy
token for
productionwith theplananddeployscopes. The value is shown once. Store it in your repository as a protected CI secret namedANYTHINGCLOUD_TOKEN. - Install the CLI, sign in, and write the manifest and workflow:
curl -fsSL https://anything.solutions/downloads/acs/linux-amd64 -o acs
chmod +x acs
sudo mv acs /usr/local/bin/acs
acs login --token acs_your_token
acs init --stack storefront
acs init writes anythingcloud.yaml and a CI
workflow, and prints the secret name to add to the repository.
- Commit and push. CI builds the Worker bundle and runs
acs deploy --env production --wait. - Watch the deployment in the console. When it finishes, it shows the Worker address and the database, queue, and bucket names. Open Deployments to see each step and its result.
On a pull request, run acs plan --env production instead.
A plan writes nothing and shows what a deploy would create, change, or
leave alone.
Manifest reference
Commit one anythingcloud.yaml at the root of the repository,
or pass another path with --manifest. Names in the file are
logical: the same manifest deployed to production and
staging creates separate resources for each environment.
| Field | Required | Value |
|---|---|---|
version | Yes | Must be 1. |
stack | Yes | The stack slug shown in the console. Lowercase letter first, then lowercase letters, numbers, and hyphens, up to 32 characters. |
environments | Yes | At least production. Each entry sets a branch (default main) and variables. |
resources | Yes | A map of logical names to resources. Up to 50 resources per environment. |
A complete manifest with every v1 resource kind:
version: 1
stack: storefront
environments:
production:
branch: main
variables:
APP_ORIGIN: https://shop.example.com
resources:
db:
kind: database
sessions:
kind: kv
jobs:
kind: queue
visibility_seconds: 60
max_attempts: 5
assets:
kind: bucket
public: false
api:
kind: worker
main: ./dist/api.js
memory_mb: 128
timeout_ms: 10000
env:
APP_ORIGIN: {variable: APP_ORIGIN}
STRIPE_KEY: {secret: STRIPE_KEY}
bindings:
DB: {database: db, scope: write}
SESSIONS: {kv: sessions}
ASSETS: {bucket: assets}
triggers:
- queue: jobs
alias: JOBS
mode: both
batch_size: 10
max_wait_seconds: 5
- schedule: "*/5 * * * *"
timezone: UTC
routes:
- builtin: true
Logical resource names use a lowercase letter first, then lowercase
letters, numbers, and hyphens, up to 32 characters. A name is permanent for
the life of the resource: renaming an entry creates a new resource and
leaves the old one in place. The optional name field changes
only the display name shown in the console; it does not rename the
resource.
Databases
kind: database creates a TiniDB database. The service chooses
the plan and size; there are no size fields in v1.
| Field | Default | Notes |
|---|---|---|
name | The logical name | Optional display name, up to 63 characters. |
KV namespaces
kind: kv creates a KV namespace. Bind it to a Worker to read
and write it.
| Field | Default | Notes |
|---|---|---|
name | The logical name | Optional display name, up to 63 characters. |
Queues
kind: queue creates an AQS queue. A Worker consumes it with a
queue trigger, sends to it with a binding trigger, or both.
| Field | Default | Notes |
|---|---|---|
name | The logical name | Optional display name, up to 63 characters. |
visibility_seconds | 30 | How long a delivered message stays hidden. 0 to 43200. |
max_attempts | 5 | Deliveries before the message moves to the dead-letter queue. 1 to 100. |
payload_tier | standard | A payload size tier available on your account. |
max_bytes | The queue limit | Optional storage cap, at least 1 byte, within your queue limit. |
Buckets
kind: bucket creates an S3-compatible bucket.
| Field | Default | Notes |
|---|---|---|
name | The logical name | Optional display name, up to 63 characters. |
public | false | Allow public reads. Leave off unless the bucket serves public files. |
billing_mode | payg | payg or plan. |
quota_gb | None | Required when billing_mode is plan; 1 to 100000 GB. |
versioning | false | Keep object versions. |
Workers
kind: worker creates a Worker from the bundle at
main. The path is relative to the manifest, uses forward
slashes, and must stay inside the repository. Absolute paths, ..,
and symlinks that leave the repository are rejected.
| Field | Default | Notes |
|---|---|---|
name | The logical name | Optional display name, up to 63 characters. |
main | Required | Built Worker bundle, at most 1 MiB. All Workers in one deployment total at most 10 MiB. |
memory_mb | 128 | 64, 128, 256, or 512. |
timeout_ms | 10000 | 1000, 5000, 10000, or 30000. |
cache_enabled | false | Turn on the Worker response cache. |
logs_enabled | true | Keep request logs. |
metrics_enabled | true | Keep request and runtime metrics. |
env | Empty | Uppercase aliases mapped to {secret: NAME} or {variable: NAME}. |
bindings | Empty | Up to 32 aliases; see Bindings. |
triggers | Empty | Up to 20; see Triggers. |
routes | [{builtin: true}] | Up to 5; see Routes. |
Bindings
A binding connects a Worker to a resource by an uppercase alias. Inside the Worker, the alias is the object used to call the service. Binding references also set the deployment order, so a Worker is created after the resources it uses.
| Binding | Fields | Effect |
|---|---|---|
| Database | {database: logical-name, scope: read|write} | Exposes the TiniDB database under the alias. read is read-only; write allows changes. The scope defaults to read. |
| KV | {kv: logical-name} | Exposes the KV namespace under the alias. |
| Bucket | {bucket: logical-name} | Exposes the bucket under the alias. |
Each alias maps exactly one of database, kv, or
bucket. Aliases use uppercase letters, numbers, and
underscores.
version: 1
stack: storefront
environments:
production:
branch: main
resources:
db:
kind: database
sessions:
kind: kv
assets:
kind: bucket
api:
kind: worker
main: ./dist/api.js
bindings:
DB: {database: db, scope: write}
SESSIONS: {kv: sessions}
ASSETS: {bucket: assets}
Triggers
A trigger runs a Worker without a request. A Worker can have up to 20 triggers.
| Trigger | Fields | Effect |
|---|---|---|
| Queue | queue, alias, mode, batch_size, max_wait_seconds | Receives or sends AQS messages. mode is consume (default), send, or both. batch_size is 1 to 100 (default 10); max_wait_seconds is 0 to 20 (default 5). |
| Schedule | schedule, timezone | Runs on a five-field cron expression, for example */5 * * * *. The time zone defaults to UTC. |
| Interval | interval_minutes | Runs every 5 to 1440 minutes. |
| Object event | event.bucket, event.events, event.prefix | Runs when an object is created, updated, deleted, renamed, or restored. prefix narrows it to a key prefix. |
For an object event, events defaults to all five event types
and prefix defaults to the whole bucket.
version: 1
stack: media
environments:
production:
branch: main
resources:
uploads:
kind: bucket
jobs:
kind: queue
image-worker:
kind: worker
main: ./dist/image-worker.js
triggers:
- queue: jobs
alias: JOBS
mode: consume
batch_size: 10
max_wait_seconds: 5
- schedule: "0 * * * *"
timezone: UTC
- interval_minutes: 15
- event:
bucket: uploads
events: [created, deleted]
prefix: media/
Routes
A route gives a Worker an address. If routes is omitted, the
Worker gets the built-in address. An empty list gives no address at all, so
the Worker runs only on triggers. A Worker can have up to five routes.
| Route | Form | Notes |
|---|---|---|
| Built-in | {builtin: true} | The generated AnythingCloud address shown on the Worker page. Add it at most once. |
| Custom hostname | {hostname: api.example.com, mode: http} | mode is http (default) or webhook. The hostname must belong to a verified root domain. |
A custom hostname is attached only when its root domain is verified under
Networking → Custom
domains. Verify the root with a TXT record at
_anythingcloud.<root>, point
*.<root> at edge.anything-cloud.com with
DNS-only resolution, and wait until the domain shows Active.
Until then, keep builtin: true and deploy the custom hostname
after verification.
version: 1
stack: shop
environments:
production:
branch: main
resources:
api:
kind: worker
main: ./dist/api.js
routes:
- builtin: true
- hostname: api.example.com
mode: http
An automatic address can be added to a Worker that already has another address, but a Worker created with no address has no automatic address to restore. To remove the last address, add a new logical Worker instead; the platform keeps the automatic address so a Worker is never left unreachable.
Secrets and variables
Variables are non-secret values stored in the manifest
per environment. Secrets are set once in the console or
CLI, sealed at rest, and never shown again. A Worker's env
maps a name it reads to one of them:
| Reference | Source |
|---|---|
{variable: APP_ORIGIN} | The environment's variables map. |
{secret: STRIPE_KEY} | A secret set for the environment in the console or with acs secrets set. |
Plain text values are not accepted in env, so a secret
cannot be committed by accident. Names use uppercase letters, numbers, and
underscores, starting with a letter, up to 64 characters.
version: 1
stack: storefront
environments:
production:
branch: main
variables:
APP_ORIGIN: https://shop.example.com
resources:
api:
kind: worker
main: ./dist/api.js
env:
APP_ORIGIN: {variable: APP_ORIGIN}
STRIPE_KEY: {secret: STRIPE_KEY}
A deploy token can deploy code, and that code can read the secrets bound
to its environment. The secrets scope governs who can change
values; it does not stop deployed code from reading them. Use a separate
environment and token when CI is not fully trusted.
Set the secret before deploying:
acs secrets set STRIPE_KEY --env production
acs secrets list --env production
A deployment stops before applying if the manifest references a secret the
environment does not have. After you change a secret, run
acs deploy --redeploy so Workers receive the new value even
when the commit and code are unchanged. Secret values are never included in
plans, deployment history, or logs.
Environments
Every manifest defines production. Add more environments in
the console first, then describe them in the manifest with a branch and
variables. Each environment gets its own copy of every resource; they do
not share databases, queues, buckets, namespaces, or Workers.
version: 1
stack: storefront
environments:
production:
branch: main
variables:
APP_ORIGIN: https://shop.example.com
staging:
branch: develop
variables:
APP_ORIGIN: https://staging.shop.example.com
resources:
sessions:
kind: kv
The branch records which branch belongs to the environment.
A deployment whose ref does not match the branch is rejected unless an
authorized member forces it. Environment names use the same lowercase
letters, numbers, and hyphens rule as resource names. A stack has up to 10
environments by default, and each environment runs one deployment at a
time; different environments deploy in parallel.
CI
Build the Worker bundles in CI, then run acs plan on pull
requests and acs deploy --wait on the branch that belongs to
the environment. Store the deploy token as a protected repository secret
named ANYTHINGCLOUD_TOKEN. Pin the CLI version so a workflow
does not change underneath a build.
GitHub Actions
name: Deploy
on:
push:
branches: [main]
pull_request:
branches: [main]
concurrency:
group: anythingcloud-${{ github.ref }}
cancel-in-progress: false
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Install acs
run: |
curl -fsSL -o acs "https://anything.solutions/downloads/acs/linux-amd64"
chmod +x acs
sudo mv acs /usr/local/bin/acs
- run: npm ci && npm run build
- name: Plan
if: github.event_name == 'pull_request'
run: acs plan --env production
env:
ANYTHINGCLOUD_TOKEN: ${{ secrets.ANYTHINGCLOUD_TOKEN }}
- name: Deploy
if: github.event_name == 'push'
run: acs deploy --env production --wait
env:
ANYTHINGCLOUD_TOKEN: ${{ secrets.ANYTHINGCLOUD_TOKEN }}
Gitea Actions
Gitea Actions uses the same workflow syntax. The checkout and Node steps are the same; the token is a protected repository secret.
name: Deploy
on:
push:
branches: [main]
pull_request:
branches: [main]
concurrency:
group: anythingcloud-${{ github.ref }}
cancel-in-progress: false
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Install acs
run: |
curl -fsSL -o acs "https://anything.solutions/downloads/acs/linux-amd64"
chmod +x acs
sudo mv acs /usr/local/bin/acs
- run: npm ci && npm run build
- name: Plan
if: github.event_name == 'pull_request'
run: acs plan --env production
env:
ANYTHINGCLOUD_TOKEN: ${{ secrets.ANYTHINGCLOUD_TOKEN }}
- name: Deploy
if: github.event_name == 'push'
run: acs deploy --env production --wait
env:
ANYTHINGCLOUD_TOKEN: ${{ secrets.ANYTHINGCLOUD_TOKEN }}
The workflow's concurrency group stops two jobs from deploying
the same branch at once. The environment also allows only one active
deployment, so a second run waits instead of applying twice.
CLI
Download acs for Linux, macOS, or Windows from the
downloads page. It is one
static binary with no runtime dependencies, and every build is published
with a SHA-256 checksum. The CLI reads the token from
ANYTHINGCLOUD_TOKEN or from
~/.config/anythingcloud/credentials.json (mode 0600), and
defaults to https://anything.solutions. Use
--base-url or ANYTHINGCLOUD_BASE_URL for another
installation; --base-url must use https:// except
for localhost.
| Command | Does |
|---|---|
acs init [--stack <slug>] | Writes a manifest and CI workflow and prints the secret name to add. |
acs login [--token <token>] | Saves a token for later commands. |
acs stack list | Lists your stacks. |
acs stack create <name> | Creates a stack and its production environment. |
acs stack show <stack> | Shows the name, repository, branch, and environments. |
acs plan [--env production] [--json] | Validates the manifest and shows create, update, and orphan actions. Writes nothing. |
acs deploy [--env production] [--wait] [--json] | Uploads the manifest and Worker bundles and enqueues a deployment. --wait follows it until it finishes; --retry and --redeploy queue the same code again, for example after rotating a secret. |
acs status [<deployment>] | Shows a deployment's status, commit, and timestamps. |
acs logs <deployment> [--follow] | Prints a deployment's events, or follows them until it finishes. |
acs rollback <deployment> | Deploys the manifest from the last successful deployment before that one. |
acs destroy --env <env> --confirm <stack>-<env> | Deletes the environment's stack-owned resources. |
acs destroy --env <env> --confirm <stack>-<env> --resource <name> | Deletes one logical resource and leaves the rest of the environment in place. |
acs secrets set <KEY>, list, delete | Manages secrets for an environment. |
acs tokens create --name <name> --scopes plan,deploy [--expires 30d], list, revoke | Manages deploy tokens. The secret is printed once. |
--json prints machine-readable output for CI. The CLI retries
rate limits, 503 responses, and network errors with backoff, honouring
Retry-After.
| Exit code | Meaning |
|---|---|
0 | Success, no change, or the deployment succeeded. |
1 | The deployment failed. |
2 | The manifest is not valid. |
3 | The environment is busy or a lock timed out. |
4 | The token is missing, expired, or lacks a scope. |
5 | A network or server error occurred. |
Deploy and rollback
A deploy validates the manifest, compares it with the recorded resources, and applies only the steps that differ. The deployment page shows each step and its result. Re-running the same commit is a no-op; it does not recreate resources.
If a Worker does not reach a healthy state, the previous Worker version is restored and the deployment is marked failed. Resources created before the failure stay in place so you can fix the cause and deploy again. A failed deployment never deletes a database, bucket, or queue.
To roll back, open Deployments, choose a successful deployment, and select Rollback. The CLI equivalent is:
acs rollback 42
A rollback is a new deployment from the earlier manifest. It keeps the full history and does not rewrite or delete the deployment it came from. The Worker bundles from that deployment are reused, so a rollback is only offered while they are still retained (seven days by default); after that, deploy the commit again. Cancel a queued deployment before it starts if you no longer need it; a step that is already running is allowed to finish.
Destroy
Removing a resource from the manifest is not a deletion. The next deploy reports it as an orphan and leaves the resource running, so a typo cannot delete production data.
Deleting is explicit. In the console, open the environment and type
<stack>-<env> to confirm. From the CLI:
acs destroy --env production --confirm storefront-production
The CLI asks for confirmation. In a non-interactive shell, add
--yes after checking the environment name.
Only resources recorded for that environment are removed, in reverse dependency order: routes and Workers before the queues, buckets, namespaces, and databases they use. A manually created resource is left alone. A destroy cannot be undone; export database data and bucket objects first if you need them.
Limits
| Limit | Value |
|---|---|
| Manifest size | 256 KiB |
| Resources per environment | 50 |
| Workers per stack | 10 |
| Environments per stack | 10 by default |
| Stacks per member | 10 by default |
| Worker bundle | 1 MiB each; 10 MiB total per deployment |
| Retained Worker bundles | 256 MiB per member |
| Worker memory | 64, 128, 256, or 512 MB |
| Worker timeout | 1000, 5000, 10000, or 30000 ms |
| Environment entries per Worker | 50 |
| Secrets per environment | 50; 8 KiB per value |
| Bindings per Worker | 32 |
| Triggers per Worker | 20 |
| Routes per Worker | 5 |
| Queue visibility timeout | 0 to 43200 seconds; 30 by default |
| Queue attempts | 1 to 100; 5 by default |
| Queue trigger wait | 0 to 20 seconds; 5 by default |
| Queue trigger batch | 1 to 100 messages; 10 by default |
| Interval trigger | 5 to 1440 minutes |
| Active deployments per member | 2 |
| Queued deployments per member | 10 |
| Live deploy tokens per stack | 100 |
A deployment that would exceed a limit is rejected before any resource is created. If the deployment service is at capacity, the request is asked to retry after a short wait; the CLI waits and retries.
Troubleshooting
The domain is not verified
A custom hostname route needs a verified root domain. Open
Networking → Custom
domains, add the root, create the TXT record at
_anythingcloud.<root>, and point
*.<root> at edge.anything-cloud.com with
DNS-only resolution. Wait for Active, then deploy again.
Until then, use builtin: true for the Worker address.
A secret is missing
The deployment stops before applying when a Worker references a secret the environment does not have. Set it and deploy again:
acs secrets set STRIPE_KEY --env production
acs deploy --env production --wait
Check the spelling of the name in both places. Secret names use uppercase letters, numbers, and underscores, starting with a letter.
The quota is exceeded
The manifest has more resources, Workers, environments, or bundle bytes than the limits allow. Remove an entry, split the stack, or reduce the bundle. A Worker bundle can be built and minified in CI before upload; the platform does not run a build for you.
The deployment is locked
An environment runs one deployment at a time. A second deploy waits for the first to finish; the CLI exits with code 3 if the wait exceeds its limit. Open the deployment history to see the run that holds the environment. If that run stopped unexpectedly, the environment is released automatically and the queued deployment continues. Do not create a second environment to work around a lock.
The Worker failed to start
The deployment page names the step that failed and the previous Worker
version is restored. Common causes are a bundle that does not export a
fetch handler, a bundle over 1 MiB, a timeout that is too short
for the work, or a binding alias that does not match the code. Open
Deployments and read the failed step, then run
acs logs <deployment>. Fix the cause and deploy the same
commit again.
Security
- Deploy tokens belong to one stack and optionally one environment, and
carry only the scopes you grant:
read,plan,deploy, orsecrets. The value is shown once, stored hashed, and can be revoked. Destroy needs a personal key or a signed-in console session with typed confirmation. The API requires a personal key for the same action. - Secrets are sealed at rest, bound to one environment and key, and never shown again. They do not appear in plans, deployment history, or logs.
- Your CI builds the Worker bundle. AnythingCloud does not clone the repository, store repository credentials, or run build commands or arbitrary code.
- Manifest paths must stay inside the repository. Absolute paths,
.., and symlinks that escape it are rejected. - Removing a manifest entry leaves the resource in place. Deletion is explicit, limited to stack-owned resources, and runs in reverse dependency order.
- Stack, environment, token, secret, and deployment actions are recorded in the audit log without secret values.