modal
    Preparing search index...

    Type Alias SandboxCreateParams

    Optional parameters for client.sandboxes.create().

    type SandboxCreateParams = {
        blockNetwork?: boolean;
        cloud?: string;
        cloudBucketMounts?: Record<string, CloudBucketMount>;
        command?: string[];
        cpu?: number;
        cpuLimit?: number;
        customDomain?: string;
        encryptedPorts?: number[];
        env?: Record<string, string>;
        experimentalOptions?: Record<string, any>;
        gpu?: string;
        h2Ports?: number[];
        idleTimeoutMs?: number;
        inboundCidrAllowlist?: string[];
        includeOidcIdentityToken?: boolean;
        memoryLimitMiB?: number;
        memoryMiB?: number;
        name?: string;
        outboundCidrAllowlist?: string[];
        outboundDomainAllowlist?: string[];
        proxy?: Proxy;
        pty?: boolean;
        readinessProbe?: Probe;
        regions?: string[];
        secrets?: Secret[];
        tags?: Record<string, string>;
        timeoutMs?: number;
        unencryptedPorts?: number[];
        verbose?: boolean;
        volumes?: Record<string, Volume>;
        workdir?: string;
    }
    Index

    Properties

    blockNetwork?: boolean

    Whether to block all network access from the Sandbox.

    cloud?: string

    Cloud provider to run the Sandbox on.

    cloudBucketMounts?: Record<string, CloudBucketMount>

    Mount points for CloudBucketMounts.

    command?: string[]

    Sequence of program arguments for the main process. Default behavior is to sleep indefinitely until timeout or termination.

    cpu?: number

    Reservation of physical CPU cores for the Sandbox, can be fractional.

    cpuLimit?: number

    Hard limit of physical CPU cores for the Sandbox, can be fractional.

    customDomain?: string

    If set, connections to this Sandbox will be subdomains of this domain rather than the default. This requires prior manual setup by Modal and is only available for Enterprise customers.

    encryptedPorts?: number[]

    List of ports to tunnel into the Sandbox. Encrypted ports are tunneled with TLS.

    env?: Record<string, string>

    Environment variables to set in the Sandbox.

    experimentalOptions?: Record<string, any>

    Optional experimental options.

    gpu?: string

    GPU reservation for the Sandbox (e.g. "A100", "T4:2", "A100-80GB:4").

    h2Ports?: number[]

    List of encrypted ports to tunnel into the Sandbox, using HTTP/2.

    idleTimeoutMs?: number

    The amount of time in milliseconds that a Sandbox can be idle before being terminated.

    inboundCidrAllowlist?: string[]

    List of CIDRs allowed to connect inbound to the Sandbox (tunnels and connection tokens). If not set, all IPs are allowed. Cannot be used with blockNetwork.

    includeOidcIdentityToken?: boolean

    If true, the sandbox will receive a MODAL_IDENTITY_TOKEN env var for OIDC-based auth (e.g. to AWS, GCP).

    memoryLimitMiB?: number

    Hard limit of memory in MiB.

    memoryMiB?: number

    Reservation of memory in MiB.

    name?: string

    Optional name for the Sandbox. Unique within an App.

    outboundCidrAllowlist?: string[]

    List of CIDRs the Sandbox is allowed to access. If not set, all CIDRs are allowed. Cannot be used with blockNetwork.

    outboundDomainAllowlist?: string[]

    List of domain names the Sandbox is allowed to access. Supports wildcard prefixes (*.example.com). Cannot be used with blockNetwork.

    proxy?: Proxy

    Reference to a Modal Proxy to use in front of this Sandbox.

    pty?: boolean

    Enable a PTY for the Sandbox entrypoint command. When enabled, all output (stdout and stderr from the process) is multiplexed into stdout, and the stderr stream is effectively empty.

    readinessProbe?: Probe

    Probe used to determine when the Sandbox has become ready.

    regions?: string[]

    Region(s) to run the Sandbox on.

    secrets?: Secret[]

    Secrets to inject into the Sandbox as environment variables.

    tags?: Record<string, string>

    Tags to attach to the Sandbox. Filterable via client.sandboxes.list.

    timeoutMs?: number

    Maximum lifetime of the Sandbox in milliseconds. Defaults to 5 minutes.

    unencryptedPorts?: number[]

    List of ports to tunnel into the Sandbox without encryption.

    verbose?: boolean

    Enable verbose logging.

    volumes?: Record<string, Volume>

    Mount points for Modal Volumes.

    workdir?: string

    Working directory of the Sandbox.