

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# LambdaInvoke
<a name="rule-reference-LambdaInvoke"></a>

建立條件時，您可以新增`LambdaInvoke`規則。本節提供規則參數的參考。如需 規則和條件的詳細資訊，請參閱 [階段條件如何運作？](concepts-how-it-works-conditions.md)。

您必須已在 Lambda 中建立 函數做為個別資源。

**Topics**
+ [規則類型](#rule-reference-CloudWatchAlarm-type)
+ [組態參數](#rule-reference-LambdaInvoke-config)
+ [範例規則組態](#rule-reference-LambdaInvoke-example)
+ [另請參閱](#rule-reference-LambdaInvoke-links)

## 規則類型
<a name="rule-reference-CloudWatchAlarm-type"></a>
+ 類別：`Rule`
+ 擁有者：`AWS`
+ 提供者：`LambdaInvoke`
+ 版本：`1`

## 組態參數
<a name="rule-reference-LambdaInvoke-config"></a>

**FunctionName**  
必要：是  
Lambda 函數的名稱。

**UserParameters**  
必要：否  
這些是做為 函數輸入以鍵值對格式提供的參數。

## 範例規則組態
<a name="rule-reference-LambdaInvoke-example"></a>

------
#### [ YAML ]

```
- name: MyLambdaRule
  ruleTypeId:
    category: Rule
    owner: AWS
    provider: LambdaInvoke
    version: '1'
  configuration:
    FunctionName: my-function
  inputArtifacts:
  - name: SourceArtifact
  region: us-east-1
```

------
#### [ JSON ]

```
[
    {
        "name": "MyLambdaRule",
        "ruleTypeId": {
            "category": "Rule",
            "owner": "AWS",
            "provider": "LambdaInvoke",
            "version": "1"
        },
        "configuration": {
            "FunctionName": "my-function"
        },
        "inputArtifacts": [
            {
                "name": "SourceArtifact"
            }
        ],
        "region": "us-east-1"
    }
]
```

------

## 另請參閱
<a name="rule-reference-LambdaInvoke-links"></a>

下列相關資源可協助您處理此規則。
+ [在失敗條件時建立](stage-conditions.md#stage-conditions-onfailure) – 本節提供使用警示規則建立失敗時條件的步驟。