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

Endpoint parameters

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

HTTP endpoint parameters

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

Auth parameters for HTTP endpoints

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

TLS endpoint parameters

Name Type Required Description
terminate_at String No Where to terminate TLS. Available values: REGION, AGENT, TARGET.
private_key String No Private key for TLS certificate (encrypted).
certificate String No TLS certificate (encrypted).
ca_certificate String No 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 4, 2025