# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***

import builtins
import copy
import warnings
import sys
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
if sys.version_info >= (3, 11):
    from typing import NotRequired, TypedDict, TypeAlias
else:
    from typing_extensions import NotRequired, TypedDict, TypeAlias
from .. import _utilities
from . import outputs
from ._inputs import *

__all__ = ['SandboxArgs', 'Sandbox']

@pulumi.input_type
class SandboxArgs:
    def __init__(__self__, *,
                 function_id: pulumi.Input[builtins.str],
                 cpu_milli: Optional[pulumi.Input[builtins.int]] = None,
                 envs: Optional[pulumi.Input[Sequence[pulumi.Input['SandboxEnvArgs']]]] = None,
                 instance_image_info: Optional[pulumi.Input['SandboxInstanceImageInfoArgs']] = None,
                 instance_tos_mount_config: Optional[pulumi.Input['SandboxInstanceTosMountConfigArgs']] = None,
                 max_concurrency: Optional[pulumi.Input[builtins.int]] = None,
                 memory_mb: Optional[pulumi.Input[builtins.int]] = None,
                 metadatas: Optional[pulumi.Input[Sequence[pulumi.Input['SandboxMetadataArgs']]]] = None,
                 request_timeout: Optional[pulumi.Input[builtins.int]] = None,
                 timeout: Optional[pulumi.Input[builtins.int]] = None):
        """
        The set of arguments for constructing a Sandbox resource.
        :param pulumi.Input[builtins.str] function_id: 沙箱实例所属的沙箱应用 ID。
        :param pulumi.Input[builtins.int] cpu_milli: 沙箱实例 CPU 规格：单位：milli cpu取值范围：250~16000,默认值：1000。
        :param pulumi.Input['SandboxInstanceImageInfoArgs'] instance_image_info: 沙箱实例镜像信息，包括镜像地址、启动命令、监听端口。
        :param pulumi.Input['SandboxInstanceTosMountConfigArgs'] instance_tos_mount_config: 沙箱实例级别对象存储（TOS）存储挂载配置。
        :param pulumi.Input[builtins.int] max_concurrency: 单实例请求最大并发数：取值范围：10~1000,默认值：100。
        :param pulumi.Input[builtins.int] memory_mb: 沙箱实例内存规格：单位：MiB，取值范围：512~131072，默认值：2048
        :param pulumi.Input[builtins.int] request_timeout: 请求超时时间：单位：秒，取值范围：1~900，正整数。默认值：30。
        :param pulumi.Input[builtins.int] timeout: 沙箱实例存活时长：单位：分钟，取值范围：3～1440，默认值：60。
        """
        pulumi.set(__self__, "function_id", function_id)
        if cpu_milli is not None:
            pulumi.set(__self__, "cpu_milli", cpu_milli)
        if envs is not None:
            pulumi.set(__self__, "envs", envs)
        if instance_image_info is not None:
            pulumi.set(__self__, "instance_image_info", instance_image_info)
        if instance_tos_mount_config is not None:
            pulumi.set(__self__, "instance_tos_mount_config", instance_tos_mount_config)
        if max_concurrency is not None:
            pulumi.set(__self__, "max_concurrency", max_concurrency)
        if memory_mb is not None:
            pulumi.set(__self__, "memory_mb", memory_mb)
        if metadatas is not None:
            pulumi.set(__self__, "metadatas", metadatas)
        if request_timeout is not None:
            pulumi.set(__self__, "request_timeout", request_timeout)
        if timeout is not None:
            pulumi.set(__self__, "timeout", timeout)

    @property
    @pulumi.getter(name="functionId")
    def function_id(self) -> pulumi.Input[builtins.str]:
        """
        沙箱实例所属的沙箱应用 ID。
        """
        return pulumi.get(self, "function_id")

    @function_id.setter
    def function_id(self, value: pulumi.Input[builtins.str]):
        pulumi.set(self, "function_id", value)

    @property
    @pulumi.getter(name="cpuMilli")
    def cpu_milli(self) -> Optional[pulumi.Input[builtins.int]]:
        """
        沙箱实例 CPU 规格：单位：milli cpu取值范围：250~16000,默认值：1000。
        """
        return pulumi.get(self, "cpu_milli")

    @cpu_milli.setter
    def cpu_milli(self, value: Optional[pulumi.Input[builtins.int]]):
        pulumi.set(self, "cpu_milli", value)

    @property
    @pulumi.getter
    def envs(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['SandboxEnvArgs']]]]:
        return pulumi.get(self, "envs")

    @envs.setter
    def envs(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['SandboxEnvArgs']]]]):
        pulumi.set(self, "envs", value)

    @property
    @pulumi.getter(name="instanceImageInfo")
    def instance_image_info(self) -> Optional[pulumi.Input['SandboxInstanceImageInfoArgs']]:
        """
        沙箱实例镜像信息，包括镜像地址、启动命令、监听端口。
        """
        return pulumi.get(self, "instance_image_info")

    @instance_image_info.setter
    def instance_image_info(self, value: Optional[pulumi.Input['SandboxInstanceImageInfoArgs']]):
        pulumi.set(self, "instance_image_info", value)

    @property
    @pulumi.getter(name="instanceTosMountConfig")
    def instance_tos_mount_config(self) -> Optional[pulumi.Input['SandboxInstanceTosMountConfigArgs']]:
        """
        沙箱实例级别对象存储（TOS）存储挂载配置。
        """
        return pulumi.get(self, "instance_tos_mount_config")

    @instance_tos_mount_config.setter
    def instance_tos_mount_config(self, value: Optional[pulumi.Input['SandboxInstanceTosMountConfigArgs']]):
        pulumi.set(self, "instance_tos_mount_config", value)

    @property
    @pulumi.getter(name="maxConcurrency")
    def max_concurrency(self) -> Optional[pulumi.Input[builtins.int]]:
        """
        单实例请求最大并发数：取值范围：10~1000,默认值：100。
        """
        return pulumi.get(self, "max_concurrency")

    @max_concurrency.setter
    def max_concurrency(self, value: Optional[pulumi.Input[builtins.int]]):
        pulumi.set(self, "max_concurrency", value)

    @property
    @pulumi.getter(name="memoryMb")
    def memory_mb(self) -> Optional[pulumi.Input[builtins.int]]:
        """
        沙箱实例内存规格：单位：MiB，取值范围：512~131072，默认值：2048
        """
        return pulumi.get(self, "memory_mb")

    @memory_mb.setter
    def memory_mb(self, value: Optional[pulumi.Input[builtins.int]]):
        pulumi.set(self, "memory_mb", value)

    @property
    @pulumi.getter
    def metadatas(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['SandboxMetadataArgs']]]]:
        return pulumi.get(self, "metadatas")

    @metadatas.setter
    def metadatas(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['SandboxMetadataArgs']]]]):
        pulumi.set(self, "metadatas", value)

    @property
    @pulumi.getter(name="requestTimeout")
    def request_timeout(self) -> Optional[pulumi.Input[builtins.int]]:
        """
        请求超时时间：单位：秒，取值范围：1~900，正整数。默认值：30。
        """
        return pulumi.get(self, "request_timeout")

    @request_timeout.setter
    def request_timeout(self, value: Optional[pulumi.Input[builtins.int]]):
        pulumi.set(self, "request_timeout", value)

    @property
    @pulumi.getter
    def timeout(self) -> Optional[pulumi.Input[builtins.int]]:
        """
        沙箱实例存活时长：单位：分钟，取值范围：3～1440，默认值：60。
        """
        return pulumi.get(self, "timeout")

    @timeout.setter
    def timeout(self, value: Optional[pulumi.Input[builtins.int]]):
        pulumi.set(self, "timeout", value)


