

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

# EventBridgeRule
<a name="sam-property-statemachine-statemachineeventbridgerule"></a>

`EventBridgeRule` イベントソースタイプを説明するオブジェクトです。これは、ステートマシンを Amazon EventBridge ルールのターゲットとして設定します。詳細については、*Amazon EventBridge ユーザーガイド*の「[Amazon EventBridge とは](https://docs.aws.amazon.com/eventbridge/latest/userguide/what-is-amazon-eventbridge.html)」を参照してください。

AWS SAM このイベントタイプが設定されると、 は [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-rule.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-rule.html)リソースを生成します。

## 構文
<a name="sam-property-statemachine-statemachineeventbridgerule-syntax"></a>

 AWS Serverless Application Model (AWS SAM) テンプレートでこのエンティティを宣言するには、次の構文を使用します。

### YAML
<a name="sam-property-statemachine-statemachineeventbridgerule-syntax.yaml"></a>

```
  DeadLetterConfig: {{DeadLetterConfig}}
  EventBusName: {{String}}
  Input: {{String}}
  InputPath: {{String}}
  InputTransformer: {{[InputTransformer](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-events-rule-inputtransformer.html)}}
  Pattern: {{[EventPattern](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-rule.html#cfn-events-rule-eventpattern)}}
  RetryPolicy: {{[RetryPolicy](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-events-rule-target.html#cfn-events-rule-target-retrypolicy)}}
  RuleName: {{String}}
  State: {{String}}
  Target: {{Target}}
```

## プロパティ
<a name="sam-property-statemachine-statemachineeventbridgerule-properties"></a>

 `DeadLetterConfig`   <a name="sam-statemachine-statemachineeventbridgerule-deadletterconfig"></a>
ターゲットの呼び出しに失敗した後で EventBridge がイベントを送信する Amazon Simple Queue Service (Amazon SQS) キューを設定します。呼び出しは、存在しない Lambda 関数にイベントを送信した場合、または Lambda 関数を呼び出すために十分な許可が EventBridge にない場合などに失敗します。詳細については、*Amazon EventBridge ユーザーガイド*の「[Event retry policy and using dead-letter queues](https://docs.aws.amazon.com/eventbridge/latest/userguide/rule-dlq.html)」を参照してください。  
*タイプ*: [DeadLetterConfig](sam-property-statemachine-statemachinedeadletterconfig.md)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Events::Rule` `Target` データ型の `[DeadLetterConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-events-rule-target.html#cfn-events-rule-target-deadletterconfig)`プロパティに似ています。このプロパティ AWS SAM のバージョンには、デッドレターキュー AWS SAM を作成する場合に備えて、追加のサブプロパティが含まれています。

 `EventBusName`   <a name="sam-statemachine-statemachineeventbridgerule-eventbusname"></a>
このルールに関連付けるイベントバスです。このプロパティを省略すると、 はデフォルトのイベントバス AWS SAM を使用します。  
*タイプ*: 文字列  
*必須:* いいえ  
*デフォルト値*: デフォルトのイベントバス  
*CloudFormation 互換性*: このプロパティは、 `AWS::Events::Rule`リソースの `[EventBusName](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-rule.html#cfn-events-rule-eventbusname)`プロパティに直接渡されます。

 `Input`   <a name="sam-statemachine-statemachineeventbridgerule-input"></a>
ターゲットに渡された有効な JSON テキストです。このプロパティを使用する場合、イベントテキスト自体からはターゲットに何も渡されません。  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Events::Rule Target`リソースの `[Input](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-events-rule-target.html#cfn-events-rule-target-input)`プロパティに直接渡されます。

 `InputPath`   <a name="sam-statemachine-statemachineeventbridgerule-inputpath"></a>
一致するイベント全体をターゲットに渡したくない場合は、`InputPath` プロパティを使用して、イベントのどの部分を渡すかを説明します。  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Events::Rule Target`リソースの `[InputPath](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-events-rule-target.html#cfn-events-rule-target-inputpath)`プロパティに直接渡されます。

`InputTransformer`  <a name="sam-statemachine-statemachineeventbridgerule-inputtransformer"></a>
特定のイベントデータに基づいてターゲットにカスタム入力を提供できるための設定。イベントから 1 つ以上のキーと値のペアを抽出し、そのデータを使用して、カスタマイズされた入力をターゲットに送信できます。詳細については、「Amazon EventBridge ユーザーガイド」の「[Amazon EventBridge の入力変換](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-transform-target-input.html)」を参照してください。  
*Type*: [InputTransformer](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-events-rule-target.html#cfn-events-rule-target-inputtransformer)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Events::Rule` `Target` データ型の `[InputTransformer](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-events-rule-inputtransformer.html) `プロパティに直接渡されます。

 `Pattern`   <a name="sam-statemachine-statemachineeventbridgerule-pattern"></a>
どのイベントが指定されたターゲットにルーティングされるかを説明します。詳細については、*Amazon EventBridge ユーザーガイド*の「[Events andEvent Patterns in EventBridge](https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html)」を参照してください。  
*タイプ*: [EventPattern](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-rule.html#cfn-events-rule-eventpattern)  
*必須:* はい  
*CloudFormation 互換性*: このプロパティは、 `AWS::Events::Rule`リソースの `[EventPattern](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-rule.html#cfn-events-rule-eventpattern)`プロパティに直接渡されます。

 `RetryPolicy`   <a name="sam-statemachine-statemachineeventbridgerule-retrypolicy"></a>
再試行ポリシーの設定に関する情報が含まれた `RetryPolicy` オブジェクトです。詳細については、*Amazon EventBridge ユーザーガイド*の「[Event retry policy and using dead-letter queues](https://docs.aws.amazon.com/eventbridge/latest/userguide/rule-dlq.html)」を参照してください。  
タイプ: [RetryPolicy](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-events-rule-target.html#cfn-events-rule-target-retrypolicy)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Events::Rule` `Target` データ型の `[RetryPolicy](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-events-rule-target.html#cfn-events-rule-target-retrypolicy)`プロパティに直接渡されます。

 `RuleName`   <a name="sam-statemachine-statemachineeventbridgerule-rulename"></a>
 ルールの名前。  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Events::Rule`リソースの `[Name](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-rule.html#cfn-events-rule-name)`プロパティに直接渡されます。

`State`  <a name="sam-statemachine-statemachineeventbridgerule-state"></a>
ルールの状態。  
*有効な値:* `[ DISABLED | ENABLED ]`  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Events::Rule`リソースの `[State](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-rule.html#cfn-events-rule-state)`プロパティに直接渡されます。

 `Target`   <a name="sam-statemachine-statemachineeventbridgerule-target"></a>
ルールがトリガーされたときに EventBridge が呼び出す AWS リソース。このプロパティを使用して、ターゲットの論理 ID を指定できます。このプロパティが指定されていない場合、 はターゲットの論理 ID AWS SAM を生成します。  
*タイプ*: [Target](sam-property-statemachine-statemachinetarget.md)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Events::Rule`リソースの `[Targets](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-rule.html#cfn-events-rule-targets)`プロパティに似ています。このプロパティの AWS SAM バージョンでは、単一のターゲットの論理 ID しか指定できません。

## 例
<a name="sam-property-statemachine-statemachineeventbridgerule--examples"></a>

### EventBridgeRule
<a name="sam-property-statemachine-statemachineeventbridgerule--examples--eventbridgerule"></a>

以下は、`EventBridgeRule` イベントソースタイプの例です。

#### YAML
<a name="sam-property-statemachine-statemachineeventbridgerule--examples--eventbridgerule--yaml"></a>

```
EBRule:
  Type: EventBridgeRule
  Properties:
    Input: '{"Key": "Value"}'
    Pattern:
      detail:
        state:
          - terminated
```