Create new sandbox with YAML

The Create new sandbox action allows you to create sandboxes either from scratch (from: SCRATCH) or from an existing snapshot (from: SNAPSHOT). All sandbox configuration parameters are defined in the spec field, which follows the same model as the sandbox YAML configuration.

YAML parameters for Create new sandbox

Name Type Description
action Required String The ID of the action.
type
Required
String The type of the action. Must be set to SANDBOX_CREATE.
from
Required
String The source for creating sandbox. Can be one of SNAPSHOT or SCRATCH.
spec
Required
Sandbox Sandbox configuration object containing all sandbox parameters.
snapshot_name String The name of the snapshot when creating from snapshot. Required when from is SNAPSHOT.

Sandbox parameters (spec field)

Name Type Description
sandbox
Required
String The sandbox identifier. It can consist of uppercase and lowercase letters, numbers, underscores, and hyphens. It must start with a letter.
name
Required
String The name of the sandbox.
os
Required
String Operating system. Available values: ubuntu:22.04, ubuntu:24.04.
resources String Resources in format CPUxRAM (e.g., 4x8 for 4 CPU cores and 8GB RAM). Default: 2x4.
install_commands String Commands to run during sandbox setup. Use |- for multi-line commands.
run_command String Command to start the application.
app_dir String Directory where the application is located.
app_type String Type of application. Available values: CMD, SERVICE.
tags String[] Array of tags to categorize the sandbox.
endpoints Endpoint[] Array of endpoint configurations for the sandbox.

Endpoint parameters

Name Type Description
name
Required
String Name of the endpoint.
endpoint
Required
String Target to which the endpoint binds. Port number or address (e.g., 80, localhost:22).
type
Required
String Type of endpoint. Available values: HTTP, TCP, TLS.
region String Region for the endpoint. Available values: EU, US.
whitelist String[] Array of IP addresses allowed to access the endpoint.
timeout Integer Timeout value in seconds.
http Object HTTP-specific configuration (only for HTTP endpoints).
tls Object TLS-specific configuration (only for TLS endpoints).

HTTP endpoint parameters

Name Type Description
verify_certificate Boolean Whether to verify SSL certificates.
compression Boolean Enable HTTP compression.
http2 Boolean Enable HTTP/2 support.
log_requests Boolean Enable request logging.
rewrite_host_header String Custom host header to rewrite.
whitelist_user_agents String[] Array of allowed user agent strings.
request_headers Object Custom request headers to add.
response_headers Object Custom response headers to set.
tls_ca String TLS CA certificate (encrypted).
circuit_breaker Integer Circuit breaker threshold value (0-100).

Auth parameters for HTTP endpoints

Name Type Description
username String Basic authentication username for HTTP endpoint access.
password String Basic authentication password for HTTP endpoint access (encrypted).

TLS endpoint parameters

Name Type Description
terminate_at String Where to terminate TLS. Available values: REGION, AGENT, TARGET.
private_key String Private key for TLS certificate (encrypted).
certificate String TLS certificate (encrypted).
ca_certificate String CA certificate for TLS (encrypted).

Create new sandbox from Scratch (Nginx)

yaml
- action: Create new sandbox from Scratch type: SANDBOX_CREATE from: SCRATCH disabled: true spec: sandbox: create-sb name: create new sandbox os: ubuntu:24.04 install_commands: |- apt get install apt-get install -y nginx run_command: nginx app_dir: /var/www/html app_type: SERVICE endpoints: - www: 80

Create new sandbox from Scratch (Node.js)

yaml
- action: Create new sandbox from Scratch node type: SANDBOX_CREATE from: SCRATCH spec: sandbox: create-sb-node name: create new sandbox node os: ubuntu:22.04 install_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 run_command: node server.js app_dir: /var/www/myapp app_type: CMD endpoints: - www: 80

Create new sandbox from Snapshot

yaml
- action: Create new sandbox from snapshot type: SANDBOX_CREATE from: SNAPSHOT disabled: true snapshot_name: site-snapshot spec: sandbox: create-sb name: create sb os: ubuntu:24.04 resources: 4x8 install_commands: |- apt get install apt-get install -y nginx tags: - background-blue - background-red - backend-app run_command: nginx app_dir: /var/www/html app_type: SERVICE endpoints: - www: 80

Last modified on Sep 25, 2025