ALIYUN::FC::Trigger は、関数の実行をトリガーする場合に使用します。
イベント駆動型コンピューティングモデルでは、ソースはイベントプロデューサーで、関数はイベントプロセッサです。トリガーは一元的な方法でさまざまなソースを管理します。 イベントソース側では、トリガーで定義された規則に一致するイベントが発生すると、イベントソースは対応する関数を呼び出します。
構文
{ “Type”: “ALIYUN::FC::Trigger”, “Properties”: { “TriggerConfig”: Map, “InvocationRole”: String, “FunctionName”: String, “ServiceName”: String, “TriggerName”: String, “TriggerType”: String, “SourceArn”: String, “Qualifier”: String }}
プロパティ
名前 | データ型 | 必須/省略可能 | 更新可/不可 | 説明 | 制約 |
---|---|---|---|---|---|
ServiceName | String | 必須 | 不可 | 関数が属するサービスの名前。 | 名前は 1 から 128 文字にする必要があります。 |
FunctionName | String | 必須 | 不可 | 関数の名前。 | なし |
TriggerName | String | 必須 | 不可 | トリガーの名前。 | なし |
TriggerType | String | 必須 | 不可 | トリガーのタイプ。 | なし |
TriggerConfig | Map | 必須 | 可 | トリガーの設定。 設定は、トリガーのタイプによって異なります。 | なし |
InvocationRole | String | 必須 | 可 | イベントソース (OSS など) が関数の呼び出しに使用するロール。 例:“acs:ram::1234567890:role/fc-test” | なし |
SourceArn | String | 必須 | 可 | イベントソースの Alibaba Cloud Resource Name (ARN)。 例:“acs:oss:cn-shanghai:12345:mybucket” | なし |
Qualifier | String | 省略可能 | 不可 | サービスのバージョン。 例:”LATEST” | なし |
レスポンスパラメーター
Fn::GetAttTriggerId:トリガーごとに生成される一意の ID。
例
{ “ROSTemplateFormatVersion”: “2015-09-01”, “Resources”: { “Trigger”: { “Type”: “ALIYUN::FC::Trigger”, “Properties”: { “TriggerConfig”: { “Ref”: “TriggerConfig” }, “InvocationRole”: { “Ref”: “InvocationRole” }, “FunctionName”:{ “Ref”: “FunctionName” }, “ServiceName”: { “Ref”: “ServiceName” }, “TriggerName”: { “Ref”: “TriggerName” }, “TriggerType”: { “Ref”: “TriggerType” }, “SourceArn”: { “Ref”: “SourceArn” }, “Qualifier”: { “Ref”: “Qualifier” } } } }, “Parameters”: { “TriggerConfig”: { “Type”: “Json”, “Description”: “Event source specific trigger configuration. The value is different according to trigger type.” }, “InvocationRole”: { “Type”: “String”, “Description”: “The role grants event source the permission to run function on behalf of the user. This is optional for some triggers.\nExample : \”acs:ram::1234567890:role/fc-test\”” }, “FunctionName”: { “Type”: “String”, “Description”: “Function name” }, “ServiceName”: { “MinLength”: 1, “Type”: “String”, “Description”: “Service name”, “MaxLength”: 128 }, “TriggerName”: { “Type”: “String”, “Description”: “Trigger name.\nExample : \”image_resize\”” }, “TriggerType”: { “Type”: “String”, “Description”: “Trigger type, e.g. oss, timer, logs. This determines how the trigger config is interpreted.\nExample : \”oss\”” }, “SourceArn”: { “Type”: “String”, “Description”: “The Aliyun Resource Name (ARN) of event source. This is optional for some triggers.\nExample : \”acs:oss:cn-shanghai:12345:mybucket\”” }, “Qualifier”: { “Type”: “String”, “Description”: “service version or alias.\nExample : \”LATEST\”” } }, “Outputs”: { “TriggerId”: { “Description”: “The trigger ID”, “Value”: { “Fn::GetAtt”: [ “Trigger”, “TriggerId” ] } } }}
</article>
</main>