

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

# Target
<a name="sam-property-function-target"></a>

設定觸發規則時 EventBridge 叫用 AWS 的資源。

## 語法
<a name="sam-property-function-target-syntax"></a>

若要在 AWS Serverless Application Model (AWS SAM) 範本中宣告此實體，請使用下列語法。

### YAML
<a name="sam-property-function-target-syntax.yaml"></a>

```
  [Id](#sam-function-target-id): String
```

## Properties
<a name="sam-property-function-target-properties"></a>

 `Id`   <a name="sam-function-target-id"></a>
目標的邏輯 ID。  
的值`Id`可以包含英數字元、句點 (`.`)、連字號 (`-`) 和底線 ()`_`。  
*類型：*字串  
*必要*：是  
*CloudFormation 相容性*：此屬性會直接傳遞至 `AWS::Events::Rule` `Target` 資料類型的 `[Id](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-events-rule-target.html#cfn-events-rule-target-id)` 屬性。

## 範例
<a name="sam-property-function-target--examples"></a>

### Target
<a name="sam-property-function-target--examples--target"></a>

#### YAML
<a name="sam-property-function-target--examples--target--yaml"></a>

```
EBRule:
  Type: EventBridgeRule
  Properties:
    Target:
      Id: MyTarget
```