YAML examples for Create new sandbox
Create a sandbox environment
yaml- action: "Create Sandbox" type: "SANDBOX_CREATE" from: SCRATCH sandbox_identifier: "my-sandbox-$BUDDY_EXECUTION_ID" update_if_exists: true start: true spec: name: "My Sandbox" distribution: "UBUNTU_20_04" resources: "2x4" applications: - type: "CUSTOM" name: "my-app" port: 3000 start_command: "npm start"
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
Create a sandbox from existing sandbox
yaml- action: "Clone Sandbox" type: "SANDBOX_CREATE" from: SANDBOX sandbox_identifier: "cloned-sandbox" start: false
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: - nginx app_dir: /var/www/html endpoints: - www: 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: - node server.js app_dir: /var/www/myapp endpoints: - www: 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: - nginx app_dir: /var/www/html endpoints: - www: 80