DATASOURCE::FC::Functions类型用于获取函数列表。

语法

{
  "Type": "DATASOURCE::FC::Functions",
  "Properties": {
    "ServiceName": String,
    "Qualifier": String,
    "Prefix": String
  }
}

属性

属性名称 类型 必须 允许更新 描述 约束
ServiceName String 服务的名称。
Qualifier String 服务的版本或别名。
Prefix String 资源名称。 必须以Prefix作为前缀。

返回数据(Fn::GetAtt)

  • Functions:函数详情列表。
  • FunctionNames:函数的名称列表。
属性名称 类型 描述 约束
FunctionNames List 函数的名称列表。
Functions List 函数详情列表。
FunctionName String 函数的名称。
FunctionId String 函数ID。 全网唯一。
Description String 函数的描述。
Runtime String 函数运行的语言环境。 当前支持Node.js 6.xNode.js 8.xNode.js 10.xNode.js 12.xNode.js 14.xPython 2.7Python 3Java 8Java 11PHP 7.2.NET Core 2.1Go 1.xCustom RuntimeCustom Container

关于函数计算支持的运行环境,请参见支持的函数运行环境列表

Handler String 函数执行的入口。 具体格式和语言相关。

更多信息,请参见函数入口

Timeout Number 函数运行的超时时间。 取值范围:1~86400。

默认值为60秒。

单位为秒。

如果函数运行超过设置的时间,则函数运行将被终止。

Initializer String 初始化函数执行的入口。 具体格式与语言相关。

更多信息,请参见Initializer函数

InitializationTimeout Number 初始化函数运行的超时时间。 取值范围:1~300。

默认值为3秒。

单位为秒。

如果函数初始化超过设置的时间,函数初始化将被终止。

CodeSize Number 函数代码包的大小。 单位:Byte。
CodeChecksum String 函数代码包的CRC-64值。
MemorySize Number 函数的内存规格。 单位为MB。

内存大小为64 MB的倍数。

函数实例类型不同,内存规格不同。

更多信息,请参见实例规格
GpuMemorySize Number GPU虚拟内存。
EnvironmentVariables Map 函数设置的环境变量。 可以在函数中获取环境变量的值。

更多信息,请参见环境变量

CreatedTime String 函数的创建时间。
LastModifiedTime String 函数上一次被更新的时间。
InstanceConcurrency Number 单实例并发数。
InstanceSoftConcurrency Number 多实例并发数。
CustomContainerConfig Map Custom Container运行时的相关配置。 配置CustomContainerConfig后,可以使用自定义容器镜像执行函数。
CaPort Number Custom Runtime或Custom Container运行时HTTP Server的监听端口。
InstanceType String 实例规格。
Layers Map 层信息。 更多信息,请参见Layer
InstanceLifecycleConfig Map 实例生命周期函数配置。 更多信息,请参见InstanceLifecycleConfig
CustomDNS Map 函数自定义DNS配置。 更多信息,请参见CustomDNS
CustomRuntimeConfig Map Custom Runtime函数详细配置。 更多信息,请参见CustomRuntimeConfig

示例

  • JSON格式

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Parameters": {
        "ServiceName": {
          "Type": "String",
          "Description": "Service name."
        }
      },
      "Resources": {
        "Functions": {
          "Type": "DATASOURCE::FC::Functions",
          "Properties": {
            "ServiceName": {
              "Ref": "ServiceName"
            }
          }
        }
      },
      "Outputs": {
        "Functions": {
          "Description": "The list of functions.",
          "Value": {
            "Fn::GetAtt": [
              "Functions",
              "Functions"
            ]
          }
        },
        "FunctionNames": {
          "Description": "The list of function names.",
          "Value": {
            "Fn::GetAtt": [
              "Functions",
              "FunctionNames"
            ]
          }
        }
      }
    }
  • YAML格式

    ROSTemplateFormatVersion: '2015-09-01'
    Parameters:
      ServiceName:
        Type: String
        Description: Service name.
    Resources:
      Functions:
        Type: DATASOURCE::FC::Functions
        Properties:
          ServiceName:
            Ref: ServiceName
    Outputs:
      Functions:
        Description: The list of functions.
        Value:
          Fn::GetAtt:
            - Functions
            - Functions
      FunctionNames:
        Description: The list of function names.
        Value:
          Fn::GetAtt:
            - Functions
            - FunctionNames