DATASOURCE::FC::Functions

更新时间:
复制 MD 格式

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

语法

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

属性

属性名称

类型

必须

允许更新

描述

约束

ServiceName

String

是

是

服务的名称。

无

Qualifier

String

否

是

服务的版本或别名。

无

Prefix

String

否

是

资源名称。

必须以Prefix作为前缀。

RefreshOptions

String

否

是

当资源栈更新时,数据源资源的刷新策略。

有效值:

  • Never(默认值):更新堆栈时,从不刷新数据源资源。

  • Always:更新堆栈时,始终刷新数据源资源。

返回数据(Fn::GetAtt)

  • Functions:函数详情列表。

  • FunctionNames:函数的名称列表。

属性名称

类型

描述

约束

FunctionNames

List

函数的名称列表。

无

Functions

List

函数详情列表。

无

FunctionName

String

函数的名称。

无

FunctionId

String

函数ID。

全网唯一。

Description

String

函数的描述。

无

Runtime

String

函数运行的语言环境。

当前支持Node.js 6.x、Node.js 8.x、Node.js 10.x、Node.js 12.x、Node.js 14.x、Python 3、Java 8、Java 11、PHP 7.2、.NET Core 2.1、Go 1.x、Custom Runtime和Custom 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。

示例

{
  "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"
        ]
      }
    }
  }
}
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