# 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 copy
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
from . import outputs
from ._inputs import *

__all__ = ['V2FunctionArgs', 'V2Function']

@pulumi.input_type
class V2FunctionArgs:
    def __init__(__self__, *,
                 function_name: pulumi.Input[str],
                 handler: pulumi.Input[str],
                 runtime: pulumi.Input[str],
                 service_name: pulumi.Input[str],
                 ca_port: Optional[pulumi.Input[int]] = None,
                 code: Optional[pulumi.Input['V2FunctionCodeArgs']] = None,
                 code_checksum: Optional[pulumi.Input[str]] = None,
                 cpu: Optional[pulumi.Input[float]] = None,
                 custom_container_config: Optional[pulumi.Input['V2FunctionCustomContainerConfigArgs']] = None,
                 custom_dns: Optional[pulumi.Input['V2FunctionCustomDnsArgs']] = None,
                 custom_health_check_config: Optional[pulumi.Input['V2FunctionCustomHealthCheckConfigArgs']] = None,
                 custom_runtime_config: Optional[pulumi.Input['V2FunctionCustomRuntimeConfigArgs']] = None,
                 description: Optional[pulumi.Input[str]] = None,
                 disk_size: Optional[pulumi.Input[int]] = None,
                 environment_variables: Optional[pulumi.Input[Mapping[str, Any]]] = None,
                 gpu_memory_size: Optional[pulumi.Input[int]] = None,
                 initialization_timeout: Optional[pulumi.Input[int]] = None,
                 initializer: Optional[pulumi.Input[str]] = None,
                 instance_concurrency: Optional[pulumi.Input[int]] = None,
                 instance_lifecycle_config: Optional[pulumi.Input['V2FunctionInstanceLifecycleConfigArgs']] = None,
                 instance_type: Optional[pulumi.Input[str]] = None,
                 layers: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                 memory_size: Optional[pulumi.Input[int]] = None,
                 timeout: Optional[pulumi.Input[int]] = None):
        """
        The set of arguments for constructing a V2Function resource.
        :param pulumi.Input[str] function_name: function name.
        :param pulumi.Input[str] handler: entry point of function.
        :param pulumi.Input[str] runtime: runtime of function code.
        :param pulumi.Input[str] service_name: The name of the function Service.
        :param pulumi.Input[int] ca_port: The listening port of the HTTP Server when the Custom Runtime or Custom Container is running.
        :param pulumi.Input['V2FunctionCodeArgs'] code: Function Code ZIP package. code and customContainerConfig choose one. See `code` below.
        :param pulumi.Input[str] code_checksum: crc64 of function code.
        :param pulumi.Input[float] cpu: The CPU specification of the function. The unit is vCPU, which is a multiple of the 0.05 vCPU.
        :param pulumi.Input['V2FunctionCustomContainerConfigArgs'] custom_container_config: Custom-container runtime related function configuration. See `custom_container_config` below.
        :param pulumi.Input['V2FunctionCustomDnsArgs'] custom_dns: Function custom DNS configuration. See `custom_dns` below.
        :param pulumi.Input['V2FunctionCustomHealthCheckConfigArgs'] custom_health_check_config: Custom runtime/container Custom health check configuration. See `custom_health_check_config` below.
        :param pulumi.Input['V2FunctionCustomRuntimeConfigArgs'] custom_runtime_config: Detailed configuration of Custom Runtime function. See `custom_runtime_config` below.
        :param pulumi.Input[str] description: description of function.
        :param pulumi.Input[int] disk_size: The disk specification of the function. The unit is MB. The optional value is 512 MB or 10240MB.
        :param pulumi.Input[Mapping[str, Any]] environment_variables: The environment variable set for the function can get the value of the environment variable in the function. For more information, see Environment Variables.
        :param pulumi.Input[int] gpu_memory_size: The GPU memory specification of the function, in MB, is a multiple of 1024MB.
        :param pulumi.Input[int] initialization_timeout: max running time of initializer.
        :param pulumi.Input[str] initializer: initializer entry point of function.
        :param pulumi.Input[int] instance_concurrency: The maximum concurrency allowed for a single function instance.
        :param pulumi.Input['V2FunctionInstanceLifecycleConfigArgs'] instance_lifecycle_config: Instance lifecycle configuration. See `instance_lifecycle_config` below.
        :param pulumi.Input[str] instance_type: The instance type of the function. Valid values:
               - **e1**: Elastic instance.
               - **c1**: performance instance.
               - **fc.gpu.tesla.1**: the T4 card type of the Tesla series of GPU instances.
               - **fc.gpu.ampere.1**: The Ampere series A10 card type of the GPU instance.
               - **g1**: Same as **fc.gpu.tesla.1**.
        :param pulumi.Input[Sequence[pulumi.Input[str]]] layers: List of layers.
               > **NOTE:**  Multiple layers will be merged in the order of array subscripts from large to small, and the contents of layers with small subscripts will overwrite the files with the same name of layers with large subscripts.
        :param pulumi.Input[int] memory_size: memory size needed by function.
        :param pulumi.Input[int] timeout: max running time of function.
        """
        pulumi.set(__self__, "function_name", function_name)
        pulumi.set(__self__, "handler", handler)
        pulumi.set(__self__, "runtime", runtime)
        pulumi.set(__self__, "service_name", service_name)
        if ca_port is not None:
            pulumi.set(__self__, "ca_port", ca_port)
        if code is not None:
            pulumi.set(__self__, "code", code)
        if code_checksum is not None:
            pulumi.set(__self__, "code_checksum", code_checksum)
        if cpu is not None:
            pulumi.set(__self__, "cpu", cpu)
        if custom_container_config is not None:
            pulumi.set(__self__, "custom_container_config", custom_container_config)
        if custom_dns is not None:
            pulumi.set(__self__, "custom_dns", custom_dns)
        if custom_health_check_config is not None:
            pulumi.set(__self__, "custom_health_check_config", custom_health_check_config)
        if custom_runtime_config is not None:
            pulumi.set(__self__, "custom_runtime_config", custom_runtime_config)
        if description is not None:
            pulumi.set(__self__, "description", description)
        if disk_size is not None:
            pulumi.set(__self__, "disk_size", disk_size)
        if environment_variables is not None:
            pulumi.set(__self__, "environment_variables", environment_variables)
        if gpu_memory_size is not None:
            pulumi.set(__self__, "gpu_memory_size", gpu_memory_size)
        if initialization_timeout is not None:
            pulumi.set(__self__, "initialization_timeout", initialization_timeout)
        if initializer is not None:
            pulumi.set(__self__, "initializer", initializer)
        if instance_concurrency is not None:
            pulumi.set(__self__, "instance_concurrency", instance_concurrency)
        if instance_lifecycle_config is not None:
            pulumi.set(__self__, "instance_lifecycle_config", instance_lifecycle_config)
        if instance_type is not None:
            pulumi.set(__self__, "instance_type", instance_type)
        if layers is not None:
            pulumi.set(__self__, "layers", layers)
        if memory_size is not None:
            pulumi.set(__self__, "memory_size", memory_size)
        if timeout is not None:
            pulumi.set(__self__, "timeout", timeout)

    @property
    @pulumi.getter(name="functionName")
    def function_name(self) -> pulumi.Input[str]:
        """
        function name.
        """
        return pulumi.get(self, "function_name")

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

    @property
    @pulumi.getter
    def handler(self) -> pulumi.Input[str]:
        """
        entry point of function.
        """
        return pulumi.get(self, "handler")

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

    @property
    @pulumi.getter
    def runtime(self) -> pulumi.Input[str]:
        """
        runtime of function code.
        """
        return pulumi.get(self, "runtime")

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

    @property
    @pulumi.getter(name="serviceName")
    def service_name(self) -> pulumi.Input[str]:
        """
        The name of the function Service.
        """
        return pulumi.get(self, "service_name")

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

    @property
    @pulumi.getter(name="caPort")
    def ca_port(self) -> Optional[pulumi.Input[int]]:
        """
        The listening port of the HTTP Server when the Custom Runtime or Custom Container is running.
        """
        return pulumi.get(self, "ca_port")

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

    @property
    @pulumi.getter
    def code(self) -> Optional[pulumi.Input['V2FunctionCodeArgs']]:
        """
        Function Code ZIP package. code and customContainerConfig choose one. See `code` below.
        """
        return pulumi.get(self, "code")

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

    @property
    @pulumi.getter(name="codeChecksum")
    def code_checksum(self) -> Optional[pulumi.Input[str]]:
        """
        crc64 of function code.
        """
        return pulumi.get(self, "code_checksum")

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

    @property
    @pulumi.getter
    def cpu(self) -> Optional[pulumi.Input[float]]:
        """
        The CPU specification of the function. The unit is vCPU, which is a multiple of the 0.05 vCPU.
        """
        return pulumi.get(self, "cpu")

    @cpu.setter
    def cpu(self, value: Optional[pulumi.Input[float]]):
        pulumi.set(self, "cpu", value)

    @property
    @pulumi.getter(name="customContainerConfig")
    def custom_container_config(self) -> Optional[pulumi.Input['V2FunctionCustomContainerConfigArgs']]:
        """
        Custom-container runtime related function configuration. See `custom_container_config` below.
        """
        return pulumi.get(self, "custom_container_config")

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

    @property
    @pulumi.getter(name="customDns")
    def custom_dns(self) -> Optional[pulumi.Input['V2FunctionCustomDnsArgs']]:
        """
        Function custom DNS configuration. See `custom_dns` below.
        """
        return pulumi.get(self, "custom_dns")

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

    @property
    @pulumi.getter(name="customHealthCheckConfig")
    def custom_health_check_config(self) -> Optional[pulumi.Input['V2FunctionCustomHealthCheckConfigArgs']]:
        """
        Custom runtime/container Custom health check configuration. See `custom_health_check_config` below.
        """
        return pulumi.get(self, "custom_health_check_config")

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

    @property
    @pulumi.getter(name="customRuntimeConfig")
    def custom_runtime_config(self) -> Optional[pulumi.Input['V2FunctionCustomRuntimeConfigArgs']]:
        """
        Detailed configuration of Custom Runtime function. See `custom_runtime_config` below.
        """
        return pulumi.get(self, "custom_runtime_config")

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

    @property
    @pulumi.getter
    def description(self) -> Optional[pulumi.Input[str]]:
        """
        description of function.
        """
        return pulumi.get(self, "description")

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

    @property
    @pulumi.getter(name="diskSize")
    def disk_size(self) -> Optional[pulumi.Input[int]]:
        """
        The disk specification of the function. The unit is MB. The optional value is 512 MB or 10240MB.
        """
        return pulumi.get(self, "disk_size")

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

    @property
    @pulumi.getter(name="environmentVariables")
    def environment_variables(self) -> Optional[pulumi.Input[Mapping[str, Any]]]:
        """
        The environment variable set for the function can get the value of the environment variable in the function. For more information, see Environment Variables.
        """
        return pulumi.get(self, "environment_variables")

    @environment_variables.setter
    def environment_variables(self, value: Optional[pulumi.Input[Mapping[str, Any]]]):
        pulumi.set(self, "environment_variables", value)

    @property
    @pulumi.getter(name="gpuMemorySize")
    def gpu_memory_size(self) -> Optional[pulumi.Input[int]]:
        """
        The GPU memory specification of the function, in MB, is a multiple of 1024MB.
        """
        return pulumi.get(self, "gpu_memory_size")

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

    @property
    @pulumi.getter(name="initializationTimeout")
    def initialization_timeout(self) -> Optional[pulumi.Input[int]]:
        """
        max running time of initializer.
        """
        return pulumi.get(self, "initialization_timeout")

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

    @property
    @pulumi.getter
    def initializer(self) -> Optional[pulumi.Input[str]]:
        """
        initializer entry point of function.
        """
        return pulumi.get(self, "initializer")

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

    @property
    @pulumi.getter(name="instanceConcurrency")
    def instance_concurrency(self) -> Optional[pulumi.Input[int]]:
        """
        The maximum concurrency allowed for a single function instance.
        """
        return pulumi.get(self, "instance_concurrency")

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

    @property
    @pulumi.getter(name="instanceLifecycleConfig")
    def instance_lifecycle_config(self) -> Optional[pulumi.Input['V2FunctionInstanceLifecycleConfigArgs']]:
        """
        Instance lifecycle configuration. See `instance_lifecycle_config` below.
        """
        return pulumi.get(self, "instance_lifecycle_config")

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

    @property
    @pulumi.getter(name="instanceType")
    def instance_type(self) -> Optional[pulumi.Input[str]]:
        """
        The instance type of the function. Valid values:
        - **e1**: Elastic instance.
        - **c1**: performance instance.
        - **fc.gpu.tesla.1**: the T4 card type of the Tesla series of GPU instances.
        - **fc.gpu.ampere.1**: The Ampere series A10 card type of the GPU instance.
        - **g1**: Same as **fc.gpu.tesla.1**.
        """
        return pulumi.get(self, "instance_type")

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

    @property
    @pulumi.getter
    def layers(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:
        """
        List of layers.
        > **NOTE:**  Multiple layers will be merged in the order of array subscripts from large to small, and the contents of layers with small subscripts will overwrite the files with the same name of layers with large subscripts.
        """
        return pulumi.get(self, "layers")

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

    @property
    @pulumi.getter(name="memorySize")
    def memory_size(self) -> Optional[pulumi.Input[int]]:
        """
        memory size needed by function.
        """
        return pulumi.get(self, "memory_size")

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

    @property
    @pulumi.getter
    def timeout(self) -> Optional[pulumi.Input[int]]:
        """
        max running time of function.
        """
        return pulumi.get(self, "timeout")

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


@pulumi.input_type
class _V2FunctionState:
    def __init__(__self__, *,
                 ca_port: Optional[pulumi.Input[int]] = None,
                 code: Optional[pulumi.Input['V2FunctionCodeArgs']] = None,
                 code_checksum: Optional[pulumi.Input[str]] = None,
                 cpu: Optional[pulumi.Input[float]] = None,
                 create_time: Optional[pulumi.Input[str]] = None,
                 custom_container_config: Optional[pulumi.Input['V2FunctionCustomContainerConfigArgs']] = None,
                 custom_dns: Optional[pulumi.Input['V2FunctionCustomDnsArgs']] = None,
                 custom_health_check_config: Optional[pulumi.Input['V2FunctionCustomHealthCheckConfigArgs']] = None,
                 custom_runtime_config: Optional[pulumi.Input['V2FunctionCustomRuntimeConfigArgs']] = None,
                 description: Optional[pulumi.Input[str]] = None,
                 disk_size: Optional[pulumi.Input[int]] = None,
                 environment_variables: Optional[pulumi.Input[Mapping[str, Any]]] = None,
                 function_name: Optional[pulumi.Input[str]] = None,
                 gpu_memory_size: Optional[pulumi.Input[int]] = None,
                 handler: Optional[pulumi.Input[str]] = None,
                 initialization_timeout: Optional[pulumi.Input[int]] = None,
                 initializer: Optional[pulumi.Input[str]] = None,
                 instance_concurrency: Optional[pulumi.Input[int]] = None,
                 instance_lifecycle_config: Optional[pulumi.Input['V2FunctionInstanceLifecycleConfigArgs']] = None,
                 instance_type: Optional[pulumi.Input[str]] = None,
                 layers: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                 memory_size: Optional[pulumi.Input[int]] = None,
                 runtime: Optional[pulumi.Input[str]] = None,
                 service_name: Optional[pulumi.Input[str]] = None,
                 timeout: Optional[pulumi.Input[int]] = None):
        """
        Input properties used for looking up and filtering V2Function resources.
        :param pulumi.Input[int] ca_port: The listening port of the HTTP Server when the Custom Runtime or Custom Container is running.
        :param pulumi.Input['V2FunctionCodeArgs'] code: Function Code ZIP package. code and customContainerConfig choose one. See `code` below.
        :param pulumi.Input[str] code_checksum: crc64 of function code.
        :param pulumi.Input[float] cpu: The CPU specification of the function. The unit is vCPU, which is a multiple of the 0.05 vCPU.
        :param pulumi.Input[str] create_time: create time of function.
        :param pulumi.Input['V2FunctionCustomContainerConfigArgs'] custom_container_config: Custom-container runtime related function configuration. See `custom_container_config` below.
        :param pulumi.Input['V2FunctionCustomDnsArgs'] custom_dns: Function custom DNS configuration. See `custom_dns` below.
        :param pulumi.Input['V2FunctionCustomHealthCheckConfigArgs'] custom_health_check_config: Custom runtime/container Custom health check configuration. See `custom_health_check_config` below.
        :param pulumi.Input['V2FunctionCustomRuntimeConfigArgs'] custom_runtime_config: Detailed configuration of Custom Runtime function. See `custom_runtime_config` below.
        :param pulumi.Input[str] description: description of function.
        :param pulumi.Input[int] disk_size: The disk specification of the function. The unit is MB. The optional value is 512 MB or 10240MB.
        :param pulumi.Input[Mapping[str, Any]] environment_variables: The environment variable set for the function can get the value of the environment variable in the function. For more information, see Environment Variables.
        :param pulumi.Input[str] function_name: function name.
        :param pulumi.Input[int] gpu_memory_size: The GPU memory specification of the function, in MB, is a multiple of 1024MB.
        :param pulumi.Input[str] handler: entry point of function.
        :param pulumi.Input[int] initialization_timeout: max running time of initializer.
        :param pulumi.Input[str] initializer: initializer entry point of function.
        :param pulumi.Input[int] instance_concurrency: The maximum concurrency allowed for a single function instance.
        :param pulumi.Input['V2FunctionInstanceLifecycleConfigArgs'] instance_lifecycle_config: Instance lifecycle configuration. See `instance_lifecycle_config` below.
        :param pulumi.Input[str] instance_type: The instance type of the function. Valid values:
               - **e1**: Elastic instance.
               - **c1**: performance instance.
               - **fc.gpu.tesla.1**: the T4 card type of the Tesla series of GPU instances.
               - **fc.gpu.ampere.1**: The Ampere series A10 card type of the GPU instance.
               - **g1**: Same as **fc.gpu.tesla.1**.
        :param pulumi.Input[Sequence[pulumi.Input[str]]] layers: List of layers.
               > **NOTE:**  Multiple layers will be merged in the order of array subscripts from large to small, and the contents of layers with small subscripts will overwrite the files with the same name of layers with large subscripts.
        :param pulumi.Input[int] memory_size: memory size needed by function.
        :param pulumi.Input[str] runtime: runtime of function code.
        :param pulumi.Input[str] service_name: The name of the function Service.
        :param pulumi.Input[int] timeout: max running time of function.
        """
        if ca_port is not None:
            pulumi.set(__self__, "ca_port", ca_port)
        if code is not None:
            pulumi.set(__self__, "code", code)
        if code_checksum is not None:
            pulumi.set(__self__, "code_checksum", code_checksum)
        if cpu is not None:
            pulumi.set(__self__, "cpu", cpu)
        if create_time is not None:
            pulumi.set(__self__, "create_time", create_time)
        if custom_container_config is not None:
            pulumi.set(__self__, "custom_container_config", custom_container_config)
        if custom_dns is not None:
            pulumi.set(__self__, "custom_dns", custom_dns)
        if custom_health_check_config is not None:
            pulumi.set(__self__, "custom_health_check_config", custom_health_check_config)
        if custom_runtime_config is not None:
            pulumi.set(__self__, "custom_runtime_config", custom_runtime_config)
        if description is not None:
            pulumi.set(__self__, "description", description)
        if disk_size is not None:
            pulumi.set(__self__, "disk_size", disk_size)
        if environment_variables is not None:
            pulumi.set(__self__, "environment_variables", environment_variables)
        if function_name is not None:
            pulumi.set(__self__, "function_name", function_name)
        if gpu_memory_size is not None:
            pulumi.set(__self__, "gpu_memory_size", gpu_memory_size)
        if handler is not None:
            pulumi.set(__self__, "handler", handler)
        if initialization_timeout is not None:
            pulumi.set(__self__, "initialization_timeout", initialization_timeout)
        if initializer is not None:
            pulumi.set(__self__, "initializer", initializer)
        if instance_concurrency is not None:
            pulumi.set(__self__, "instance_concurrency", instance_concurrency)
        if instance_lifecycle_config is not None:
            pulumi.set(__self__, "instance_lifecycle_config", instance_lifecycle_config)
        if instance_type is not None:
            pulumi.set(__self__, "instance_type", instance_type)
        if layers is not None:
            pulumi.set(__self__, "layers", layers)
        if memory_size is not None:
            pulumi.set(__self__, "memory_size", memory_size)
        if runtime is not None:
            pulumi.set(__self__, "runtime", runtime)
        if service_name is not None:
            pulumi.set(__self__, "service_name", service_name)
        if timeout is not None:
            pulumi.set(__self__, "timeout", timeout)

    @property
    @pulumi.getter(name="caPort")
    def ca_port(self) -> Optional[pulumi.Input[int]]:
        """
        The listening port of the HTTP Server when the Custom Runtime or Custom Container is running.
        """
        return pulumi.get(self, "ca_port")

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

    @property
    @pulumi.getter
    def code(self) -> Optional[pulumi.Input['V2FunctionCodeArgs']]:
        """
        Function Code ZIP package. code and customContainerConfig choose one. See `code` below.
        """
        return pulumi.get(self, "code")

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

    @property
    @pulumi.getter(name="codeChecksum")
    def code_checksum(self) -> Optional[pulumi.Input[str]]:
        """
        crc64 of function code.
        """
        return pulumi.get(self, "code_checksum")

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

    @property
    @pulumi.getter
    def cpu(self) -> Optional[pulumi.Input[float]]:
        """
        The CPU specification of the function. The unit is vCPU, which is a multiple of the 0.05 vCPU.
        """
        return pulumi.get(self, "cpu")

    @cpu.setter
    def cpu(self, value: Optional[pulumi.Input[float]]):
        pulumi.set(self, "cpu", value)

    @property
    @pulumi.getter(name="createTime")
    def create_time(self) -> Optional[pulumi.Input[str]]:
        """
        create time of function.
        """
        return pulumi.get(self, "create_time")

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

    @property
    @pulumi.getter(name="customContainerConfig")
    def custom_container_config(self) -> Optional[pulumi.Input['V2FunctionCustomContainerConfigArgs']]:
        """
        Custom-container runtime related function configuration. See `custom_container_config` below.
        """
        return pulumi.get(self, "custom_container_config")

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

    @property
    @pulumi.getter(name="customDns")
    def custom_dns(self) -> Optional[pulumi.Input['V2FunctionCustomDnsArgs']]:
        """
        Function custom DNS configuration. See `custom_dns` below.
        """
        return pulumi.get(self, "custom_dns")

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

    @property
    @pulumi.getter(name="customHealthCheckConfig")
    def custom_health_check_config(self) -> Optional[pulumi.Input['V2FunctionCustomHealthCheckConfigArgs']]:
        """
        Custom runtime/container Custom health check configuration. See `custom_health_check_config` below.
        """
        return pulumi.get(self, "custom_health_check_config")

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

    @property
    @pulumi.getter(name="customRuntimeConfig")
    def custom_runtime_config(self) -> Optional[pulumi.Input['V2FunctionCustomRuntimeConfigArgs']]:
        """
        Detailed configuration of Custom Runtime function. See `custom_runtime_config` below.
        """
        return pulumi.get(self, "custom_runtime_config")

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

    @property
    @pulumi.getter
    def description(self) -> Optional[pulumi.Input[str]]:
        """
        description of function.
        """
        return pulumi.get(self, "description")

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

    @property
    @pulumi.getter(name="diskSize")
    def disk_size(self) -> Optional[pulumi.Input[int]]:
        """
        The disk specification of the function. The unit is MB. The optional value is 512 MB or 10240MB.
        """
        return pulumi.get(self, "disk_size")

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

    @property
    @pulumi.getter(name="environmentVariables")
    def environment_variables(self) -> Optional[pulumi.Input[Mapping[str, Any]]]:
        """
        The environment variable set for the function can get the value of the environment variable in the function. For more information, see Environment Variables.
        """
        return pulumi.get(self, "environment_variables")

    @environment_variables.setter
    def environment_variables(self, value: Optional[pulumi.Input[Mapping[str, Any]]]):
        pulumi.set(self, "environment_variables", value)

    @property
    @pulumi.getter(name="functionName")
    def function_name(self) -> Optional[pulumi.Input[str]]:
        """
        function name.
        """
        return pulumi.get(self, "function_name")

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

    @property
    @pulumi.getter(name="gpuMemorySize")
    def gpu_memory_size(self) -> Optional[pulumi.Input[int]]:
        """
        The GPU memory specification of the function, in MB, is a multiple of 1024MB.
        """
        return pulumi.get(self, "gpu_memory_size")

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

    @property
    @pulumi.getter
    def handler(self) -> Optional[pulumi.Input[str]]:
        """
        entry point of function.
        """
        return pulumi.get(self, "handler")

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

    @property
    @pulumi.getter(name="initializationTimeout")
    def initialization_timeout(self) -> Optional[pulumi.Input[int]]:
        """
        max running time of initializer.
        """
        return pulumi.get(self, "initialization_timeout")

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

    @property
    @pulumi.getter
    def initializer(self) -> Optional[pulumi.Input[str]]:
        """
        initializer entry point of function.
        """
        return pulumi.get(self, "initializer")

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

    @property
    @pulumi.getter(name="instanceConcurrency")
    def instance_concurrency(self) -> Optional[pulumi.Input[int]]:
        """
        The maximum concurrency allowed for a single function instance.
        """
        return pulumi.get(self, "instance_concurrency")

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

    @property
    @pulumi.getter(name="instanceLifecycleConfig")
    def instance_lifecycle_config(self) -> Optional[pulumi.Input['V2FunctionInstanceLifecycleConfigArgs']]:
        """
        Instance lifecycle configuration. See `instance_lifecycle_config` below.
        """
        return pulumi.get(self, "instance_lifecycle_config")

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

    @property
    @pulumi.getter(name="instanceType")
    def instance_type(self) -> Optional[pulumi.Input[str]]:
        """
        The instance type of the function. Valid values:
        - **e1**: Elastic instance.
        - **c1**: performance instance.
        - **fc.gpu.tesla.1**: the T4 card type of the Tesla series of GPU instances.
        - **fc.gpu.ampere.1**: The Ampere series A10 card type of the GPU instance.
        - **g1**: Same as **fc.gpu.tesla.1**.
        """
        return pulumi.get(self, "instance_type")

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

    @property
    @pulumi.getter
    def layers(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:
        """
        List of layers.
        > **NOTE:**  Multiple layers will be merged in the order of array subscripts from large to small, and the contents of layers with small subscripts will overwrite the files with the same name of layers with large subscripts.
        """
        return pulumi.get(self, "layers")

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

    @property
    @pulumi.getter(name="memorySize")
    def memory_size(self) -> Optional[pulumi.Input[int]]:
        """
        memory size needed by function.
        """
        return pulumi.get(self, "memory_size")

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

    @property
    @pulumi.getter
    def runtime(self) -> Optional[pulumi.Input[str]]:
        """
        runtime of function code.
        """
        return pulumi.get(self, "runtime")

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

    @property
    @pulumi.getter(name="serviceName")
    def service_name(self) -> Optional[pulumi.Input[str]]:
        """
        The name of the function Service.
        """
        return pulumi.get(self, "service_name")

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

    @property
    @pulumi.getter
    def timeout(self) -> Optional[pulumi.Input[int]]:
        """
        max running time of function.
        """
        return pulumi.get(self, "timeout")

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


class V2Function(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 ca_port: Optional[pulumi.Input[int]] = None,
                 code: Optional[pulumi.Input[pulumi.InputType['V2FunctionCodeArgs']]] = None,
                 code_checksum: Optional[pulumi.Input[str]] = None,
                 cpu: Optional[pulumi.Input[float]] = None,
                 custom_container_config: Optional[pulumi.Input[pulumi.InputType['V2FunctionCustomContainerConfigArgs']]] = None,
                 custom_dns: Optional[pulumi.Input[pulumi.InputType['V2FunctionCustomDnsArgs']]] = None,
                 custom_health_check_config: Optional[pulumi.Input[pulumi.InputType['V2FunctionCustomHealthCheckConfigArgs']]] = None,
                 custom_runtime_config: Optional[pulumi.Input[pulumi.InputType['V2FunctionCustomRuntimeConfigArgs']]] = None,
                 description: Optional[pulumi.Input[str]] = None,
                 disk_size: Optional[pulumi.Input[int]] = None,
                 environment_variables: Optional[pulumi.Input[Mapping[str, Any]]] = None,
                 function_name: Optional[pulumi.Input[str]] = None,
                 gpu_memory_size: Optional[pulumi.Input[int]] = None,
                 handler: Optional[pulumi.Input[str]] = None,
                 initialization_timeout: Optional[pulumi.Input[int]] = None,
                 initializer: Optional[pulumi.Input[str]] = None,
                 instance_concurrency: Optional[pulumi.Input[int]] = None,
                 instance_lifecycle_config: Optional[pulumi.Input[pulumi.InputType['V2FunctionInstanceLifecycleConfigArgs']]] = None,
                 instance_type: Optional[pulumi.Input[str]] = None,
                 layers: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                 memory_size: Optional[pulumi.Input[int]] = None,
                 runtime: Optional[pulumi.Input[str]] = None,
                 service_name: Optional[pulumi.Input[str]] = None,
                 timeout: Optional[pulumi.Input[int]] = None,
                 __props__=None):
        """
        Provides a FCV2 Function resource. Function is the unit of system scheduling and operation. Functions must be subordinate to services. All functions under the same service share some identical settings, such as service authorization and log configuration.

        For information about FCV2 Function and how to use it, see [What is Function](https://www.alibabacloud.com/help/en/resource-orchestration-service/latest/aliyun-fc-function).

        > **NOTE:** Available since v1.208.0.

        ## Example Usage

        Basic Usage

        ```python
        import pulumi
        import pulumi_alicloud as alicloud

        config = pulumi.Config()
        name = config.get("name")
        if name is None:
            name = "terraform-example"
        default_project = alicloud.log.Project("defaultProject", description=name)
        default_store = alicloud.log.Store("defaultStore",
            project=default_project.name,
            retention_period=3000,
            shard_count=1)
        default_role = alicloud.ram.Role("defaultRole",
            document=\"\"\"  {
              "Statement": [
                {
                  "Action": "sts:AssumeRole",
                  "Effect": "Allow",
                  "Principal": {
                    "Service": [
                      "fc.aliyuncs.com"
                    ]
                  }
                }
              ],
              "Version": "1"
          }
        \"\"\",
            description=name,
            force=True)
        default_role_policy_attachment = alicloud.ram.RolePolicyAttachment("defaultRolePolicyAttachment",
            role_name=default_role.name,
            policy_name="AliyunLogFullAccess",
            policy_type="System")
        default_service = alicloud.fc.Service("defaultService",
            description=name,
            log_config=alicloud.fc.ServiceLogConfigArgs(
                project=default_project.name,
                logstore=default_store.name,
            ),
            role=default_role.arn)
        default_v2_function = alicloud.fc.V2Function("defaultV2Function",
            function_name=name,
            memory_size=1024,
            runtime="custom.debian10",
            description=name,
            service_name=default_service.name,
            initializer="index.initializer",
            initialization_timeout=10,
            timeout=60,
            handler="index.handler",
            instance_type="e1",
            instance_lifecycle_config=alicloud.fc.V2FunctionInstanceLifecycleConfigArgs(
                pre_freeze=alicloud.fc.V2FunctionInstanceLifecycleConfigPreFreezeArgs(
                    handler="index.prefreeze",
                    timeout=30,
                ),
                pre_stop=alicloud.fc.V2FunctionInstanceLifecycleConfigPreStopArgs(
                    handler="index.prestop",
                    timeout=30,
                ),
            ),
            code=alicloud.fc.V2FunctionCodeArgs(
                oss_bucket_name="code-sample-cn-hangzhou",
                oss_object_name="quick-start-sample-codes/quick-start-sample-codes-nodejs/RocketMQ-producer-nodejs14-event/code.zip",
            ),
            custom_dns=alicloud.fc.V2FunctionCustomDnsArgs(
                name_servers=["223.5.5.5"],
                searches=["mydomain.com"],
                dns_options=[alicloud.fc.V2FunctionCustomDnsDnsOptionArgs(
                    name=name,
                    value="1",
                )],
            ),
            disk_size=512,
            instance_concurrency=10,
            layers=[
                "d3fc5de8d120687be2bfab761518d5de#Nodejs-Aliyun-SDK#2",
                "d3fc5de8d120687be2bfab761518d5de#Python39#2",
            ],
            cpu=1,
            custom_health_check_config=alicloud.fc.V2FunctionCustomHealthCheckConfigArgs(
                http_get_url="/healthcheck",
                initial_delay_seconds=3,
                period_seconds=3,
                timeout_seconds=3,
                failure_threshold=1,
                success_threshold=1,
            ),
            ca_port=9000,
            custom_runtime_config=alicloud.fc.V2FunctionCustomRuntimeConfigArgs(
                commands=["npm"],
                args=[
                    "run",
                    "start",
                ],
            ))
        ```

        ## Import

        FCV2 Function can be imported using the id, e.g.

        ```sh
         $ pulumi import alicloud:fc/v2Function:V2Function example <service_name>:<function_name>
        ```

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[int] ca_port: The listening port of the HTTP Server when the Custom Runtime or Custom Container is running.
        :param pulumi.Input[pulumi.InputType['V2FunctionCodeArgs']] code: Function Code ZIP package. code and customContainerConfig choose one. See `code` below.
        :param pulumi.Input[str] code_checksum: crc64 of function code.
        :param pulumi.Input[float] cpu: The CPU specification of the function. The unit is vCPU, which is a multiple of the 0.05 vCPU.
        :param pulumi.Input[pulumi.InputType['V2FunctionCustomContainerConfigArgs']] custom_container_config: Custom-container runtime related function configuration. See `custom_container_config` below.
        :param pulumi.Input[pulumi.InputType['V2FunctionCustomDnsArgs']] custom_dns: Function custom DNS configuration. See `custom_dns` below.
        :param pulumi.Input[pulumi.InputType['V2FunctionCustomHealthCheckConfigArgs']] custom_health_check_config: Custom runtime/container Custom health check configuration. See `custom_health_check_config` below.
        :param pulumi.Input[pulumi.InputType['V2FunctionCustomRuntimeConfigArgs']] custom_runtime_config: Detailed configuration of Custom Runtime function. See `custom_runtime_config` below.
        :param pulumi.Input[str] description: description of function.
        :param pulumi.Input[int] disk_size: The disk specification of the function. The unit is MB. The optional value is 512 MB or 10240MB.
        :param pulumi.Input[Mapping[str, Any]] environment_variables: The environment variable set for the function can get the value of the environment variable in the function. For more information, see Environment Variables.
        :param pulumi.Input[str] function_name: function name.
        :param pulumi.Input[int] gpu_memory_size: The GPU memory specification of the function, in MB, is a multiple of 1024MB.
        :param pulumi.Input[str] handler: entry point of function.
        :param pulumi.Input[int] initialization_timeout: max running time of initializer.
        :param pulumi.Input[str] initializer: initializer entry point of function.
        :param pulumi.Input[int] instance_concurrency: The maximum concurrency allowed for a single function instance.
        :param pulumi.Input[pulumi.InputType['V2FunctionInstanceLifecycleConfigArgs']] instance_lifecycle_config: Instance lifecycle configuration. See `instance_lifecycle_config` below.
        :param pulumi.Input[str] instance_type: The instance type of the function. Valid values:
               - **e1**: Elastic instance.
               - **c1**: performance instance.
               - **fc.gpu.tesla.1**: the T4 card type of the Tesla series of GPU instances.
               - **fc.gpu.ampere.1**: The Ampere series A10 card type of the GPU instance.
               - **g1**: Same as **fc.gpu.tesla.1**.
        :param pulumi.Input[Sequence[pulumi.Input[str]]] layers: List of layers.
               > **NOTE:**  Multiple layers will be merged in the order of array subscripts from large to small, and the contents of layers with small subscripts will overwrite the files with the same name of layers with large subscripts.
        :param pulumi.Input[int] memory_size: memory size needed by function.
        :param pulumi.Input[str] runtime: runtime of function code.
        :param pulumi.Input[str] service_name: The name of the function Service.
        :param pulumi.Input[int] timeout: max running time of function.
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: V2FunctionArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        Provides a FCV2 Function resource. Function is the unit of system scheduling and operation. Functions must be subordinate to services. All functions under the same service share some identical settings, such as service authorization and log configuration.

        For information about FCV2 Function and how to use it, see [What is Function](https://www.alibabacloud.com/help/en/resource-orchestration-service/latest/aliyun-fc-function).

        > **NOTE:** Available since v1.208.0.

        ## Example Usage

        Basic Usage

        ```python
        import pulumi
        import pulumi_alicloud as alicloud

        config = pulumi.Config()
        name = config.get("name")
        if name is None:
            name = "terraform-example"
        default_project = alicloud.log.Project("defaultProject", description=name)
        default_store = alicloud.log.Store("defaultStore",
            project=default_project.name,
            retention_period=3000,
            shard_count=1)
        default_role = alicloud.ram.Role("defaultRole",
            document=\"\"\"  {
              "Statement": [
                {
                  "Action": "sts:AssumeRole",
                  "Effect": "Allow",
                  "Principal": {
                    "Service": [
                      "fc.aliyuncs.com"
                    ]
                  }
                }
              ],
              "Version": "1"
          }
        \"\"\",
            description=name,
            force=True)
        default_role_policy_attachment = alicloud.ram.RolePolicyAttachment("defaultRolePolicyAttachment",
            role_name=default_role.name,
            policy_name="AliyunLogFullAccess",
            policy_type="System")
        default_service = alicloud.fc.Service("defaultService",
            description=name,
            log_config=alicloud.fc.ServiceLogConfigArgs(
                project=default_project.name,
                logstore=default_store.name,
            ),
            role=default_role.arn)
        default_v2_function = alicloud.fc.V2Function("defaultV2Function",
            function_name=name,
            memory_size=1024,
            runtime="custom.debian10",
            description=name,
            service_name=default_service.name,
            initializer="index.initializer",
            initialization_timeout=10,
            timeout=60,
            handler="index.handler",
            instance_type="e1",
            instance_lifecycle_config=alicloud.fc.V2FunctionInstanceLifecycleConfigArgs(
                pre_freeze=alicloud.fc.V2FunctionInstanceLifecycleConfigPreFreezeArgs(
                    handler="index.prefreeze",
                    timeout=30,
                ),
                pre_stop=alicloud.fc.V2FunctionInstanceLifecycleConfigPreStopArgs(
                    handler="index.prestop",
                    timeout=30,
                ),
            ),
            code=alicloud.fc.V2FunctionCodeArgs(
                oss_bucket_name="code-sample-cn-hangzhou",
                oss_object_name="quick-start-sample-codes/quick-start-sample-codes-nodejs/RocketMQ-producer-nodejs14-event/code.zip",
            ),
            custom_dns=alicloud.fc.V2FunctionCustomDnsArgs(
                name_servers=["223.5.5.5"],
                searches=["mydomain.com"],
                dns_options=[alicloud.fc.V2FunctionCustomDnsDnsOptionArgs(
                    name=name,
                    value="1",
                )],
            ),
            disk_size=512,
            instance_concurrency=10,
            layers=[
                "d3fc5de8d120687be2bfab761518d5de#Nodejs-Aliyun-SDK#2",
                "d3fc5de8d120687be2bfab761518d5de#Python39#2",
            ],
            cpu=1,
            custom_health_check_config=alicloud.fc.V2FunctionCustomHealthCheckConfigArgs(
                http_get_url="/healthcheck",
                initial_delay_seconds=3,
                period_seconds=3,
                timeout_seconds=3,
                failure_threshold=1,
                success_threshold=1,
            ),
            ca_port=9000,
            custom_runtime_config=alicloud.fc.V2FunctionCustomRuntimeConfigArgs(
                commands=["npm"],
                args=[
                    "run",
                    "start",
                ],
            ))
        ```

        ## Import

        FCV2 Function can be imported using the id, e.g.

        ```sh
         $ pulumi import alicloud:fc/v2Function:V2Function example <service_name>:<function_name>
        ```

        :param str resource_name: The name of the resource.
        :param V2FunctionArgs 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(V2FunctionArgs, 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,
                 ca_port: Optional[pulumi.Input[int]] = None,
                 code: Optional[pulumi.Input[pulumi.InputType['V2FunctionCodeArgs']]] = None,
                 code_checksum: Optional[pulumi.Input[str]] = None,
                 cpu: Optional[pulumi.Input[float]] = None,
                 custom_container_config: Optional[pulumi.Input[pulumi.InputType['V2FunctionCustomContainerConfigArgs']]] = None,
                 custom_dns: Optional[pulumi.Input[pulumi.InputType['V2FunctionCustomDnsArgs']]] = None,
                 custom_health_check_config: Optional[pulumi.Input[pulumi.InputType['V2FunctionCustomHealthCheckConfigArgs']]] = None,
                 custom_runtime_config: Optional[pulumi.Input[pulumi.InputType['V2FunctionCustomRuntimeConfigArgs']]] = None,
                 description: Optional[pulumi.Input[str]] = None,
                 disk_size: Optional[pulumi.Input[int]] = None,
                 environment_variables: Optional[pulumi.Input[Mapping[str, Any]]] = None,
                 function_name: Optional[pulumi.Input[str]] = None,
                 gpu_memory_size: Optional[pulumi.Input[int]] = None,
                 handler: Optional[pulumi.Input[str]] = None,
                 initialization_timeout: Optional[pulumi.Input[int]] = None,
                 initializer: Optional[pulumi.Input[str]] = None,
                 instance_concurrency: Optional[pulumi.Input[int]] = None,
                 instance_lifecycle_config: Optional[pulumi.Input[pulumi.InputType['V2FunctionInstanceLifecycleConfigArgs']]] = None,
                 instance_type: Optional[pulumi.Input[str]] = None,
                 layers: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                 memory_size: Optional[pulumi.Input[int]] = None,
                 runtime: Optional[pulumi.Input[str]] = None,
                 service_name: Optional[pulumi.Input[str]] = None,
                 timeout: Optional[pulumi.Input[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__ = V2FunctionArgs.__new__(V2FunctionArgs)

            __props__.__dict__["ca_port"] = ca_port
            __props__.__dict__["code"] = code
            __props__.__dict__["code_checksum"] = code_checksum
            __props__.__dict__["cpu"] = cpu
            __props__.__dict__["custom_container_config"] = custom_container_config
            __props__.__dict__["custom_dns"] = custom_dns
            __props__.__dict__["custom_health_check_config"] = custom_health_check_config
            __props__.__dict__["custom_runtime_config"] = custom_runtime_config
            __props__.__dict__["description"] = description
            __props__.__dict__["disk_size"] = disk_size
            __props__.__dict__["environment_variables"] = environment_variables
            if function_name is None and not opts.urn:
                raise TypeError("Missing required property 'function_name'")
            __props__.__dict__["function_name"] = function_name
            __props__.__dict__["gpu_memory_size"] = gpu_memory_size
            if handler is None and not opts.urn:
                raise TypeError("Missing required property 'handler'")
            __props__.__dict__["handler"] = handler
            __props__.__dict__["initialization_timeout"] = initialization_timeout
            __props__.__dict__["initializer"] = initializer
            __props__.__dict__["instance_concurrency"] = instance_concurrency
            __props__.__dict__["instance_lifecycle_config"] = instance_lifecycle_config
            __props__.__dict__["instance_type"] = instance_type
            __props__.__dict__["layers"] = layers
            __props__.__dict__["memory_size"] = memory_size
            if runtime is None and not opts.urn:
                raise TypeError("Missing required property 'runtime'")
            __props__.__dict__["runtime"] = runtime
            if service_name is None and not opts.urn:
                raise TypeError("Missing required property 'service_name'")
            __props__.__dict__["service_name"] = service_name
            __props__.__dict__["timeout"] = timeout
            __props__.__dict__["create_time"] = None
        super(V2Function, __self__).__init__(
            'alicloud:fc/v2Function:V2Function',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            ca_port: Optional[pulumi.Input[int]] = None,
            code: Optional[pulumi.Input[pulumi.InputType['V2FunctionCodeArgs']]] = None,
            code_checksum: Optional[pulumi.Input[str]] = None,
            cpu: Optional[pulumi.Input[float]] = None,
            create_time: Optional[pulumi.Input[str]] = None,
            custom_container_config: Optional[pulumi.Input[pulumi.InputType['V2FunctionCustomContainerConfigArgs']]] = None,
            custom_dns: Optional[pulumi.Input[pulumi.InputType['V2FunctionCustomDnsArgs']]] = None,
            custom_health_check_config: Optional[pulumi.Input[pulumi.InputType['V2FunctionCustomHealthCheckConfigArgs']]] = None,
            custom_runtime_config: Optional[pulumi.Input[pulumi.InputType['V2FunctionCustomRuntimeConfigArgs']]] = None,
            description: Optional[pulumi.Input[str]] = None,
            disk_size: Optional[pulumi.Input[int]] = None,
            environment_variables: Optional[pulumi.Input[Mapping[str, Any]]] = None,
            function_name: Optional[pulumi.Input[str]] = None,
            gpu_memory_size: Optional[pulumi.Input[int]] = None,
            handler: Optional[pulumi.Input[str]] = None,
            initialization_timeout: Optional[pulumi.Input[int]] = None,
            initializer: Optional[pulumi.Input[str]] = None,
            instance_concurrency: Optional[pulumi.Input[int]] = None,
            instance_lifecycle_config: Optional[pulumi.Input[pulumi.InputType['V2FunctionInstanceLifecycleConfigArgs']]] = None,
            instance_type: Optional[pulumi.Input[str]] = None,
            layers: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
            memory_size: Optional[pulumi.Input[int]] = None,
            runtime: Optional[pulumi.Input[str]] = None,
            service_name: Optional[pulumi.Input[str]] = None,
            timeout: Optional[pulumi.Input[int]] = None) -> 'V2Function':
        """
        Get an existing V2Function 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[int] ca_port: The listening port of the HTTP Server when the Custom Runtime or Custom Container is running.
        :param pulumi.Input[pulumi.InputType['V2FunctionCodeArgs']] code: Function Code ZIP package. code and customContainerConfig choose one. See `code` below.
        :param pulumi.Input[str] code_checksum: crc64 of function code.
        :param pulumi.Input[float] cpu: The CPU specification of the function. The unit is vCPU, which is a multiple of the 0.05 vCPU.
        :param pulumi.Input[str] create_time: create time of function.
        :param pulumi.Input[pulumi.InputType['V2FunctionCustomContainerConfigArgs']] custom_container_config: Custom-container runtime related function configuration. See `custom_container_config` below.
        :param pulumi.Input[pulumi.InputType['V2FunctionCustomDnsArgs']] custom_dns: Function custom DNS configuration. See `custom_dns` below.
        :param pulumi.Input[pulumi.InputType['V2FunctionCustomHealthCheckConfigArgs']] custom_health_check_config: Custom runtime/container Custom health check configuration. See `custom_health_check_config` below.
        :param pulumi.Input[pulumi.InputType['V2FunctionCustomRuntimeConfigArgs']] custom_runtime_config: Detailed configuration of Custom Runtime function. See `custom_runtime_config` below.
        :param pulumi.Input[str] description: description of function.
        :param pulumi.Input[int] disk_size: The disk specification of the function. The unit is MB. The optional value is 512 MB or 10240MB.
        :param pulumi.Input[Mapping[str, Any]] environment_variables: The environment variable set for the function can get the value of the environment variable in the function. For more information, see Environment Variables.
        :param pulumi.Input[str] function_name: function name.
        :param pulumi.Input[int] gpu_memory_size: The GPU memory specification of the function, in MB, is a multiple of 1024MB.
        :param pulumi.Input[str] handler: entry point of function.
        :param pulumi.Input[int] initialization_timeout: max running time of initializer.
        :param pulumi.Input[str] initializer: initializer entry point of function.
        :param pulumi.Input[int] instance_concurrency: The maximum concurrency allowed for a single function instance.
        :param pulumi.Input[pulumi.InputType['V2FunctionInstanceLifecycleConfigArgs']] instance_lifecycle_config: Instance lifecycle configuration. See `instance_lifecycle_config` below.
        :param pulumi.Input[str] instance_type: The instance type of the function. Valid values:
               - **e1**: Elastic instance.
               - **c1**: performance instance.
               - **fc.gpu.tesla.1**: the T4 card type of the Tesla series of GPU instances.
               - **fc.gpu.ampere.1**: The Ampere series A10 card type of the GPU instance.
               - **g1**: Same as **fc.gpu.tesla.1**.
        :param pulumi.Input[Sequence[pulumi.Input[str]]] layers: List of layers.
               > **NOTE:**  Multiple layers will be merged in the order of array subscripts from large to small, and the contents of layers with small subscripts will overwrite the files with the same name of layers with large subscripts.
        :param pulumi.Input[int] memory_size: memory size needed by function.
        :param pulumi.Input[str] runtime: runtime of function code.
        :param pulumi.Input[str] service_name: The name of the function Service.
        :param pulumi.Input[int] timeout: max running time of function.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = _V2FunctionState.__new__(_V2FunctionState)

        __props__.__dict__["ca_port"] = ca_port
        __props__.__dict__["code"] = code
        __props__.__dict__["code_checksum"] = code_checksum
        __props__.__dict__["cpu"] = cpu
        __props__.__dict__["create_time"] = create_time
        __props__.__dict__["custom_container_config"] = custom_container_config
        __props__.__dict__["custom_dns"] = custom_dns
        __props__.__dict__["custom_health_check_config"] = custom_health_check_config
        __props__.__dict__["custom_runtime_config"] = custom_runtime_config
        __props__.__dict__["description"] = description
        __props__.__dict__["disk_size"] = disk_size
        __props__.__dict__["environment_variables"] = environment_variables
        __props__.__dict__["function_name"] = function_name
        __props__.__dict__["gpu_memory_size"] = gpu_memory_size
        __props__.__dict__["handler"] = handler
        __props__.__dict__["initialization_timeout"] = initialization_timeout
        __props__.__dict__["initializer"] = initializer
        __props__.__dict__["instance_concurrency"] = instance_concurrency
        __props__.__dict__["instance_lifecycle_config"] = instance_lifecycle_config
        __props__.__dict__["instance_type"] = instance_type
        __props__.__dict__["layers"] = layers
        __props__.__dict__["memory_size"] = memory_size
        __props__.__dict__["runtime"] = runtime
        __props__.__dict__["service_name"] = service_name
        __props__.__dict__["timeout"] = timeout
        return V2Function(resource_name, opts=opts, __props__=__props__)

    @property
    @pulumi.getter(name="caPort")
    def ca_port(self) -> pulumi.Output[int]:
        """
        The listening port of the HTTP Server when the Custom Runtime or Custom Container is running.
        """
        return pulumi.get(self, "ca_port")

    @property
    @pulumi.getter
    def code(self) -> pulumi.Output[Optional['outputs.V2FunctionCode']]:
        """
        Function Code ZIP package. code and customContainerConfig choose one. See `code` below.
        """
        return pulumi.get(self, "code")

    @property
    @pulumi.getter(name="codeChecksum")
    def code_checksum(self) -> pulumi.Output[str]:
        """
        crc64 of function code.
        """
        return pulumi.get(self, "code_checksum")

    @property
    @pulumi.getter
    def cpu(self) -> pulumi.Output[Optional[float]]:
        """
        The CPU specification of the function. The unit is vCPU, which is a multiple of the 0.05 vCPU.
        """
        return pulumi.get(self, "cpu")

    @property
    @pulumi.getter(name="createTime")
    def create_time(self) -> pulumi.Output[str]:
        """
        create time of function.
        """
        return pulumi.get(self, "create_time")

    @property
    @pulumi.getter(name="customContainerConfig")
    def custom_container_config(self) -> pulumi.Output[Optional['outputs.V2FunctionCustomContainerConfig']]:
        """
        Custom-container runtime related function configuration. See `custom_container_config` below.
        """
        return pulumi.get(self, "custom_container_config")

    @property
    @pulumi.getter(name="customDns")
    def custom_dns(self) -> pulumi.Output[Optional['outputs.V2FunctionCustomDns']]:
        """
        Function custom DNS configuration. See `custom_dns` below.
        """
        return pulumi.get(self, "custom_dns")

    @property
    @pulumi.getter(name="customHealthCheckConfig")
    def custom_health_check_config(self) -> pulumi.Output[Optional['outputs.V2FunctionCustomHealthCheckConfig']]:
        """
        Custom runtime/container Custom health check configuration. See `custom_health_check_config` below.
        """
        return pulumi.get(self, "custom_health_check_config")

    @property
    @pulumi.getter(name="customRuntimeConfig")
    def custom_runtime_config(self) -> pulumi.Output[Optional['outputs.V2FunctionCustomRuntimeConfig']]:
        """
        Detailed configuration of Custom Runtime function. See `custom_runtime_config` below.
        """
        return pulumi.get(self, "custom_runtime_config")

    @property
    @pulumi.getter
    def description(self) -> pulumi.Output[Optional[str]]:
        """
        description of function.
        """
        return pulumi.get(self, "description")

    @property
    @pulumi.getter(name="diskSize")
    def disk_size(self) -> pulumi.Output[Optional[int]]:
        """
        The disk specification of the function. The unit is MB. The optional value is 512 MB or 10240MB.
        """
        return pulumi.get(self, "disk_size")

    @property
    @pulumi.getter(name="environmentVariables")
    def environment_variables(self) -> pulumi.Output[Optional[Mapping[str, Any]]]:
        """
        The environment variable set for the function can get the value of the environment variable in the function. For more information, see Environment Variables.
        """
        return pulumi.get(self, "environment_variables")

    @property
    @pulumi.getter(name="functionName")
    def function_name(self) -> pulumi.Output[str]:
        """
        function name.
        """
        return pulumi.get(self, "function_name")

    @property
    @pulumi.getter(name="gpuMemorySize")
    def gpu_memory_size(self) -> pulumi.Output[Optional[int]]:
        """
        The GPU memory specification of the function, in MB, is a multiple of 1024MB.
        """
        return pulumi.get(self, "gpu_memory_size")

    @property
    @pulumi.getter
    def handler(self) -> pulumi.Output[str]:
        """
        entry point of function.
        """
        return pulumi.get(self, "handler")

    @property
    @pulumi.getter(name="initializationTimeout")
    def initialization_timeout(self) -> pulumi.Output[int]:
        """
        max running time of initializer.
        """
        return pulumi.get(self, "initialization_timeout")

    @property
    @pulumi.getter
    def initializer(self) -> pulumi.Output[Optional[str]]:
        """
        initializer entry point of function.
        """
        return pulumi.get(self, "initializer")

    @property
    @pulumi.getter(name="instanceConcurrency")
    def instance_concurrency(self) -> pulumi.Output[int]:
        """
        The maximum concurrency allowed for a single function instance.
        """
        return pulumi.get(self, "instance_concurrency")

    @property
    @pulumi.getter(name="instanceLifecycleConfig")
    def instance_lifecycle_config(self) -> pulumi.Output[Optional['outputs.V2FunctionInstanceLifecycleConfig']]:
        """
        Instance lifecycle configuration. See `instance_lifecycle_config` below.
        """
        return pulumi.get(self, "instance_lifecycle_config")

    @property
    @pulumi.getter(name="instanceType")
    def instance_type(self) -> pulumi.Output[str]:
        """
        The instance type of the function. Valid values:
        - **e1**: Elastic instance.
        - **c1**: performance instance.
        - **fc.gpu.tesla.1**: the T4 card type of the Tesla series of GPU instances.
        - **fc.gpu.ampere.1**: The Ampere series A10 card type of the GPU instance.
        - **g1**: Same as **fc.gpu.tesla.1**.
        """
        return pulumi.get(self, "instance_type")

    @property
    @pulumi.getter
    def layers(self) -> pulumi.Output[Optional[Sequence[str]]]:
        """
        List of layers.
        > **NOTE:**  Multiple layers will be merged in the order of array subscripts from large to small, and the contents of layers with small subscripts will overwrite the files with the same name of layers with large subscripts.
        """
        return pulumi.get(self, "layers")

    @property
    @pulumi.getter(name="memorySize")
    def memory_size(self) -> pulumi.Output[int]:
        """
        memory size needed by function.
        """
        return pulumi.get(self, "memory_size")

    @property
    @pulumi.getter
    def runtime(self) -> pulumi.Output[str]:
        """
        runtime of function code.
        """
        return pulumi.get(self, "runtime")

    @property
    @pulumi.getter(name="serviceName")
    def service_name(self) -> pulumi.Output[str]:
        """
        The name of the function Service.
        """
        return pulumi.get(self, "service_name")

    @property
    @pulumi.getter
    def timeout(self) -> pulumi.Output[int]:
        """
        max running time of function.
        """
        return pulumi.get(self, "timeout")