@pulumi.input_type
class _SandboxState:
    def __init__(__self__, *,
                 availability_zone: Optional[pulumi.Input[builtins.str]] = None,
                 cpu_milli: Optional[pulumi.Input[builtins.int]] = None,
                 created_time: Optional[pulumi.Input[builtins.str]] = None,
                 envs: Optional[pulumi.Input[Sequence[pulumi.Input['SandboxEnvArgs']]]] = None,
                 error_code: Optional[pulumi.Input[builtins.str]] = None,
                 error_message: Optional[pulumi.Input[builtins.str]] = None,
                 expire_at: Optional[pulumi.Input[builtins.str]] = None,
                 function_id: Optional[pulumi.Input[builtins.str]] = None,
                 instance_image_info: Optional[pulumi.Input['SandboxInstanceImageInfoArgs']] = None,
                 instance_tos_mount_config: Optional[pulumi.Input['SandboxInstanceTosMountConfigArgs']] = None,
                 instance_type: Optional[pulumi.Input[builtins.str]] = None,
                 max_concurrency: Optional[pulumi.Input[builtins.int]] = None,
                 memory_mb: Optional[pulumi.Input[builtins.int]] = None,
                 metadatas: Optional[pulumi.Input[Sequence[pulumi.Input['SandboxMetadataArgs']]]] = None,
                 pending: Optional[pulumi.Input[builtins.bool]] = None,
                 request_timeout: Optional[pulumi.Input[builtins.int]] = None,
                 revision_number: Optional[pulumi.Input[builtins.int]] = None,
                 sandbox_id: Optional[pulumi.Input[builtins.str]] = None,
                 status: Optional[pulumi.Input[builtins.str]] = None,
                 timeout: Optional[pulumi.Input[builtins.int]] = None):
        """
        Input properties used for looking up and filtering Sandbox resources.
        :param pulumi.Input[builtins.str] availability_zone: 沙箱实例所在可用区 ID。
        :param pulumi.Input[builtins.int] cpu_milli: 沙箱实例 CPU 规格：单位：milli cpu取值范围：250~16000,默认值：1000。
        :param pulumi.Input[builtins.str] created_time: 沙箱实例创建时间。
        :param pulumi.Input[builtins.str] error_code: 沙箱实例启动失败错误码。参数值说明：internal*load*request*error：系统内部错误，function*initialize*failed：业务进程初始化错误，function*health*check*failed：健康检查错误，route_terminating：路由删除中，正常启动沙箱实例时，该字段为空。
        :param pulumi.Input[builtins.str] error_message: 沙箱实例启动失败的错误码详情。正常启动沙箱实例时，该字段为空。
        :param pulumi.Input[builtins.str] expire_at: 沙箱实例存活时长。
        :param pulumi.Input[builtins.str] function_id: 沙箱实例所属的沙箱应用 ID。
        :param pulumi.Input['SandboxInstanceImageInfoArgs'] instance_image_info: 沙箱实例镜像信息，包括镜像地址、启动命令、监听端口。
        :param pulumi.Input['SandboxInstanceTosMountConfigArgs'] instance_tos_mount_config: 沙箱实例级别对象存储（TOS）存储挂载配置。
        :param pulumi.Input[builtins.str] instance_type: 沙箱实例类型 。参数值说明：elastic：弹性实例，frozen：冻结实例，activated：激活实例，reserved：预留实例。
        :param pulumi.Input[builtins.int] max_concurrency: 单实例请求最大并发数：取值范围：10~1000,默认值：100。
        :param pulumi.Input[builtins.int] memory_mb: 沙箱实例内存规格：单位：MiB，取值范围：512~131072，默认值：2048
        :param pulumi.Input[builtins.bool] pending: 沙箱实例是否处于 Pending 状态。参数值说明：true：是，false：否。
        :param pulumi.Input[builtins.int] request_timeout: 请求超时时间：单位：秒，取值范围：1~900，正整数。默认值：30。
        :param pulumi.Input[builtins.int] revision_number: 函数实例版本编号。
        :param pulumi.Input[builtins.str] sandbox_id: 沙箱实例 ID。
        :param pulumi.Input[builtins.str] status: 沙箱实例状态。 参数值说明：Starting：开始启动，Ready：启动完成，Failed：启动失败，Terminating：终止中。
        :param pulumi.Input[builtins.int] timeout: 沙箱实例存活时长：单位：分钟，取值范围：3～1440，默认值：60。
        """
        if availability_zone is not None:
            pulumi.set(__self__, "availability_zone", availability_zone)
        if cpu_milli is not None:
            pulumi.set(__self__, "cpu_milli", cpu_milli)
        if created_time is not None:
            pulumi.set(__self__, "created_time", created_time)
        if envs is not None:
            pulumi.set(__self__, "envs", envs)
        if error_code is not None:
            pulumi.set(__self__, "error_code", error_code)
        if error_message is not None:
            pulumi.set(__self__, "error_message", error_message)
        if expire_at is not None:
            pulumi.set(__self__, "expire_at", expire_at)
        if function_id is not None:
            pulumi.set(__self__, "function_id", function_id)
        if instance_image_info is not None:
            pulumi.set(__self__, "instance_image_info", instance_image_info)
        if instance_tos_mount_config is not None:
            pulumi.set(__self__, "instance_tos_mount_config", instance_tos_mount_config)
        if instance_type is not None:
            pulumi.set(__self__, "instance_type", instance_type)
        if max_concurrency is not None:
            pulumi.set(__self__, "max_concurrency", max_concurrency)
        if memory_mb is not None:
            pulumi.set(__self__, "memory_mb", memory_mb)
        if metadatas is not None:
            pulumi.set(__self__, "metadatas", metadatas)
        if pending is not None:
            pulumi.set(__self__, "pending", pending)
        if request_timeout is not None:
            pulumi.set(__self__, "request_timeout", request_timeout)
        if revision_number is not None:
            pulumi.set(__self__, "revision_number", revision_number)
        if sandbox_id is not None:
            pulumi.set(__self__, "sandbox_id", sandbox_id)
        if status is not None:
            pulumi.set(__self__, "status", status)
        if timeout is not None:
            pulumi.set(__self__, "timeout", timeout)

    @property
    @pulumi.getter(name="availabilityZone")
    def availability_zone(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        沙箱实例所在可用区 ID。
        """
        return pulumi.get(self, "availability_zone")

    @availability_zone.setter
    def availability_zone(self, value: Optional[pulumi.Input[builtins.str]]):
        pulumi.set(self, "availability_zone", value)

    @property
    @pulumi.getter(name="cpuMilli")
    def cpu_milli(self) -> Optional[pulumi.Input[builtins.int]]:
        """
        沙箱实例 CPU 规格：单位：milli cpu取值范围：250~16000,默认值：1000。
        """
        return pulumi.get(self, "cpu_milli")

    @cpu_milli.setter
    def cpu_milli(self, value: Optional[pulumi.Input[builtins.int]]):
        pulumi.set(self, "cpu_milli", value)

    @property
    @pulumi.getter(name="createdTime")
    def created_time(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        沙箱实例创建时间。
        """
        return pulumi.get(self, "created_time")

    @created_time.setter
    def created_time(self, value: Optional[pulumi.Input[builtins.str]]):
        pulumi.set(self, "created_time", value)

    @property
    @pulumi.getter
    def envs(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['SandboxEnvArgs']]]]:
        return pulumi.get(self, "envs")

    @envs.setter
    def envs(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['SandboxEnvArgs']]]]):
        pulumi.set(self, "envs", value)

    @property
    @pulumi.getter(name="errorCode")
    def error_code(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        沙箱实例启动失败错误码。参数值说明：internal*load*request*error：系统内部错误，function*initialize*failed：业务进程初始化错误，function*health*check*failed：健康检查错误，route_terminating：路由删除中，正常启动沙箱实例时，该字段为空。
        """
        return pulumi.get(self, "error_code")

    @error_code.setter
    def error_code(self, value: Optional[pulumi.Input[builtins.str]]):
        pulumi.set(self, "error_code", value)

    @property
    @pulumi.getter(name="errorMessage")
    def error_message(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        沙箱实例启动失败的错误码详情。正常启动沙箱实例时，该字段为空。
        """
        return pulumi.get(self, "error_message")

    @error_message.setter
    def error_message(self, value: Optional[pulumi.Input[builtins.str]]):
        pulumi.set(self, "error_message", value)

    @property
    @pulumi.getter(name="expireAt")
    def expire_at(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        沙箱实例存活时长。
        """
        return pulumi.get(self, "expire_at")

    @expire_at.setter
    def expire_at(self, value: Optional[pulumi.Input[builtins.str]]):
        pulumi.set(self, "expire_at", value)

    @property
    @pulumi.getter(name="functionId")
    def function_id(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        沙箱实例所属的沙箱应用 ID。
        """
        return pulumi.get(self, "function_id")

    @function_id.setter
    def function_id(self, value: Optional[pulumi.Input[builtins.str]]):
        pulumi.set(self, "function_id", value)

    @property
    @pulumi.getter(name="instanceImageInfo")
    def instance_image_info(self) -> Optional[pulumi.Input['SandboxInstanceImageInfoArgs']]:
        """
        沙箱实例镜像信息，包括镜像地址、启动命令、监听端口。
        """
        return pulumi.get(self, "instance_image_info")

    @instance_image_info.setter
    def instance_image_info(self, value: Optional[pulumi.Input['SandboxInstanceImageInfoArgs']]):
        pulumi.set(self, "instance_image_info", value)

    @property
    @pulumi.getter(name="instanceTosMountConfig")
    def instance_tos_mount_config(self) -> Optional[pulumi.Input['SandboxInstanceTosMountConfigArgs']]:
        """
        沙箱实例级别对象存储（TOS）存储挂载配置。
        """
        return pulumi.get(self, "instance_tos_mount_config")

    @instance_tos_mount_config.setter
    def instance_tos_mount_config(self, value: Optional[pulumi.Input['SandboxInstanceTosMountConfigArgs']]):
        pulumi.set(self, "instance_tos_mount_config", value)

    @property
    @pulumi.getter(name="instanceType")
    def instance_type(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        沙箱实例类型 。参数值说明：elastic：弹性实例，frozen：冻结实例，activated：激活实例，reserved：预留实例。
        """
        return pulumi.get(self, "instance_type")

    @instance_type.setter
    def instance_type(self, value: Optional[pulumi.Input[builtins.str]]):
        pulumi.set(self, "instance_type", value)

    @property
    @pulumi.getter(name="maxConcurrency")
    def max_concurrency(self) -> Optional[pulumi.Input[builtins.int]]:
        """
        单实例请求最大并发数：取值范围：10~1000,默认值：100。
        """
        return pulumi.get(self, "max_concurrency")

    @max_concurrency.setter
    def max_concurrency(self, value: Optional[pulumi.Input[builtins.int]]):
        pulumi.set(self, "max_concurrency", value)

    @property
    @pulumi.getter(name="memoryMb")
    def memory_mb(self) -> Optional[pulumi.Input[builtins.int]]:
        """
        沙箱实例内存规格：单位：MiB，取值范围：512~131072，默认值：2048
        """
        return pulumi.get(self, "memory_mb")

    @memory_mb.setter
    def memory_mb(self, value: Optional[pulumi.Input[builtins.int]]):
        pulumi.set(self, "memory_mb", value)

    @property
    @pulumi.getter
    def metadatas(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['SandboxMetadataArgs']]]]:
        return pulumi.get(self, "metadatas")

    @metadatas.setter
    def metadatas(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['SandboxMetadataArgs']]]]):
        pulumi.set(self, "metadatas", value)

    @property
    @pulumi.getter
    def pending(self) -> Optional[pulumi.Input[builtins.bool]]:
        """
        沙箱实例是否处于 Pending 状态。参数值说明：true：是，false：否。
        """
        return pulumi.get(self, "pending")

    @pending.setter
    def pending(self, value: Optional[pulumi.Input[builtins.bool]]):
        pulumi.set(self, "pending", value)

    @property
    @pulumi.getter(name="requestTimeout")
    def request_timeout(self) -> Optional[pulumi.Input[builtins.int]]:
        """
        请求超时时间：单位：秒，取值范围：1~900，正整数。默认值：30。
        """
        return pulumi.get(self, "request_timeout")

    @request_timeout.setter
    def request_timeout(self, value: Optional[pulumi.Input[builtins.int]]):
        pulumi.set(self, "request_timeout", value)

    @property
    @pulumi.getter(name="revisionNumber")
    def revision_number(self) -> Optional[pulumi.Input[builtins.int]]:
        """
        函数实例版本编号。
        """
        return pulumi.get(self, "revision_number")

    @revision_number.setter
    def revision_number(self, value: Optional[pulumi.Input[builtins.int]]):
        pulumi.set(self, "revision_number", value)

    @property
    @pulumi.getter(name="sandboxId")
    def sandbox_id(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        沙箱实例 ID。
        """
        return pulumi.get(self, "sandbox_id")

    @sandbox_id.setter
    def sandbox_id(self, value: Optional[pulumi.Input[builtins.str]]):
        pulumi.set(self, "sandbox_id", value)

    @property
    @pulumi.getter
    def status(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        沙箱实例状态。 参数值说明：Starting：开始启动，Ready：启动完成，Failed：启动失败，Terminating：终止中。
        """
        return pulumi.get(self, "status")

    @status.setter
    def status(self, value: Optional[pulumi.Input[builtins.str]]):
        pulumi.set(self, "status", value)

    @property
    @pulumi.getter
    def timeout(self) -> Optional[pulumi.Input[builtins.int]]:
        """
        沙箱实例存活时长：单位：分钟，取值范围：3～1440，默认值：60。
        """
        return pulumi.get(self, "timeout")

    @timeout.setter
    def timeout(self, value: Optional[pulumi.Input[builtins.int]]):
        pulumi.set(self, "timeout", value)


@pulumi.type_token("bytepluscc:vefaas/sandbox:Sandbox")
class Sandbox(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 cpu_milli: Optional[pulumi.Input[builtins.int]] = None,
                 envs: Optional[pulumi.Input[Sequence[pulumi.Input[Union['SandboxEnvArgs', 'SandboxEnvArgsDict']]]]] = None,
                 function_id: Optional[pulumi.Input[builtins.str]] = None,
                 instance_image_info: Optional[pulumi.Input[Union['SandboxInstanceImageInfoArgs', 'SandboxInstanceImageInfoArgsDict']]] = None,
                 instance_tos_mount_config: Optional[pulumi.Input[Union['SandboxInstanceTosMountConfigArgs', 'SandboxInstanceTosMountConfigArgsDict']]] = None,
                 max_concurrency: Optional[pulumi.Input[builtins.int]] = None,
                 memory_mb: Optional[pulumi.Input[builtins.int]] = None,
                 metadatas: Optional[pulumi.Input[Sequence[pulumi.Input[Union['SandboxMetadataArgs', 'SandboxMetadataArgsDict']]]]] = None,
                 request_timeout: Optional[pulumi.Input[builtins.int]] = None,
                 timeout: Optional[pulumi.Input[builtins.int]] = None,
                 __props__=None):
        """
        沙箱实例是云沙箱中实际执行沙箱镜像的安全且隔离的容器运行环境。

        ## Import

        ```sh
        $ pulumi import bytepluscc:vefaas/sandbox:Sandbox example "function_id|sandbox_id"
        ```

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[builtins.int] cpu_milli: 沙箱实例 CPU 规格：单位：milli cpu取值范围：250~16000,默认值：1000。
        :param pulumi.Input[builtins.str] function_id: 沙箱实例所属的沙箱应用 ID。
        :param pulumi.Input[Union['SandboxInstanceImageInfoArgs', 'SandboxInstanceImageInfoArgsDict']] instance_image_info: 沙箱实例镜像信息，包括镜像地址、启动命令、监听端口。
        :param pulumi.Input[Union['SandboxInstanceTosMountConfigArgs', 'SandboxInstanceTosMountConfigArgsDict']] instance_tos_mount_config: 沙箱实例级别对象存储（TOS）存储挂载配置。
        :param pulumi.Input[builtins.int] max_concurrency: 单实例请求最大并发数：取值范围：10~1000,默认值：100。
        :param pulumi.Input[builtins.int] memory_mb: 沙箱实例内存规格：单位：MiB，取值范围：512~131072，默认值：2048
        :param pulumi.Input[builtins.int] request_timeout: 请求超时时间：单位：秒，取值范围：1~900，正整数。默认值：30。
        :param pulumi.Input[builtins.int] timeout: 沙箱实例存活时长：单位：分钟，取值范围：3～1440，默认值：60。
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: SandboxArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        沙箱实例是云沙箱中实际执行沙箱镜像的安全且隔离的容器运行环境。

        ## Import

        ```sh
        $ pulumi import bytepluscc:vefaas/sandbox:Sandbox example "function_id|sandbox_id"
        ```

        :param str resource_name: The name of the resource.
        :param SandboxArgs args: The arguments to use to populate this resource's properties.
        :param pulumi.ResourceOptions opts: Options for the resource.
        """
        ...
    def __init__(__self__, resource_name: str, *args, **kwargs):
        resource_args, opts = _utilities.get_resource_args_opts(SandboxArgs, pulumi.ResourceOptions, *args, **kwargs)
        if resource_args is not None:
            __self__._internal_init(resource_name, opts, **resource_args.__dict__)
        else:
            __self__._internal_init(resource_name, *args, **kwargs)

    def _internal_init(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 cpu_milli: Optional[pulumi.Input[builtins.int]] = None,
                 envs: Optional[pulumi.Input[Sequence[pulumi.Input[Union['SandboxEnvArgs', 'SandboxEnvArgsDict']]]]] = None,
                 function_id: Optional[pulumi.Input[builtins.str]] = None,
                 instance_image_info: Optional[pulumi.Input[Union['SandboxInstanceImageInfoArgs', 'SandboxInstanceImageInfoArgsDict']]] = None,
                 instance_tos_mount_config: Optional[pulumi.Input[Union['SandboxInstanceTosMountConfigArgs', 'SandboxInstanceTosMountConfigArgsDict']]] = None,
                 max_concurrency: Optional[pulumi.Input[builtins.int]] = None,
                 memory_mb: Optional[pulumi.Input[builtins.int]] = None,
                 metadatas: Optional[pulumi.Input[Sequence[pulumi.Input[Union['SandboxMetadataArgs', 'SandboxMetadataArgsDict']]]]] = None,
                 request_timeout: Optional[pulumi.Input[builtins.int]] = None,
                 timeout: Optional[pulumi.Input[builtins.int]] = None,
                 __props__=None):
        opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts)
        if not isinstance(opts, pulumi.ResourceOptions):
            raise TypeError('Expected resource options to be a ResourceOptions instance')
        if opts.id is None:
            if __props__ is not None:
                raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource')
            __props__ = SandboxArgs.__new__(SandboxArgs)

            __props__.__dict__["cpu_milli"] = cpu_milli
            __props__.__dict__["envs"] = envs
            if function_id is None and not opts.urn:
                raise TypeError("Missing required property 'function_id'")
            __props__.__dict__["function_id"] = function_id
            __props__.__dict__["instance_image_info"] = instance_image_info
            __props__.__dict__["instance_tos_mount_config"] = instance_tos_mount_config
            __props__.__dict__["max_concurrency"] = max_concurrency
            __props__.__dict__["memory_mb"] = memory_mb
            __props__.__dict__["metadatas"] = metadatas
            __props__.__dict__["request_timeout"] = request_timeout
            __props__.__dict__["timeout"] = timeout
            __props__.__dict__["availability_zone"] = None
            __props__.__dict__["created_time"] = None
            __props__.__dict__["error_code"] = None
            __props__.__dict__["error_message"] = None
            __props__.__dict__["expire_at"] = None
            __props__.__dict__["instance_type"] = None
            __props__.__dict__["pending"] = None
            __props__.__dict__["revision_number"] = None
            __props__.__dict__["sandbox_id"] = None
            __props__.__dict__["status"] = None
        super(Sandbox, __self__).__init__(
            'bytepluscc:vefaas/sandbox:Sandbox',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            availability_zone: Optional[pulumi.Input[builtins.str]] = None,
            cpu_milli: Optional[pulumi.Input[builtins.int]] = None,
            created_time: Optional[pulumi.Input[builtins.str]] = None,
            envs: Optional[pulumi.Input[Sequence[pulumi.Input[Union['SandboxEnvArgs', 'SandboxEnvArgsDict']]]]] = None,
            error_code: Optional[pulumi.Input[builtins.str]] = None,
            error_message: Optional[pulumi.Input[builtins.str]] = None,
            expire_at: Optional[pulumi.Input[builtins.str]] = None,
            function_id: Optional[pulumi.Input[builtins.str]] = None,
            instance_image_info: Optional[pulumi.Input[Union['SandboxInstanceImageInfoArgs', 'SandboxInstanceImageInfoArgsDict']]] = None,
            instance_tos_mount_config: Optional[pulumi.Input[Union['SandboxInstanceTosMountConfigArgs', 'SandboxInstanceTosMountConfigArgsDict']]] = None,
            instance_type: Optional[pulumi.Input[builtins.str]] = None,
            max_concurrency: Optional[pulumi.Input[builtins.int]] = None,
            memory_mb: Optional[pulumi.Input[builtins.int]] = None,
            metadatas: Optional[pulumi.Input[Sequence[pulumi.Input[Union['SandboxMetadataArgs', 'SandboxMetadataArgsDict']]]]] = None,
            pending: Optional[pulumi.Input[builtins.bool]] = None,
            request_timeout: Optional[pulumi.Input[builtins.int]] = None,
            revision_number: Optional[pulumi.Input[builtins.int]] = None,
            sandbox_id: Optional[pulumi.Input[builtins.str]] = None,
            status: Optional[pulumi.Input[builtins.str]] = None,
            timeout: Optional[pulumi.Input[builtins.int]] = None) -> 'Sandbox':
        """
        Get an existing Sandbox resource's state with the given name, id, and optional extra
        properties used to qualify the lookup.

        :param str resource_name: The unique name of the resulting resource.
        :param pulumi.Input[str] id: The unique provider ID of the resource to lookup.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[builtins.str] availability_zone: 沙箱实例所在可用区 ID。
        :param pulumi.Input[builtins.int] cpu_milli: 沙箱实例 CPU 规格：单位：milli cpu取值范围：250~16000,默认值：1000。
        :param pulumi.Input[builtins.str] created_time: 沙箱实例创建时间。
        :param pulumi.Input[builtins.str] error_code: 沙箱实例启动失败错误码。参数值说明：internal*load*request*error：系统内部错误，function*initialize*failed：业务进程初始化错误，function*health*check*failed：健康检查错误，route_terminating：路由删除中，正常启动沙箱实例时，该字段为空。
        :param pulumi.Input[builtins.str] error_message: 沙箱实例启动失败的错误码详情。正常启动沙箱实例时，该字段为空。
        :param pulumi.Input[builtins.str] expire_at: 沙箱实例存活时长。
        :param pulumi.Input[builtins.str] function_id: 沙箱实例所属的沙箱应用 ID。
        :param pulumi.Input[Union['SandboxInstanceImageInfoArgs', 'SandboxInstanceImageInfoArgsDict']] instance_image_info: 沙箱实例镜像信息，包括镜像地址、启动命令、监听端口。
        :param pulumi.Input[Union['SandboxInstanceTosMountConfigArgs', 'SandboxInstanceTosMountConfigArgsDict']] instance_tos_mount_config: 沙箱实例级别对象存储（TOS）存储挂载配置。
        :param pulumi.Input[builtins.str] instance_type: 沙箱实例类型 。参数值说明：elastic：弹性实例，frozen：冻结实例，activated：激活实例，reserved：预留实例。
        :param pulumi.Input[builtins.int] max_concurrency: 单实例请求最大并发数：取值范围：10~1000,默认值：100。
        :param pulumi.Input[builtins.int] memory_mb: 沙箱实例内存规格：单位：MiB，取值范围：512~131072，默认值：2048
        :param pulumi.Input[builtins.bool] pending: 沙箱实例是否处于 Pending 状态。参数值说明：true：是，false：否。
        :param pulumi.Input[builtins.int] request_timeout: 请求超时时间：单位：秒，取值范围：1~900，正整数。默认值：30。
        :param pulumi.Input[builtins.int] revision_number: 函数实例版本编号。
        :param pulumi.Input[builtins.str] sandbox_id: 沙箱实例 ID。
        :param pulumi.Input[builtins.str] status: 沙箱实例状态。 参数值说明：Starting：开始启动，Ready：启动完成，Failed：启动失败，Terminating：终止中。
        :param pulumi.Input[builtins.int] timeout: 沙箱实例存活时长：单位：分钟，取值范围：3～1440，默认值：60。
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = _SandboxState.__new__(_SandboxState)

        __props__.__dict__["availability_zone"] = availability_zone
        __props__.__dict__["cpu_milli"] = cpu_milli
        __props__.__dict__["created_time"] = created_time
        __props__.__dict__["envs"] = envs
        __props__.__dict__["error_code"] = error_code
        __props__.__dict__["error_message"] = error_message
        __props__.__dict__["expire_at"] = expire_at
        __props__.__dict__["function_id"] = function_id
        __props__.__dict__["instance_image_info"] = instance_image_info
        __props__.__dict__["instance_tos_mount_config"] = instance_tos_mount_config
        __props__.__dict__["instance_type"] = instance_type
        __props__.__dict__["max_concurrency"] = max_concurrency
        __props__.__dict__["memory_mb"] = memory_mb
        __props__.__dict__["metadatas"] = metadatas
        __props__.__dict__["pending"] = pending
        __props__.__dict__["request_timeout"] = request_timeout
        __props__.__dict__["revision_number"] = revision_number
        __props__.__dict__["sandbox_id"] = sandbox_id
        __props__.__dict__["status"] = status
        __props__.__dict__["timeout"] = timeout
        return Sandbox(resource_name, opts=opts, __props__=__props__)

    @property
    @pulumi.getter(name="availabilityZone")
    def availability_zone(self) -> pulumi.Output[builtins.str]:
        """
        沙箱实例所在可用区 ID。
        """
        return pulumi.get(self, "availability_zone")

    @property
    @pulumi.getter(name="cpuMilli")
    def cpu_milli(self) -> pulumi.Output[builtins.int]:
        """
        沙箱实例 CPU 规格：单位：milli cpu取值范围：250~16000,默认值：1000。
        """
        return pulumi.get(self, "cpu_milli")

    @property
    @pulumi.getter(name="createdTime")
    def created_time(self) -> pulumi.Output[builtins.str]:
        """
        沙箱实例创建时间。
        """
        return pulumi.get(self, "created_time")

    @property
    @pulumi.getter
    def envs(self) -> pulumi.Output[Sequence['outputs.SandboxEnv']]:
        return pulumi.get(self, "envs")

    @property
    @pulumi.getter(name="errorCode")
    def error_code(self) -> pulumi.Output[builtins.str]:
        """
        沙箱实例启动失败错误码。参数值说明：internal*load*request*error：系统内部错误，function*initialize*failed：业务进程初始化错误，function*health*check*failed：健康检查错误，route_terminating：路由删除中，正常启动沙箱实例时，该字段为空。
        """
        return pulumi.get(self, "error_code")

    @property
    @pulumi.getter(name="errorMessage")
    def error_message(self) -> pulumi.Output[builtins.str]:
        """
        沙箱实例启动失败的错误码详情。正常启动沙箱实例时，该字段为空。
        """
        return pulumi.get(self, "error_message")

    @property
    @pulumi.getter(name="expireAt")
    def expire_at(self) -> pulumi.Output[builtins.str]:
        """
        沙箱实例存活时长。
        """
        return pulumi.get(self, "expire_at")

    @property
    @pulumi.getter(name="functionId")
    def function_id(self) -> pulumi.Output[builtins.str]:
        """
        沙箱实例所属的沙箱应用 ID。
        """
        return pulumi.get(self, "function_id")

    @property
    @pulumi.getter(name="instanceImageInfo")
    def instance_image_info(self) -> pulumi.Output['outputs.SandboxInstanceImageInfo']:
        """
        沙箱实例镜像信息，包括镜像地址、启动命令、监听端口。
        """
        return pulumi.get(self, "instance_image_info")

    @property
    @pulumi.getter(name="instanceTosMountConfig")
    def instance_tos_mount_config(self) -> pulumi.Output['outputs.SandboxInstanceTosMountConfig']:
        """
        沙箱实例级别对象存储（TOS）存储挂载配置。
        """
        return pulumi.get(self, "instance_tos_mount_config")

    @property
    @pulumi.getter(name="instanceType")
    def instance_type(self) -> pulumi.Output[builtins.str]:
        """
        沙箱实例类型 。参数值说明：elastic：弹性实例，frozen：冻结实例，activated：激活实例，reserved：预留实例。
        """
        return pulumi.get(self, "instance_type")

    @property
    @pulumi.getter(name="maxConcurrency")
    def max_concurrency(self) -> pulumi.Output[builtins.int]:
        """
        单实例请求最大并发数：取值范围：10~1000,默认值：100。
        """
        return pulumi.get(self, "max_concurrency")

    @property
    @pulumi.getter(name="memoryMb")
    def memory_mb(self) -> pulumi.Output[builtins.int]:
        """
        沙箱实例内存规格：单位：MiB，取值范围：512~131072，默认值：2048
        """
        return pulumi.get(self, "memory_mb")

    @property
    @pulumi.getter
    def metadatas(self) -> pulumi.Output[Sequence['outputs.SandboxMetadata']]:
        return pulumi.get(self, "metadatas")

    @property
    @pulumi.getter
    def pending(self) -> pulumi.Output[builtins.bool]:
        """
        沙箱实例是否处于 Pending 状态。参数值说明：true：是，false：否。
        """
        return pulumi.get(self, "pending")

    @property
    @pulumi.getter(name="requestTimeout")
    def request_timeout(self) -> pulumi.Output[builtins.int]:
        """
        请求超时时间：单位：秒，取值范围：1~900，正整数。默认值：30。
        """
        return pulumi.get(self, "request_timeout")

    @property
    @pulumi.getter(name="revisionNumber")
    def revision_number(self) -> pulumi.Output[builtins.int]:
        """
        函数实例版本编号。
        """
        return pulumi.get(self, "revision_number")

    @property
    @pulumi.getter(name="sandboxId")
    def sandbox_id(self) -> pulumi.Output[builtins.str]:
        """
        沙箱实例 ID。
        """
        return pulumi.get(self, "sandbox_id")

    @property
    @pulumi.getter
    def status(self) -> pulumi.Output[builtins.str]:
        """
        沙箱实例状态。 参数值说明：Starting：开始启动，Ready：启动完成，Failed：启动失败，Terminating：终止中。
        """
        return pulumi.get(self, "status")

    @property
    @pulumi.getter
    def timeout(self) -> pulumi.Output[builtins.int]:
        """
        沙箱实例存活时长：单位：分钟，取值范围：3～1440，默认值：60。
        """
        return pulumi.get(self, "timeout")

