DATASOURCE::FC::Functions

更新时间:
复制 MD 格式

Queries a list of functions in Function Compute (FC).

Syntax

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

Properties

Parameter

Type

Required

Update allowed

Description

Constraints

ServiceName

String

Yes

Yes

The service name.

None

Qualifier

String

No

Yes

The service version or alias.

None

Prefix

String

No

Yes

The prefix used to filter function names.

Returns only functions whose names start with this prefix.

RefreshOptions

String

No

Yes

The refresh policy for the data source when the stack is updated.

Valid values:

  • Never (Default): The data source is not refreshed during stack updates.

  • Always: The data source is always refreshed during stack updates.

Return values

  • Functions: The list of functions.

  • FunctionNames: The list of function names.

Parameter

Type

Description

Constraints

FunctionNames

List

The list of function names.

None

Functions

List

The list of functions.

None

FunctionName

String

The function name.

None

FunctionId

String

The function ID.

Globally unique.

Description

String

The function description.

None

Runtime

String

The function runtime environment.

Supported runtimes includeNode.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, andCustom Container.

For more information about the runtimes supported by Function Compute, see Manage functions.

Handler

String

The function handler.

The format varies by programming language.

For more information, see Handler.

Timeout

Number

The execution timeout of the function, in seconds.

Valid values: 1 to 86400.

Default: 60.

The function execution is terminated if it exceeds this timeout.

Initializer

String

The initializer hook handler.

The format varies by programming language.

For more information, see Initializer hook.

InitializationTimeout

Number

The timeout for initializer hook execution, in seconds.

Valid values: 1 to 300.

Default: 3.

The initializer hook execution is terminated if it exceeds this timeout.

CodeSize

Number

The size of the function code package, in bytes.

None

CodeChecksum

String

The CRC-64 checksum of the function code package.

None

MemorySize

Number

The memory allocated to the function, in MB.

Must be a multiple of 64.

Supported memory sizes vary by instance type.

For more information, see Instance specifications.

GpuMemorySize

Number

The virtual GPU memory size.

None

EnvironmentVariables

Map

The environment variables of the function.

Accessible from within the function code.

For more information, see Environment variables.

CreatedTime

String

The time when the function was created.

None

LastModifiedTime

String

The time when the function was last modified.

None

InstanceConcurrency

Number

The concurrency limit per function instance.

None

InstanceSoftConcurrency

Number

The soft concurrency limit per function instance.

None

CustomContainerConfig

Map

The Custom Container runtime configuration.

Allows you to use a custom container image to run the function. For more information, see CustomContainerConfig.

CaPort

Number

The HTTP server listening port in a Custom Runtime or Custom Container runtime.

None

InstanceType

String

The instance type.

None

Layers

Map

The layer configurations of the function.

For more information, see Layer.

InstanceLifecycleConfig

Map

The instance lifecycle hook configuration.

For more information, see InstanceLifecycleConfig.

CustomDNS

Map

The custom DNS configuration of the function.

For more information, see CustomDNS.

CustomRuntimeConfig

Map

The Custom Runtime configuration.

For more information, see CustomRuntimeConfig.

Examples

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