DATASOURCE::FC::Services类型用于获取服务列表。

语法

{
  "Type": "DATASOURCE::FC::Services",
  "Properties": {
    "Prefix": String
  }
}

属性

属性名称 类型 必须 允许更新 描述 约束
Prefix String 资源名称。 名称必须以Prefix作为前缀。

例如:Prefix是a,则返回的资源名均是以a开始的。

返回数据(Fn::GetAtt)

  • Services:服务详情列表。
  • ServiceNames:服务名称列表。
属性名称 类型 描述 约束
ServiceNames List 服务名称列表。
Services List 服务详情列表。
ServiceName String 服务的名称。
Description String 服务的描述。
LogConfig Map 日志配置。 函数产生的日志会被写入配置的LogConfig中。
ServiceId String 服务ID。
CreatedTime String 服务的创建时间。
LastModifiedTime String 服务上一次被更新的时间。
VpcConfig Map VPC配置。 配置VPCConfig后,函数可以访问指定的VPC资源。
InternetAccess Boolean 是否允许函数访问公网。 取值:
  • true:允许函数访问公网。
  • false:不允许函数访问公网。
NasConfig Map NAS配置。 配置NASConfig后,函数可以访问指定的NAS资源。
VendorConfig Map Vendor配置。
TracingConfig Map 链路追踪配置。 当函数计算与链路追踪TracingConfig集成后,您可以记录请求在函数计算的耗时时间、查看函数的冷启动时间、记录函数内部时间的消耗等。

更多信息,请参见链路追踪简介

示例

  • JSON格式

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Parameters": {
        "Prefix": {
          "Type": "String",
          "Description": "Qualified returned service names must be prefixed with Prefix. For example, if the Prefix is \"a\", the returned service names should be started with \"a\"."
        }
      },
      "Resources": {
        "Services": {
          "Type": "DATASOURCE::FC::Services",
          "Properties": {
            "Prefix": {
              "Ref": "Prefix"
            }
          }
        }
      },
      "Outputs": {
        "Services": {
          "Description": "The list of services.",
          "Value": {
            "Fn::GetAtt": [
              "Services",
              "Services"
            ]
          }
        },
        "ServiceNames": {
          "Description": "The list of service names.",
          "Value": {
            "Fn::GetAtt": [
              "Services",
              "ServiceNames"
            ]
          }
        }
      }
    }
  • YAML格式

    ROSTemplateFormatVersion: '2015-09-01'
    Parameters:
      Prefix:
        Type: String
        Description: Qualified returned service names must be prefixed with Prefix. For example, if the Prefix is "a", the returned service names should be started with "a".
    Resources:
      Services:
        Type: DATASOURCE::FC::Services
        Properties:
          Prefix:
            Ref: Prefix
    Outputs:
      Services:
        Description: The list of services.
        Value:
          Fn::GetAtt:
            - Services
            - Services
      ServiceNames:
        Description: The list of service names.
        Value:
          Fn::GetAtt:
            - Services
            - ServiceNames