全部产品
Search
文档中心

资源编排:ALIYUN::FC3::Trigger

更新时间:Dec 03, 2024

ALIYUN::FC3::Trigger类型用于创建函数计算 FC 3.0触发器。

语法

{
  "Type": "ALIYUN::FC3::Trigger",
  "Properties": {
    "FunctionName": String,
    "TriggerType": String,
    "TriggerName": String,
    "TriggerConfig": Map,
    "Description": String,
    "InvocationRole": String,
    "Qualifier": String,
    "SourceArn": String
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

FunctionName

String

函数名称。

TriggerType

String

触发器的类型。

TriggerName

String

触发器的名称。

要求只能包含字母、数字、下划线(_)和短划线(-)。不能以数字、短划线(-)开头,长度限制为 1~128 个字符。

TriggerConfig

Map

触发器配置。

Description

String

触发器描述。

InvocationRole

String

事件源(如 OSS)调用函数所需的角色。

Qualifier

String

函数的版本或别名。

SourceArn

String

触发器事件源的 Aliyun Resource Name。

返回值

Fn::GetAtt

  • FunctionName:函数名称。

  • UrlIntranet:私网连接地址。

  • TriggerName:触发器的名称。

  • TriggerId:触发器ID。

  • UrlInternet:公网连接地址。

示例

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  TriggerType:
    Type: String
    Description:
      en: Type of the trigger.
    Required: true
  FunctionName:
    Type: String
    Description:
      en: The name of the function.
    Required: true
  TriggerName:
    Type: String
    Description:
      en: Name of the trigger.
    Required: true
  TriggerConfig:
    Type: Json
    Description:
      en: Trigger config.
    Required: true
Resources:
  Trigger:
    Type: ALIYUN::FC3::Trigger
    Properties:
      TriggerType:
        Ref: TriggerType
      FunctionName:
        Ref: FunctionName
      TriggerName:
        Ref: TriggerName
      TriggerConfig:
        Ref: TriggerConfig
Outputs:
  FunctionName:
    Description: Function name.
    Value:
      Fn::GetAtt:
        - Trigger
        - FunctionName
  UrlIntranet:
    Description: The private endpoint. In a VPC, you can access HTTP triggers by using HTTP or HTTPS.
    Value:
      Fn::GetAtt:
        - Trigger
        - UrlIntranet
  TriggerName:
    Description: Trigger name.
    Value:
      Fn::GetAtt:
        - Trigger
        - TriggerName
  TriggerId:
    Description: The trigger ID.
    Value:
      Fn::GetAtt:
        - Trigger
        - TriggerId
  UrlInternet:
    Description: The public domain address. You can access HTTP triggers over the Internet by using HTTP or HTTPS.
    Value:
      Fn::GetAtt:
        - Trigger
        - UrlInternet
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "TriggerType": {
      "Type": "String",
      "Description": {
        "en": "Type of the trigger."
      },
      "Required": true
    },
    "FunctionName": {
      "Type": "String",
      "Description": {
        "en": "The name of the function."
      },
      "Required": true
    },
    "TriggerName": {
      "Type": "String",
      "Description": {
        "en": "Name of the trigger."
      },
      "Required": true
    },
    "TriggerConfig": {
      "Type": "Json",
      "Description": {
        "en": "Trigger config."
      },
      "Required": true
    }
  },
  "Resources": {
    "Trigger": {
      "Type": "ALIYUN::FC3::Trigger",
      "Properties": {
        "TriggerType": {
          "Ref": "TriggerType"
        },
        "FunctionName": {
          "Ref": "FunctionName"
        },
        "TriggerName": {
          "Ref": "TriggerName"
        },
        "TriggerConfig": {
          "Ref": "TriggerConfig"
        }
      }
    }
  },
  "Outputs": {
    "FunctionName": {
      "Description": "Function name.",
      "Value": {
        "Fn::GetAtt": [
          "Trigger",
          "FunctionName"
        ]
      }
    },
    "UrlIntranet": {
      "Description": "The private endpoint. In a VPC, you can access HTTP triggers by using HTTP or HTTPS.",
      "Value": {
        "Fn::GetAtt": [
          "Trigger",
          "UrlIntranet"
        ]
      }
    },
    "TriggerName": {
      "Description": "Trigger name.",
      "Value": {
        "Fn::GetAtt": [
          "Trigger",
          "TriggerName"
        ]
      }
    },
    "TriggerId": {
      "Description": "The trigger ID.",
      "Value": {
        "Fn::GetAtt": [
          "Trigger",
          "TriggerId"
        ]
      }
    },
    "UrlInternet": {
      "Description": "The public domain address. You can access HTTP triggers over the Internet by using HTTP or HTTPS.",
      "Value": {
        "Fn::GetAtt": [
          "Trigger",
          "UrlInternet"
        ]
      }
    }
  }
}