YAML examples for Create new sandbox
Create a sandbox environment
yaml
- action: "Create Sandbox"
type: "SANDBOX_CREATE"
from: SCRATCH
sandbox_identifier: "my-sandbox-$BUDDY_RUN_ID"
update_if_exists: true
start: true
spec:
sandbox: "my-sandbox"
name: "My Sandbox"
os: ubuntu:24.04
resources: 2x4
first_boot_commands: |-
apt-get update
apt-get install -y nodejs npm
app_dir: /buddy
apps:
- app: web
run_command: npm start
endpoints:
- name: my-app
endpoint: "3000"
Create a workspace-scoped sandbox
yaml
- action: "Create Workspace Sandbox"
type: "SANDBOX_CREATE"
from: SCRATCH
scope: WORKSPACE
sandbox_identifier: "shared-sandbox"
spec:
sandbox: "shared-sandbox"
name: "Shared Sandbox"
os: ubuntu:24.04
resources: "2x4"
Create an environment-scoped sandbox
yaml
- action: "Create Environment Sandbox"
type: "SANDBOX_CREATE"
from: SCRATCH
scope: ENVIRONMENT
sandbox_identifier: "env-sandbox"
spec:
sandbox: "env-sandbox"
name: "Environment Sandbox"
os: ubuntu:24.04
resources: "2x4"
Create a sandbox from snapshot
yaml
- action: "Create Sandbox from Snapshot"
type: "SANDBOX_CREATE"
from: SNAPSHOT
sandbox_identifier: "restored-sandbox"
snapshot_name: "my-snapshot"
start: true
spec:
sandbox: "restored-sandbox"
name: "Restored Sandbox"
Create a sandbox from existing sandbox
yaml
- action: "Clone Sandbox"
type: "SANDBOX_CREATE"
from: SANDBOX
sandbox_identifier: "cloned-sandbox"
start: false
spec:
sandbox: "cloned-sandbox"
name: "Cloned Sandbox"
Create new sandbox from Scratch (Nginx)
yaml
- action: "Create new Sandbox from Scratch"
type: "SANDBOX_CREATE"
from: SCRATCH
spec:
sandbox: create-sb
name: create new sandbox
os: ubuntu:24.04
first_boot_commands: |-
apt get install
apt-get install -y nginx
apps:
- app: nginx
run_command: nginx
app_dir: /var/www/html
endpoints:
- name: www
endpoint: "80"
Create new sandbox from Scratch (Node.js)
yaml
- action: "Create new Sandbox from Scratch node"
type: "SANDBOX_CREATE"
from: SCRATCH
update_if_exists: true
spec:
sandbox: create-sb-node
name: create new Sandbox node
os: ubuntu:22.04
first_boot_commands: |-
apt-get update
apt-get install curl -y
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
apt-get install -y nodejs
apps:
- app: web
run_command: node server.js
app_dir: /var/www/myapp
endpoints:
- name: www
endpoint: "80"
Create new sandbox from Snapshot with spec
yaml
- action: "Create new Sandbox from snapshot"
type: "SANDBOX_CREATE"
from: SNAPSHOT
snapshot_name: site-snapshot
spec:
sandbox: create-sb
name: create sb
os: ubuntu:24.04
resources: 4x8
first_boot_commands: |-
apt get install
apt-get install -y nginx
tags:
- background-blue
- background-red
- backend-app
apps:
- app: nginx
run_command: nginx
app_dir: /var/www/html
endpoints:
- name: www
endpoint: "80"