

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

# EventInvokeConfiguration
<a name="sam-property-function-eventinvokeconfiguration"></a>

[非同期](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html)の Lambda エイリアスまたはバージョン呼び出しの設定オプションです。

## 構文
<a name="sam-property-function-eventinvokeconfiguration-syntax"></a>

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

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

```
  [DestinationConfig](#sam-function-eventinvokeconfiguration-destinationconfig): EventInvokeDestinationConfiguration
  [MaximumEventAgeInSeconds](#sam-function-eventinvokeconfiguration-maximumeventageinseconds): Integer
  [MaximumRetryAttempts](#sam-function-eventinvokeconfiguration-maximumretryattempts): Integer
```

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

 `DestinationConfig`   <a name="sam-function-eventinvokeconfiguration-destinationconfig"></a>
Lambda がイベントを処理した後のイベントの送信先を指定する構成オブジェクト。  
*タイプ*: [EventInvokeDestinationConfiguration](sam-property-function-eventinvokedestinationconfiguration.md)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventInvokeConfig`リソースの `[DestinationConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventinvokeconfig-destinationconfig.html)`プロパティに似ています。SAM には、CloudFormation には存在しない追加のパラメータ「Type」が必要です。

 `MaximumEventAgeInSeconds`   <a name="sam-function-eventinvokeconfiguration-maximumeventageinseconds"></a>
Lambda が処理のために関数に送信するリクエストの最大存続時間です。  
*タイプ:* 整数  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventInvokeConfig`リソースの `[MaximumEventAgeInSeconds](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventinvokeconfig.html#cfn-lambda-eventinvokeconfig-maximumeventageinseconds)`プロパティに直接渡されます。

 `MaximumRetryAttempts`   <a name="sam-function-eventinvokeconfiguration-maximumretryattempts"></a>
