YAML for Create new sandbox

View as Markdown

Create a new sandbox with specified configuration.

YAML parameters for Create new sandbox

PARAMETERS
fromrequiredstring enum
The source type for creating the sandbox
Allowed enum:
SCRATCH,
SANDBOX,
SNAPSHOT
specrequiredSandboxYaml
The sandbox definition, in the same format as a sandbox YAML. name is required.
typerequiredstring

Value: SANDBOX_CREATE

actionrequiredstring
Unique identifier for the action within the pipeline.
scopestring enum
Where the sandbox is created: PROJECT (the pipeline's project, default), WORKSPACE, or ENVIRONMENT. ENVIRONMENT requires the pipeline execution to run in an environment context, otherwise the action fails
Allowed enum:
PROJECT,
WORKSPACE,
ENVIRONMENT
sandbox_identifierstring
The identifier of the source sandbox (when creating from another sandbox)
update_if_existsboolean
Whether to update the sandbox configuration if a sandbox with the same identifier already exists in the project. If true and a sandbox exists, it will be reconfigured with the new specification instead of creating a new one
startboolean
Whether to start the sandbox after creation
tagsstring[]
The set of tags for the sandbox
snapshot_namestring
The name of the snapshot
trigger_timestring enum
Specifies when the action should be executed. ON_SUCCESS actions run after every successful run, also one ended by an EARLY_EXIT action.
Allowed enum:
ON_EVERY_EXECUTION,
ON_SUCCESS,
ON_FAILURE,
ON_BACK_TO_SUCCESS,
ON_WARNING,
ON_WAIT_FOR_APPROVE,
ON_TERMINATE
loopstring[]
Names of the variables to loop over (IMAGES, not $IMAGES and not a value). The action runs once for each item of the value, and once for each combination of items when several variables are listed. The variable value is split into items by new lines, or by commas when it has no new lines (a single-line JSON object or key=value pairs stays one item). An item that is a JSON object or key=value pairs also sets one variable per key, named <VARIABLE>_<key>; an item that starts with EXTRACT: sets them as plain <key>.
run_only_on_first_failureboolean
When true, the action runs only on the first failure instead of on each failure. Used only when trigger_time is ON_FAILURE.
disabledboolean
When set to true the action is disabled. By default it is set to false.
timeoutinteger
The timeout in seconds. It cannot exceed the action time limit of the workspace plan; a higher value is rejected.
ignore_errorsboolean
If set to true the execution will proceed, mark action as a warning and jump to the next action. Doesn't apply to deployment actions.
retry_intervalinteger
Delay time between auto retries in seconds.
retry_countinteger
Number of retries if the action fails.

Constraints: ≤ 10

run_nextstring enum
Defines whether the action should run in parallel with the next one.
Allowed enum:
WAIT_ON_SUCCESS,
IN_SOFT_PARALLEL,
IN_HARD_PARALLEL
trigger_conditionsTriggerConditionYaml[]
The list of trigger conditions to meet so that the action can be triggered.
variablesVariableYaml[]
The list of variables you can use in the action.

Outputs for Create new sandbox

OUTPUT VARIABLES
BUDDY_SANDBOX
Identifier of the sandbox created by this action.

Example: staging-box

BUDDY_SANDBOX_ID
ID of the sandbox used by the REST API.

Example: sXd9kL2mQp4rT

BUDDY_SANDBOX_NAME
Name of the sandbox.

Example: Staging Box

BUDDY_SANDBOX_TAGS
Tags of the sandbox, one per line.

Example: staging qa

BUDDY_SANDBOX_SSH_URL
SSH address of the sandbox.

Example: staging-box.eu-1234.buddy.dev:2222

BUDDY_SANDBOX_URLS
Public URLs of the sandbox tunnels, one per line.

Example: https://staging-box.eu-1234.buddy.dev staging-box.eu-1234.buddy.dev:2222

Last modified on Nov 19, 2026

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"