関数がエラーを返すまでの最大再試行回数です。  
*タイプ:* 整数  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventInvokeConfig`リソースの `[MaximumRetryAttempts](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventinvokeconfig.html#cfn-lambda-eventinvokeconfig-maximumretryattempts)`プロパティに直接渡されます。

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

### MaximumEventAgeInSeconds
<a name="sam-property-function-eventinvokeconfiguration--examples--maximumeventageinseconds"></a>

MaximumEventAgeInSeconds の例

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

```
EventInvokeConfig:
  MaximumEventAgeInSeconds: 60
  MaximumRetryAttempts: 2
  DestinationConfig:
    OnSuccess:
      Type: SQS
      Destination: arn:aws:sqs:us-west-2:012345678901:my-queue
    OnFailure:
      Type: Lambda
      Destination: !GetAtt DestinationLambda.Arn
```

# EventInvokeDestinationConfiguration
<a name="sam-property-function-eventinvokedestinationconfiguration"></a>

Lambda がイベントを処理した後のイベントの送信先を指定する構成オブジェクトです。

## 構文
<a name="sam-property-function-eventinvokedestinationconfiguration-syntax"></a>

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

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

```
  [OnFailure](#sam-function-eventinvokedestinationconfiguration-onfailure): OnFailure
  [OnSuccess](#sam-function-eventinvokedestinationconfiguration-onsuccess): OnSuccess
```

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

 `OnFailure`   <a name="sam-function-eventinvokedestinationconfiguration-onfailure"></a>
処理が失敗したイベントの送信先です。  
*タイプ*: [OnFailure](sam-property-function-onfailure.md)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventInvokeConfig`リソースの `[OnFailure](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventinvokeconfig-onfailure.html)`プロパティに似ています。SAM 限定の追加プロパティである `Type` が必要です。

 `OnSuccess`   <a name="sam-function-eventinvokedestinationconfiguration-onsuccess"></a>
正常に処理されたイベントの送信先です。  
*タイプ*: [OnSuccess](sam-property-function-onsuccess.md)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventInvokeConfig`リソースの `[OnSuccess](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventinvokeconfig-onsuccess)`プロパティに似ています。SAM 限定の追加プロパティである `Type` が必要です。

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

### OnSuccess
<a name="sam-property-function-eventinvokedestinationconfiguration--examples--onsuccess"></a>

OnSuccess の例

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

```
EventInvokeConfig:
  DestinationConfig:
    OnSuccess:
      Type: SQS
      Destination: arn:aws:sqs:us-west-2:012345678901:my-queue
    OnFailure:
      Type: Lambda
      Destination: !GetAtt DestinationLambda.Arn
```

# OnFailure
<a name="sam-property-function-onfailure"></a>

処理に失敗したイベントの送信先。

## 構文
<a name="sam-property-function-onfailure-syntax"></a>

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

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

```
  [Destination](#sam-function-onfailure-destination): String
  [Type](#sam-function-onfailure-type): String
```

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

 `Destination`   <a name="sam-function-onfailure-destination"></a>
送信先リソースの Amazon リソースネーム (ARN) です。  
*タイプ*: 文字列  
*必須*: 条件に応じて異なります  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventInvokeConfig`リソースの `[OnFailure](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventinvokeconfig-onfailure.html)`プロパティに似ています。SAM は、このプロパティで参照されるリソースにアクセスするために、この関数に関連付けられている自動生成された IAM ロールに必要な許可を追加します。  
*その他の注意点*: タイプが Lambda/EventBridge の場合、Destination は必須です。

 `Type`   <a name="sam-function-onfailure-type"></a>
送信先で参照されるリソースのタイプです。サポートされているタイプは、`SQS`、`SNS`、`S3`、`Lambda`、および `EventBridge` です。  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。  
*その他の注意点*: タイプが SQS/SNS で、`Destination` プロパティが空白のままになっている場合、SQS/SNS リソースは SAM によって自動生成されます。リソースを参照するには、SQS の場合は `<function-logical-id>.DestinationQueue`、SNS の場合は `<function-logical-id>.DestinationTopic` を使用します。タイプが Lambda/EventBridge の場合、`Destination` は必須です。

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

### SQS および Lambda 送信先を使用した EventInvoke 設定の例
<a name="sam-property-function-onfailure--examples--eventinvoke-configuration-example-with-sqs-and-lambda-destinations"></a>

この例では、SQS OnSuccess 設定に Destination が指定されていないため、SAM は SQS キューを黙示的に作成し、必要な許可を追加します。また、この例では、テンプレートファイルで宣言された Lambda リソースの Destination が OnFailure 設定で指定されているため、SAM は、送信先の Lambda 関数を呼び出すために必要な許可をこの Lambda 関数に追加します。

#### YAML
<a name="sam-property-function-onfailure--examples--eventinvoke-configuration-example-with-sqs-and-lambda-destinations--yaml"></a>

```
EventInvokeConfig:
  DestinationConfig:
    OnSuccess:
      Type: SQS
    OnFailure:
      Type: Lambda
      Destination: !GetAtt DestinationLambda.Arn  # Arn of a Lambda function declared in the template file.
```

### SNS 送信先を使用した EventInvoke 設定の例
<a name="sam-property-function-onfailure--examples--eventinvoke-configuration-example-with-sns-destination"></a>

この例では、onSuccess 設定のテンプレートファイルで宣言された SNS トピックに Destination が指定されています。

#### YAML
<a name="sam-property-function-onfailure--examples--eventinvoke-configuration-example-with-sns-destination--yaml"></a>

```
EventInvokeConfig:
  DestinationConfig:
    OnSuccess:
      Type: SNS
      Destination:
        Ref: DestinationSNS       # Arn of an SNS topic declared in the tempate file
```

# OnSuccess
<a name="sam-property-function-onsuccess"></a>

正常に処理されたイベントの送信先。

## 構文
<a name="sam-property-function-onsuccess-syntax"></a>

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

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

```
  [Destination](#sam-function-onsuccess-destination): String
  [Type](#sam-function-onsuccess-type): String
```

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

 `Destination`   <a name="sam-function-onsuccess-destination"></a>
送信先リソースの Amazon リソースネーム (ARN) です。  
*タイプ*: 文字列  
*必須*: 条件に応じて異なります  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventInvokeConfig`リソースの `[OnSuccess](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventinvokeconfig-onsuccess)`プロパティに似ています。SAM は、このプロパティで参照されるリソースにアクセスするために、この関数に関連付けられている自動生成された IAM ロールに必要な許可を追加します。  
*その他の注意点*: タイプが Lambda/EventBridge の場合、Destination は必須です。

 `Type`   <a name="sam-function-onsuccess-type"></a>
送信先で参照されるリソースのタイプです。サポートされているタイプは、`SQS`、`SNS`、`S3`、`Lambda`、および `EventBridge` です。  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。  
*その他の注意点*: タイプが SQS/SNS で、`Destination` プロパティが空白のままになっている場合、SQS/SNS リソースは SAM によって自動生成されます。リソースを参照するには、SQS の場合は `<function-logical-id>.DestinationQueue`、SNS の場合は `<function-logical-id>.DestinationTopic` を使用します。タイプが Lambda/EventBridge の場合、`Destination` は必須です。

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

### SQS および Lambda 送信先を使用した EventInvoke 設定の例
<a name="sam-property-function-onsuccess--examples--eventinvoke-configuration-example-with-sqs-and-lambda-destinations"></a>

この例では、SQS OnSuccess 設定に Destination が指定されていないため、SAM は SQS キューを黙示的に作成し、必要な許可を追加します。また、この例では、テンプレートファイルで宣言された Lambda リソースの Destination が OnFailure 設定で指定されているため、SAM は、送信先の Lambda 関数を呼び出すために必要な許可をこの Lambda 関数に追加します。

#### YAML
<a name="sam-property-function-onsuccess--examples--eventinvoke-configuration-example-with-sqs-and-lambda-destinations--yaml"></a>

```
EventInvokeConfig:
  DestinationConfig:
    OnSuccess:
      Type: SQS
    OnFailure:
      Type: Lambda
      Destination: !GetAtt DestinationLambda.Arn  # Arn of a Lambda function declared in the template file.
```

### SNS 送信先を使用した EventInvoke 設定の例
<a name="sam-property-function-onsuccess--examples--eventinvoke-configuration-example-with-sns-destination"></a>

この例では、onSuccess 設定のテンプレートファイルで宣言された SNS トピックに Destination が指定されています。

#### YAML
<a name="sam-property-function-onsuccess--examples--eventinvoke-configuration-example-with-sns-destination--yaml"></a>

```
EventInvokeConfig:
  DestinationConfig:
    OnSuccess:
      Type: SNS
      Destination:
        Ref: DestinationSNS       # Arn of an SNS topic declared in the tempate file
```