

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

# AWS::Serverless::Function
<a name="sam-resource-function"></a>

 AWS Lambda 関数、 AWS Identity and Access Management (IAM) 実行ロール、および関数をトリガーするイベントソースマッピングを作成します。

[AWS::Serverless::Function](#sam-resource-function) リソースは `Metadata`リソース属性もサポートしているため、アプリケーションに必要なカスタムランタイムを構築する AWS SAM ように に指示できます。カスタムランタイムの構築の詳細については、「[でのカスタムランタイムを使用した Lambda 関数の構築 AWS SAM](building-custom-runtimes.md)」を参照してください。

**注記**  
にデプロイすると AWS CloudFormation、 は AWS SAM リソースを CloudFormation リソース AWS SAM に変換します。詳細については、「[の生成済み CloudFormation リソース AWS SAM](sam-specification-generated-resources.md)」を参照してください。

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

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

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

```
Type: AWS::Serverless::Function
Properties:
  [Architectures](#sam-function-architectures): List
  [AssumeRolePolicyDocument](#sam-function-assumerolepolicydocument): JSON
  [AutoPublishAlias](#sam-function-autopublishalias): String
  AutoPublishAliasAllProperties: Boolean
  [AutoPublishCodeSha256](#sam-function-autopublishcodesha256): String
  [CapacityProviderConfig](#sam-function-capacityproviderconfig): CapacityProviderConfig
  [CodeSigningConfigArn](#sam-function-codesigningconfigarn): String
  [CodeUri](#sam-function-codeuri): String | FunctionCode
  [DeadLetterQueue](#sam-function-deadletterqueue): Map | DeadLetterQueue
  [DeploymentPreference](#sam-function-deploymentpreference): DeploymentPreference
  [Description](#sam-function-description): String
  [DurableConfig](#sam-function-durableconfig): DurableConfig
  [Environment](#sam-function-environment): [Environment](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-environment.html)
  [EphemeralStorage](#sam-function-ephemeralstorage): [EphemeralStorage](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-ephemeralstorage)
  [EventInvokeConfig](#sam-function-eventinvokeconfig): EventInvokeConfiguration
  [Events](#sam-function-events): EventSource
  [FileSystemConfigs](#sam-function-filesystemconfigs): List
  [FunctionName](#sam-function-functionname): String
  [FunctionScalingConfig](#sam-function-functionscalingconfig): FunctionScalingConfig
  [FunctionUrlConfig](#sam-function-functionurlconfig): FunctionUrlConfig
  [Handler](#sam-function-handler): String
  [ImageConfig](#sam-function-imageconfig): [ImageConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-imageconfig)
  [ImageUri](#sam-function-imageuri): String
  [InlineCode](#sam-function-inlinecode): String
  [KmsKeyArn](#sam-function-kmskeyarn): String
  [Layers](#sam-function-layers): List
  LoggingConfig: [LoggingConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-loggingconfig.html)
  [MemorySize](#sam-function-memorysize): Integer
  [PackageType](#sam-function-packagetype): String
  [PermissionsBoundary](#sam-function-permissionsboundary): String
  [Policies](#sam-function-policies): String | List | Map
  [PublishToLatestPublished](#sam-function-publishtolatestpublished): Boolean
  PropagateTags: Boolean
  [ProvisionedConcurrencyConfig](#sam-function-provisionedconcurrencyconfig): [ProvisionedConcurrencyConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-alias.html#cfn-lambda-alias-provisionedconcurrencyconfig)
  RecursiveLoop: String
  [ReservedConcurrentExecutions](#sam-function-reservedconcurrentexecutions): Integer
  [Role](#sam-function-role): String
  [RolePath](#sam-function-rolepath): String
  [Runtime](#sam-function-runtime): String
  RuntimeManagementConfig: [RuntimeManagementConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-runtimemanagementconfig.html)
  SnapStart: [SnapStart](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-snapstart.html)
  [SourceKMSKeyArn](#sam-function-sourcekmskeyarn): String
  [Tags](#sam-function-tags): Map
  [TenancyConfig](#sam-function-tenancyconfig): TenancyConfig
  [Timeout](#sam-function-timeout): Integer
  [Tracing](#sam-function-tracing): String
  [VersionDescription](#sam-function-versiondescription): String
  [VersionDeletionPolicy](#sam-function-versiondeletionpolicy): String
  [VpcConfig](#sam-function-vpcconfig): [VpcConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-vpcconfig.html)
```

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

 `Architectures`   <a name="sam-function-architectures"></a>
関数の命令セットアーキテクチャ。  
このプロパティの詳細については、*AWS Lambda デベロッパーガイド*の「[Lambda 命令セットアーキテクチャ](https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html)」を参照してください。  
*有効な値*: `x86_64` または `arm64` のいずれか。  
*タイプ*: リスト  
*必須:* いいえ  
*デフォルト*: `x86_64`  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::Function`リソースの `[Architectures](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-architectures)`プロパティに直接渡されます。

 `AssumeRolePolicyDocument`   <a name="sam-function-assumerolepolicydocument"></a>
この関数用に作成されたデフォルト `Role` の AssumeRolePolicyDocument を追加します。このプロパティが指定されていない場合、 はこの関数のデフォルトの継承ロール AWS SAM を追加します。  
*Type*: JSON  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::IAM::Role` resource の `[AssumeRolePolicyDocument](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-role.html#cfn-iam-role-assumerolepolicydocument)` プロパティに似ています。 はこのプロパティを、この関数用に生成された IAM ロール AWS SAM に追加します。この関数にロールの Amazon リソースネーム (ARN) が提供されている場合、このプロパティは何も実行しません。

 `AutoPublishAlias`   <a name="sam-function-autopublishalias"></a>
Lambda エイリアスの名前です。Lambda エイリアスの詳細については、*AWS Lambda デベロッパーガイド*の「[Lambda 関数のエイリアス](https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html)」を参照してください。このプロパティを使用する例については、「[を使用してサーバーレスアプリケーションを徐々にデプロイする AWS SAM](automating-updates-to-serverless-apps.md)」を参照してください。  
AWS SAM このプロパティが設定されると、 は [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-version.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-version.html)および [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-alias.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-alias.html)リソースを生成します。このシナリオの詳細については、「[AutoPublishAlias プロパティが指定されている](sam-specification-generated-resources-function.md#sam-specification-generated-resources-function-autopublishalias)」を参照してください。生成された CloudFormation リソースの一般的な情報については、「」を参照してください[の生成済み CloudFormation リソース AWS SAM](sam-specification-generated-resources.md)。  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `AutoPublishAliasAllProperties`   <a name="sam-function-autopublishaliasallproperties"></a>
新しい [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-version.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-version.html) が作成されるタイミングを指定します。`true` の場合、 Lambda 関数のプロパティが変更されると、新しい Lambda バージョンが作成されます。`false` の場合、次のプロパティのいずれかが変更された場合にのみ、新しい Lambda バージョンが作成されます。  
+ `Environment`、`MemorySize`、`SnapStart`
+ `Code` プロパティの更新を伴う変更 (`CodeDict`、`ImageUri`、`InlineCode` など)。
このプロパティでは `AutoPublishAlias` を定義する必要があります。  
`AutoPublishCodeSha256` も指定されている場合、その動作は `AutoPublishAliasAllProperties: true` よりも優先されます。  
型: ブール  
*必須:* いいえ  
*デフォルト値*: `false`  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `AutoPublishCodeSha256`   <a name="sam-function-autopublishcodesha256"></a>
使用した場合、`CodeUri` 値とともに機能し、新しい Lambda バージョンを発行する必要があるかどうかを判断します。このプロパティは、しばしば次のようなデプロイの問題を解決するために使用されます: Amazon S3 のロケーションに保存されているデプロイパッケージが更新済みの Lambda 関数コードを使用する新しいデプロイパッケージに置き換えられたものの (新しいデプロイパッケージが新しい Amazon S3 のロケーションにアップロードされていて、`CodeUri` が新しい場所に変更されるのと反対に)、`CodeUri` プロパティがそのまま変更されていない。  
この問題は、次の特性を持つ AWS SAM テンプレートによってマークされます。  
+ `DeploymentPreference` オブジェクトが、([を使用してサーバーレスアプリケーションを徐々にデプロイする AWS SAM](automating-updates-to-serverless-apps.md) で説明されているように) 段階的なデプロイ用に設定されている
+ `AutoPublishAlias` プロパティが設定されていてもデプロイ間では変更されていない
+ `CodeUri` プロパティが設定されていてもデプロイ間では変更されていない。
このシナリオでは、`AutoPublishCodeSha256` を更新することで新しい Lambda バージョンが正常に作成されます。ただし、Amazon S3 にデプロイされた新しい関数コードは認識されません。新しい関数コードを認識するには、Amazon S3 バケットのバージョニングを使用することを検討してください。Lambda 関数の `Version` プロパティを指定し、常に最新のデプロイパッケージを使用するようにバケットを設定します。  
このシナリオで段階的なデプロイを正常にトリガーするには、`AutoPublishCodeSha256` に一意の値を提供する必要があります。  
*型*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `CapacityProviderConfig`   <a name="sam-function-capacityproviderconfig"></a>
関数の公開バージョンがアタッチされるキャパシティープロバイダーを設定します。これにより、関数は Lambda マネージドインスタンスによって管理される顧客所有の EC2 インスタンスで実行できます。  
*タイプ*: [CapacityProviderConfig](sam-property-function-capacityproviderconfig.md)  
*必須:* いいえ  
*CloudFormation 互換性*: SAM は、 `AWS::Lambda::Function`リソースの プロパティに渡された `[CapacityProviderConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-capacityproviderconfig)` プロパティをフラット化し、ネストされた構造を再構築します。

 `CodeSigningConfigArn`   <a name="sam-function-codesigningconfigarn"></a>
[https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-codesigningconfig.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-codesigningconfig.html) リソースの ARN で、この関数のコード署名を有効にするために使用されます。コード署名の詳細については、「[AWS SAM アプリケーションのコード署名を設定する](authoring-codesigning.md)」を参照してください。  
*型*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::Function`リソースの `[CodeSigningConfigArn](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-codesigningconfigarn)`プロパティに直接渡されます。

 `CodeUri`   <a name="sam-function-codeuri"></a>
関数のコード 以下のような値を設定できます。  
+ 関数の Amazon S3 URI。例えば、`s3://bucket-123456789/sam-app/1234567890abcdefg`。
+ 関数へのローカルパス。例えば、`hello_world/`。
+ [FunctionCode](sam-property-function-functioncode.md) オブジェクト。
関数の Amazon S3 URI または [FunctionCode](sam-property-function-functioncode.md) オブジェクトを指定する場合は、有効な [Lambda デプロイパッケージ](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-package.html)を参照する必要があります。  
ローカルファイルパスを指定する場合は、 AWS SAM CLI を使用してデプロイ時にローカルファイルをアップロードします。詳細については[がデプロイ時にローカルファイル AWS SAM をアップロードする方法](deploy-upload-local-files.md)を参照してください。  
`CodeUri` プロパティで組み込み関数を使用する場合、 は値を正しく解析 AWS SAM できません。代わりに [AWS::LanguageExtensions 変換](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/transform-aws-languageextensions.html)の使用を検討してください。
*タイプ*: [ String \$1 [FunctionCode](sam-property-function-functioncode.md) ]  
*必須:* 条件的。`PackageType` が `Zip` に設定されている場合、`CodeUri` または `InlineCode` のいずれかが必須です。  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::Function`リソースの `[ Code](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-code)`プロパティに似ています。ネストされた Amazon S3 プロパティには異なる名前が付けられています。

 `DeadLetterQueue`   <a name="sam-function-deadletterqueue"></a>
処理できないイベントを Lambda が送信する Amazon Simple Notification Service (Amazon SNS) トピックまたは Amazon Simple Queue Service (Amazon SQS) キューを設定します。デッドレターキュー機能の詳細については、「*AWS Lambda デベロッパーガイド*」の「[デッドレターキュー](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async-retain-records.html#invocation-dlq)」を参照してください。  
Lambda 関数のイベントソースが Amazon SQS キューである場合は、Lambda 関数ではなく、ソースキューのデッドレターキューを設定してください。関数用に設定するデッドレターキューは、イベントソースキューではなく、関数の[非同期呼び出しキュー](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html)に使用されます。
*タイプ*: マップ \$1 [DeadLetterQueue](sam-property-function-deadletterqueue.md)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::Function`リソースの `[DeadLetterConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-deadletterconfig.html)`プロパティに似ています。 CloudFormation タイプは から派生しますが`TargetArn`、 では AWS SAM タイプを とともに渡す必要があります`TargetArn`。

 `DeploymentPreference`   <a name="sam-function-deploymentpreference"></a>
段階的な Lambda デプロイを有効にする設定です。  
`DeploymentPreference` オブジェクトが指定されている場合、 は [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codedeploy-application.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codedeploy-application.html)という名前の `ServerlessDeploymentApplication` (スタックごとに 1 つ）、 [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codedeploy-deploymentgroup.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codedeploy-deploymentgroup.html)という名前の `<function-logical-id>DeploymentGroup`、 [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-role.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-role.html)という名前の AWS SAM を作成します`CodeDeployServiceRole`。  
*タイプ*: [DeploymentPreference](sam-property-function-deploymentpreference.md)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のプロパティはありません。  
*その他の参照資料*: このプロパティの詳細については、「[を使用してサーバーレスアプリケーションを徐々にデプロイする AWS SAM](automating-updates-to-serverless-apps.md)」を参照してください。

 `Description`   <a name="sam-function-description"></a>
関数の説明です。  
*型*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::Function`リソースの `[Description](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-description)`プロパティに直接渡されます。

 `DurableConfig`   <a name="sam-function-durableconfig"></a>
耐久性のある関数の設定。自動チェックポイントとリプレイ機能を使用してステートフル実行を有効にします。  
*タイプ*: [DurableConfig](sam-property-function-durableconfig.md)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `Environment`   <a name="sam-function-environment"></a>
ランタイム環境の設定です。  
*タイプ*: [Environment](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-environment.html)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::Function`リソースの `[Environment](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-environment.html)`プロパティに直接渡されます。

 `EphemeralStorage`   <a name="sam-function-ephemeralstorage"></a>
`/tmp` の Lambda 関数で使用可能なディスク容量を MB 単位で指定するオブジェクト。  
このプロパティの詳細については、「*AWS Lambda デベロッパーガイド*」の「[Lambda 実行環境](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-context.html)」を参照してください。  
*型*: [EphemeralStorage](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-ephemeralstorage)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::Function`リソースの `[EphemeralStorage](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-ephemeralstorage)`プロパティに直接渡されます。

 `EventInvokeConfig`   <a name="sam-function-eventinvokeconfig"></a>
Lambda 関数でのイベントの呼び出し設定を説明するオブジェクトです。  
*タイプ*: [EventInvokeConfiguration](sam-property-function-eventinvokeconfiguration.md)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のプロパティはありません。

 `Events`   <a name="sam-function-events"></a>
この関数をトリガーするイベントを指定します。イベントは、1 つのタイプと、そのタイプに依存する一連のプロパティで構成されます。  
*タイプ*: [EventSource](sam-property-function-eventsource.md)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `FileSystemConfigs`   <a name="sam-function-filesystemconfigs"></a>
Amazon Elastic File System (Amazon EFS) ファイルシステムの接続設定を指定する [FileSystemConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-filesystemconfig.html) オブジェクトのリストです。  
テンプレートに [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-efs-mounttarget.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-efs-mounttarget.html) リソースが含まれている場合は、`DependsOn` リソース属性を指定して、関数の前にマウントターゲットが作成または更新されることを確実にする必要があります。  
*タイプ*: リスト  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::Function`リソースの `[FileSystemConfigs](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-filesystemconfigs)`プロパティに直接渡されます。

 `FunctionName`   <a name="sam-function-functionname"></a>
関数の名前です。名前を指定しない場合は、一意の名前が生成されます。  
*型*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::Function`リソースの `[FunctionName](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-functionname)`プロパティに直接渡されます。

 `FunctionScalingConfig`   <a name="sam-function-functionscalingconfig"></a>
キャパシティープロバイダーで実行されている Lambda 関数のスケーリング動作を設定します。実行環境の最小数と最大数を定義します。  
*タイプ*: [FunctionScalingConfig](sam-property-function-functionscalingconfig.md)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::Function`リソースの `[FunctionScalingConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-functionscalingconfig)`プロパティに直接渡されます。

 `FunctionUrlConfig`   <a name="sam-function-functionurlconfig"></a>
関数 URL を記述するオブジェクトです。関数 URL は、関数を呼び出すために使用する HTTPS エンドポイントです。  
詳細については、「*AWS Lambda デベロッパーガイド*」の「[関数スケーリング](https://docs.aws.amazon.com/lambda/latest/dg/lambda-urls.html)」を参照してください。  
*型*: [FunctionUrlConfig](sam-property-function-functionurlconfig.md)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のプロパティはありません。

 `Handler`   <a name="sam-function-handler"></a>
実行を開始するために呼び出されるコード内の関数です。このプロパティが必要になるのは、`PackageType` プロパティが `Zip` に設定されている場合のみです。  
*型*: 文字列  
*必須*: 条件に応じて異なります  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::Function`リソースの `[Handler](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-handler)`プロパティに直接渡されます。

 `ImageConfig`   <a name="sam-function-imageconfig"></a>
Lambda のコンテナイメージ設定に使用されるオブジェクトです。詳細については、*AWS Lambda デベロッパーガイド*の「[Lambda でのコンテナイメージの使用](https://docs.aws.amazon.com/lambda/latest/dg/lambda-images.html)」を参照してください。  
*タイプ*: [ImageConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-imageconfig)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::Function`リソースの `[ImageConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-imageconfig)`プロパティに直接渡されます。

 `ImageUri`   <a name="sam-function-imageuri"></a>
Lambda 関数のコンテナイメージ用の Amazon Elastic Container Registry (Amazon ECR) リポジトリの URI です。このプロパティは、`PackageType` プロパティが `Image` に設定されている場合にのみ適用され、それ以外の場合は無視されます。詳細については、*AWS Lambda デベロッパーガイド*の「[Lambda でのコンテナイメージの使用](https://docs.aws.amazon.com/lambda/latest/dg/lambda-images.html)」を参照してください。  
`PackageType` プロパティが に設定されている場合`Image`、 `ImageUri`は必須です。または、 AWS SAM テンプレートファイルに必要な`Metadata`エントリを使用してアプリケーションを構築する必要があります。詳細については、「[を使用したデフォルトのビルド AWS SAM](serverless-sam-cli-using-build.md)」を参照してください。
必要な `Metadata` エントリを使用してアプリケーションを構築することは、`ImageUri` よりも優先されるので、両方を指定すれば `ImageUri` は無視されます。  
*型*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::Function` `Code` データ型の `[ImageUri](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-code.html#cfn-lambda-function-code-imageuri)`プロパティに直接渡されます。

 `InlineCode`   <a name="sam-function-inlinecode"></a>
テンプレートに直接記述された Lambda 関数コードです。このプロパティは、`PackageType` プロパティが `Zip` に設定されている場合にのみ適用され、それ以外の場合は無視されます。  
`PackageType` が `Zip` (デフォルト) に設定されていると、`CodeUri` または `InlineCode` のいずれかが必要になります。
*タイプ*: 文字列  
*必須*: 条件に応じて異なります  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::Function` `Code` データ型の `[ZipFile](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-code.html#cfn-lambda-function-code-zipfile)`プロパティに直接渡されます。

 `KmsKeyArn`   <a name="sam-function-kmskeyarn"></a>
Lambda が関数の環境変数を暗号化および復号するために使用する AWS Key Management Service (AWS KMS) キーの ARN。  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::Function`リソースの `[KmsKeyArn](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-kmskeyarn)`プロパティに直接渡されます。

 `Layers`   <a name="sam-function-layers"></a>
この関数が使用する必要がある `LayerVersion` ARN のリストです。ここで指定されている順序は、Lambda 関数の実行時にそれらがインポートされる順序です。バージョンは、バージョンを含む完全な ARN であるか、LayerVersion リソースへの参照です。例えば、`LayerVersion` への参照は `!Ref MyLayer` になり、 バージョンを含む完全な ARN は `arn:aws:lambda:region:account-id:layer:layer-name:version` になります。  
*タイプ*: リスト  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::Function`リソースの `[Layers](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-layers)`プロパティに直接渡されます。

 `LoggingConfig`   <a name="sam-function-loggingconfig"></a>
関数の Amazon CloudWatch Logs 構成の設定。  
*Type*: [LoggingConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-loggingconfig.html)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::Function`リソースの [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-loggingconfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-loggingconfig)プロパティに直接渡されます。

 `MemorySize`   <a name="sam-function-memorysize"></a>
関数の各呼び出しに割り当てられるメモリのサイズ (MB) です。  
*タイプ:* 整数  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::Function`リソースの `[MemorySize](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-memorysize)`プロパティに直接渡されます。

 `PackageType`   <a name="sam-function-packagetype"></a>
Lambda 関数のデプロイパッケージタイプです。詳細については、*AWS Lambda デベロッパーガイド*の「[Lambda デプロイパッケージ](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-package.html)」を参照してください。  
**注意**:  
1. このプロパティが `Zip` (デフォルト) に設定されている場合は、`CodeUri` または `InlineCode` が適用され、`ImageUri` は無視されます。  
2. このプロパティが `Image` に設定されている場合は、`ImageUri` のみが適用され、`CodeUri` と`InlineCode` は無視されます。関数のコンテナイメージを保存するために必要な Amazon ECR リポジトリは、 によって自動的に作成できます AWS SAM CLI。詳細については、「[sam deploy](sam-cli-command-reference-sam-deploy.md)」を参照してください。  
*有効な値*: `Zip` または `Image`  
タイプ：文字列  
*必須:* いいえ  
*デフォルト*: `Zip`  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::Function`リソースの `[PackageType](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-packagetype)`プロパティに直接渡されます。

 `PermissionsBoundary`   <a name="sam-function-permissionsboundary"></a>
この関数の実行ロールに使用するアクセス許可境界の ARN です。このプロパティは、ユーザーのためにロールが生成される場合にのみ機能します。  
*型*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::IAM::Role`リソースの `[PermissionsBoundary](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-role.html#cfn-iam-role-permissionsboundary)`プロパティに直接渡されます。

 `Policies`   <a name="sam-function-policies"></a>
この関数の許可ポリシー。ポリシーは、関数のデフォルト AWS Identity and Access Management (IAM) 実行ロールに追加されます。  
このプロパティは、単一の値または値のリストを受け入れます。使用できる値は次のとおりです。  
+ [AWS SAMポリシーテンプレート](serverless-policy-templates.md).
+ [AWS  管理ポリシー](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_managed-vs-inline.html#aws-managed-policies)または[カスタマー管理ポリシー](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_managed-vs-inline.html#customer-managed-policies)の ARN。
+ 次の[リストから](https://github.com/aws/serverless-application-model/blob/develop/samtranslator/internal/data/aws_managed_policies.json)の AWS 管理ポリシーの名前。
+ マップとして YAML でフォーマットされた[インライン IAM ポリシー](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_managed-vs-inline.html#inline-policies)。
`Role` プロパティを設定する場合、このプロパティは無視されます。
*タイプ*: 文字列 \$1 リスト \$1 マップ  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::IAM::Role`リソースの `[Policies](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-role.html#cfn-iam-role-policies)`プロパティに似ています。

 `PublishToLatestPublished`   <a name="sam-function-publishtolatestpublished"></a>
関数の更新時に最新の関数バージョンを発行するかどうかを指定します。  
型: ブール  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::Function`リソースの `[PublishToLatestPublished](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-publishtolatestpublished)`プロパティに直接渡されます。

`PropagateTags`  <a name="sam-function-propagatetags"></a>
[AWS::Serverless::Function](sam-specification-generated-resources-function.md) が生成したリソースに `Tags` プロパティからのタグを渡すかどうかを指定します。`True` を指定して、生成されたリソースにタグを伝播します。  
型: ブール  
*必須:* いいえ  
*デフォルト*: `False`  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `ProvisionedConcurrencyConfig`   <a name="sam-function-provisionedconcurrencyconfig"></a>
関数のエイリアスのプロビジョニングされた同時実行設定です。  
`ProvisionedConcurrencyConfig` を指定できるのは、`AutoPublishAlias` が設定されている場合のみです。それ以外の場合は、エラーが発生します。
*タイプ*: [ProvisionedConcurrencyConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-alias.html#cfn-lambda-alias-provisionedconcurrencyconfig)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::Alias`リソースの `[ProvisionedConcurrencyConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-alias.html#cfn-lambda-alias-provisionedconcurrencyconfig)`プロパティに直接渡されます。

 `RecursiveLoop`   <a name="sam-function-recursiveloop"></a>
関数の再帰的ループ検出設定のステータス。  
この値が `Allow` に設定されている場合、Lambda が再帰的ループの一部として呼び出されている関数を検出しても、いずれのアクションも実行されません。  
この値が `Terminate` に設定されている場合、Lambda が再帰的ループの一部として呼び出されている関数を検出すると、その関数の呼び出しが停止され通知が送信されます。  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::Function`リソースの `[RecursiveLoop](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-recursiveloop)`プロパティに直接渡されます。

 `ReservedConcurrentExecutions`   <a name="sam-function-reservedconcurrentexecutions"></a>
関数用に予約する同時実行の最大数です。  
このプロパティの詳細については、*AWS Lambda デベロッパーガイド*の「[Lambda 関数スケーリング](https://docs.aws.amazon.com/lambda/latest/dg/scaling.html)」を参照してください。  
*タイプ:* 整数  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::Function`リソースの `[ReservedConcurrentExecutions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-reservedconcurrentexecutions)`プロパティに直接渡されます。

 `Role`   <a name="sam-function-role"></a>
この関数の実行ロールとして使用する IAM ロールの ARN です。  
*型*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::Function`リソースの `[Role](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-role)`プロパティに似ています。これは では必須 CloudFormation ですが、 では必須ではありません AWS SAM。ロールが指定されていない場合は、`<function-logical-id>Role` の論理 ID を持つロールが作成されます。

 `RolePath`   <a name="sam-function-rolepath"></a>
関数の IAM 実行ロールへのパス。  
このプロパティは、ユーザーのためにロールが生成される場合にのみ機能します。`Role` プロパティでロールが指定されている場合は使用しないでください。  
*タイプ*: 文字列  
*必須*: 条件に応じて異なります  
*CloudFormation 互換性*: このプロパティは、 `AWS::IAM::Role`リソースの `[Path](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-role.html#cfn-iam-role-path)`プロパティに直接渡されます。

 `Runtime`   <a name="sam-function-runtime"></a>
関数の[ランタイム](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html)の識別子です。このプロパティが必要になるのは、`PackageType` プロパティが `Zip` に設定されている場合のみです。  
このプロパティの`provided`識別子を指定する場合、`Metadata`リソース属性を使用して、この関数に必要なカスタムランタイムを構築する AWS SAM ように に指示できます。カスタムランタイムの構築の詳細については、「[でのカスタムランタイムを使用した Lambda 関数の構築 AWS SAM](building-custom-runtimes.md)」を参照してください。
*型*: 文字列  
*必須*: 条件に応じて異なります  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::Function`リソースの `[Runtime](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-runtime)`プロパティに直接渡されます。

 `RuntimeManagementConfig`   <a name="sam-function-runtimemanagementconfig"></a>
ランタイム環境の更新、ロールバック動作、特定のランタイムバージョンの選択など、Lambda 関数のランタイム管理オプションを設定します。詳細については、「*AWS Lambda デベロッパーガイド*」の「[Lambda ランタイム更新](https://docs.aws.amazon.com//lambda/latest/dg/runtimes-update.html)」を参照してください。  
*タイプ*: [RuntimeManagementConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-runtimemanagementconfig.html)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::Function`リソースの `[ RuntimeManagementConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-runtimemanagementconfig.html)`プロパティに直接渡されます。

 `SnapStart`   <a name="sam-function-snapstart"></a>
新しい Lambda 関数バージョンのスナップショットを作成します。スナップショットは、すべての依存関係を含む、初期化された関数のキャッシュされた状態です。関数は一度だけ初期化され、キャッシュされた状態は将来の すべての呼び出しで再利用されるため、関数の初期化が必要な回数が減ることでアプリケーションのパフォーマンスが向上します。詳細については、「*AWS Lambda デベロッパーガイド*」の「[Lambda SnapStart による起動パフォーマンスの向上](https://docs.aws.amazon.com/lambda/latest/dg/snapstart.html)」を参照してください。  
*タイプ*: [SnapStart](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-snapstart.html)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::Function`リソースの `[SnapStart](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-snapstart.html)`プロパティに直接渡されます。

 `SourceKMSKeyArn`   <a name="sam-function-sourcekmskeyarn"></a>
お客様の ZIP 関数コードを暗号化するために使用される KMS キー ARN を表します。  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::Function` `Code` データ型の `[SourceKMSKeyArn](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-sourcekmskeyarn)`プロパティに直接渡されます。

 `Tags`   <a name="sam-function-tags"></a>
この関数に追加されるタグを指定するマップ (文字列対文字列) です。タグの有効なキーと値の詳細については、「*AWS Lambda デベロッパーガイド*」の「[タグのキーと値の要件](https://docs.aws.amazon.com/lambda/latest/dg/configuration-tags.html#configuration-tags-restrictions)」を参照してください。  
スタックが作成されると、 はこの Lambda 関数と、この関数用に生成されるデフォルトのロールに`lambda:createdBy:SAM`タグ AWS SAM を自動的に追加します。  
*タイプ*: マップ  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::Function`リソースの `[Tags](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-tags)`プロパティに似ています。の `Tags`プロパティ AWS SAM は、キーと値のペアで構成されます ( CloudFormation このプロパティは`Tag`オブジェクトのリストで構成されます）。また、 は、この Lambda 関数と、この関数用に生成されるデフォルトのロールに`lambda:createdBy:SAM`タグ AWS SAM を自動的に追加します。

 `TenancyConfig`   <a name="sam-function-tenancyconfig"></a>
Lambda テナント分離モードの設定。実行環境が異なるテナント IDs 間で共有されないようにし、マルチテナントアプリケーションにコンピューティングレベルの分離を提供します。  
*タイプ*: [TenancyConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-tenancyconfig.html)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::Function`リソースの `[TenancyConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-tenancyconfig)`プロパティに直接渡されます。

 `Timeout`   <a name="sam-function-timeout"></a>
関数が停止されるまでの最大実行時間 (秒) です。  
*タイプ:* 整数  
*必須:* いいえ  
*デフォルト:* 3  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::Function`リソースの `[Timeout](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-timeout)`プロパティに直接渡されます。

 `Tracing`   <a name="sam-function-tracing"></a>
関数の X-Ray トレーシングモードを指定する文字列です。  
+ `Active` – 関数の X-Ray トレーシングを有効にします。
+ `Disabled` – 関数の X-Ray を無効にします。
+ `PassThrough` – 関数の X-Ray トレーシングを有効にします。サンプリングデシジョンはダウンストリームサービスに委任されます。
`Active` または `PassThrough` が指定されており、`Role` プロパティが設定されていない場合、 AWS SAM は、ユーザー用に作成する Lambda 実行ロールに `arn:aws:iam::aws:policy/AWSXrayWriteOnlyAccess` ポリシーを追加します。  
X-Ray の詳細については、「 *AWS Lambda デベロッパーガイド*」の「 [AWS Lambda で を使用する AWS X-Ray](https://docs.aws.amazon.com/lambda/latest/dg/lambda-x-ray.html)」を参照してください。  
有効な値: [`Active`\$1`Disabled`\$1`PassThrough`]  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::Function`リソースの `[TracingConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-tracingconfig)`プロパティに似ています。

 `VersionDescription`   <a name="sam-function-versiondescription"></a>
新しい Lambda バージョンリソースに追加される `Description` フィールドを指定します。  
*型*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::Version`リソースの `[Description](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-version.html#cfn-lambda-version-description)`プロパティに直接渡されます。

 `VersionDeletionPolicy`   <a name="sam-function-versiondeletionpolicy"></a>
が`AutoPublishAlias`設定されている場合に作成される Lambda バージョンリソースの削除ポリシーを指定します。これにより、スタックが削除されたときにバージョンリソースが保持または削除されるかどうかが制御されます。  
*有効な値*: `Delete`、`Retain`、または `Snapshot`  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。生成された`AWS::Lambda::Version`リソースに `DeletionPolicy` 属性を設定します。

 `VpcConfig`   <a name="sam-function-vpcconfig"></a>
この関数が Virtual Private Cloud (VPC) 内のプライベートリソースにアクセスすることを可能にする設定です。  
*タイプ*: [VpcConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-vpcconfig.html)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::Function`リソースの `[VpcConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-vpcconfig.html)`プロパティに直接渡されます。

## 戻り値
<a name="sam-resource-function-return-values"></a>

### 参照番号
<a name="sam-resource-function-return-values-ref"></a>

このリソースの論理 ID が `Ref` 組み込み関数に提供されると、基盤となる Lambda 関数のリソース名が返されます。

`Ref` 関数の使用方法の詳細については、「AWS CloudFormation ユーザーガイド」の「[https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-ref.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-ref.html)」を参照してください。

### Fn::GetAtt
<a name="sam-resource-function-return-values-fn--getatt"></a>

`Fn::GetAtt` は、このタイプの指定された属性の値を返します。利用可能な属性とサンプル戻り値は以下のとおりです。

`Fn::GetAtt` の使用の詳細については、「AWS CloudFormation ユーザーガイド」の「[https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-getatt.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-getatt.html)」を参照してください。

`Arn`  <a name="Arn-fn::getatt"></a>
基盤となる Lambda 関数の ARN です。

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

### シンプルな関数
<a name="sam-resource-function-examples-simple-function"></a>

以下は、[AWS::Serverless::Function](#sam-resource-function) パッケージタイプ (デフォルト) の `Zip` リソースと、Amazon S3 バケット内にある関数コードの基本的な例です。

#### YAML
<a name="sam-resource-function-examples-simple-function--yaml"></a>

```
Type: AWS::Serverless::Function
Properties:
  Handler: index.handler
  Runtime: python3.9
  CodeUri: s3://bucket-name/key-name
```

### 関数プロパティの例
<a name="sam-resource-function-examples-function-properties-example"></a>

以下は、`InlineCode`、`Layers`、`Tracing`、`Policies`、`Amazon EFS`、および `Api` イベントソースを使用する、[AWS::Serverless::Function](#sam-resource-function) パッケージタイプ (デフォルト) の `Zip` の例です。

#### YAML
<a name="sam-resource-function-examples-function-properties-example--yaml"></a>

```
Type: AWS::Serverless::Function
DependsOn: MyMountTarget        # This is needed if an AWS::EFS::MountTarget resource is declared for EFS
Properties:
  Handler: index.handler
  Runtime: python3.9
  InlineCode: |
    def handler(event, context):
      print("Hello, world!")
  ReservedConcurrentExecutions: 30
  Layers:
    - Ref: MyLayer
  Tracing: Active
  Timeout: 120
  FileSystemConfigs:
    - Arn: !Ref MyEfsFileSystem
      LocalMountPath: /mnt/EFS
  Policies:
    - AWSLambdaExecute
    - Version: '2012-10-17		 	 	 ' 
      Statement:
        - Effect: Allow
          Action:
            - s3:GetObject
            - s3:GetObjectACL
          Resource: 'arn:aws:s3:::sam-s3-demo-bucket/*'
  Events:
    ApiEvent:
      Type: Api
      Properties:
        Path: /path
        Method: get
```

### ImageConfig の例
<a name="sam-resource-function-examples-imageconfig-example"></a>

以下は、`Image` パッケージタイプの Lambda 関数向けの `ImageConfig` の例です。

#### YAML
<a name="sam-resource-function-examples-imageconfig-example--yaml"></a>

```
HelloWorldFunction:
  Type: AWS::Serverless::Function
  Properties:
    PackageType: Image
    ImageUri: account-id.dkr.ecr.region.amazonaws.com/ecr-repo-name:image-name
    ImageConfig:
      Command:
        - "app.lambda_handler"
      EntryPoint:
        - "entrypoint1"
      WorkingDirectory: "workDir"
```

### RuntimeManagementConfig の例
<a name="sam-resource-function-examples-runtimemanagementconfig-examples"></a>

現在の動作に従ってランタイム環境を更新するように設定された Lambda 関数:

```
TestFunction
  Type: AWS::Serverless::Function
  Properties:
    ...
    Runtime: python3.9
    RuntimeManagementConfig:
      UpdateRuntimeOn: Auto
```

関数が更新されたときにランタイム環境を更新するように設定された Lambda 関数:

```
TestFunction
  Type: AWS::Serverless::Function
  Properties:
    ...
    Runtime: python3.9
    RuntimeManagementConfig:
      UpdateRuntimeOn: FunctionUpdate
```

ランタイム環境を手動で更新するように構成された Lambda 関数:

```
TestFunction
  Type: AWS::Serverless::Function
  Properties:
    ...
    Runtime: python3.9
    RuntimeManagementConfig:
      RuntimeVersionArn: arn:aws:lambda:us-east-1::runtime:4c459dd0104ee29ec65dcad056c0b3ddbe20d6db76b265ade7eda9a066859b1e
      UpdateRuntimeOn: Manual
```

### SnapStart の例
<a name="sam-resource-function-examples-snapstart-examples"></a>

将来のバージョンに対して SnapStart を有効にした Lambda 関数の例。

```
TestFunc
  Type: AWS::Serverless::Function
  Properties:
    ...
    SnapStart:
      ApplyOn: PublishedVersions
```

### TenancyConfig の例
<a name="sam-resource-function-examples-tenancyconfig-examples"></a>

テナント分離モードがオンになっている Lambda 関数の例:

```
TestFunction
  Type: AWS::Serverless::Function
  Properties:
    ...
    TenancyConfig:
      TenantIsolationMode: PER_TENANT
```

# DeadLetterQueue
<a name="sam-property-function-deadletterqueue"></a>

 AWS Lambda (Lambda) がイベントを処理できないときにイベントを送信する SQS キューまたは SNS トピックを指定します。デッドレターキュー機能の詳細については、「*AWS Lambda デベロッパーガイド*」の「[デッドレターキュー](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async-retain-records.html#invocation-dlq)」を参照してください。

SAM は、Lambda 関数実行ロールに適切なアクセス許可を自動的に追加して、Lambda サービスにリソースへのアクセスを許可します。sq:SendMessage が SQS キューに、sns:Publish が SNS トピックに追加されます。

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

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

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

```
  [TargetArn](#sam-function-deadletterqueue-targetarn): String
  [Type](#sam-function-deadletterqueue-type): String
```

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

 `TargetArn`   <a name="sam-function-deadletterqueue-targetarn"></a>
Amazon SQS キューまたは Amazon SNS トピックの Amazon リソースネーム (ARN) です。  
*タイプ*: 文字列  
*必須*: はい  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::Function` `DeadLetterConfig` データ型の `[TargetArn](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-deadletterconfig.html#cfn-lambda-function-deadletterconfig-targetarn)`プロパティに直接渡されます。

 `Type`   <a name="sam-function-deadletterqueue-type"></a>
デッドレターキューのタイプです。  
*有効な値*:`SNS`、`SQS`\$1   
*タイプ*: 文字列  
*必須*: はい  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

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

### DeadLetterQueue
<a name="sam-property-function-deadletterqueue--examples--deadletterqueue"></a>

SNS トピックのデッドレターキューの例です。

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

```
DeadLetterQueue:
  Type: SNS
  TargetArn: arn:aws:sns:us-east-2:123456789012:my-topic
```

# DeploymentPreference
<a name="sam-property-function-deploymentpreference"></a>

段階的な Lambda デプロイを有効にする設定を指定します。段階的な Lambda デプロイの設定の詳細については、「[を使用してサーバーレスアプリケーションを徐々にデプロイする AWS SAM](automating-updates-to-serverless-apps.md)」を参照してください。

**注記**  
`DeploymentPreference` オブジェクトを使用するには、[AWS::Serverless::Function](sam-resource-function.md) で `AutoPublishAlias` を指定する必要があります。指定しない場合は、エラーが発生します。

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

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

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

```
  [Alarms](#sam-function-deploymentpreference-alarms): List
  [Enabled](#sam-function-deploymentpreference-enabled): Boolean
  [Hooks](#sam-function-deploymentpreference-hooks): Hooks
  [PassthroughCondition](#sam-function-deploymentpreference-passthroughcondition): Boolean
  [Role](#sam-function-deploymentpreference-role): String
  [TriggerConfigurations](#sam-function-deploymentpreference-triggerconfigurations): List
  [Type](#sam-function-deploymentpreference-type): String
```

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

 `Alarms`   <a name="sam-function-deploymentpreference-alarms"></a>
デプロイによって発生したエラーによってトリガーされる CloudWatch アラームのリストです。  
このプロパティは、`Fn::If` 組み込み関数を受け入れます。`Fn::If` を使用するテンプレートの例については、このトピックの下部にある「例」セクションを参照してください。  
*タイプ*: リスト  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `Enabled`   <a name="sam-function-deploymentpreference-enabled"></a>
このデプロイプリファレンスが有効になっているかどうかです。  
型: ブール  
*必須:* いいえ  
*デフォルト*: True  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `Hooks`   <a name="sam-function-deploymentpreference-hooks"></a>
トラフィックシフトの前後に実行される検証 Lambda 関数です。  
*タイプ*: [Hooks](sam-property-function-hooks.md)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `PassthroughCondition`   <a name="sam-function-deploymentpreference-passthroughcondition"></a>
True の場合、このデプロイメントプリファレンスが有効な場合、関数の条件が、生成された CodeDeploy リソースに渡されます。通常、これを True に設定する必要があります。そうしないと、関数の条件が False に解決された場合でも、CodeDeploy リソースが作成されます。  
型: ブール  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `Role`   <a name="sam-function-deploymentpreference-role"></a>
CodeDeploy がトラフィックの移行に使用する IAM ロール ARN です。これが提供されている場合、IAM ロールは作成されません。  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `TriggerConfigurations`   <a name="sam-function-deploymentpreference-triggerconfigurations"></a>
デプロイグループに関連付けるトリガー設定のリストです。ライフサイクルイベントについて SNS トピックに通知するために使用されます。  
*タイプ*: リスト  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::CodeDeploy::DeploymentGroup`リソースの `[TriggerConfigurations](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codedeploy-deploymentgroup.html#cfn-codedeploy-deploymentgroup-triggerconfigurations)`プロパティに直接渡されます。

 `Type`   <a name="sam-function-deploymentpreference-type"></a>
現在、デプロイタイプには Linear と Canary の 2 つのカテゴリがあります。使用可能なデプロイタイプの詳細については、「[を使用してサーバーレスアプリケーションを徐々にデプロイする AWS SAM](automating-updates-to-serverless-apps.md)」を参照してください。  
*タイプ*: 文字列  
*必須*: はい  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

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

### pre-traffic hook と post-traffic hook を使用する DeploymentPreference です。
<a name="sam-property-function-deploymentpreference--examples--deploymentpreference-with-pre--and-post-traffic-hooks."></a>

pre-traffic hook と post-traffic hook が含まれるデプロイプリファレンスの例です。

#### YAML
<a name="sam-property-function-deploymentpreference--examples--deploymentpreference-with-pre--and-post-traffic-hooks.--yaml"></a>

```
DeploymentPreference:
  Enabled: true
  Type: Canary10Percent10Minutes 
  Alarms:
    - !Ref: AliasErrorMetricGreaterThanZeroAlarm
    - !Ref: LatestVersionErrorMetricGreaterThanZeroAlarm
  Hooks:
    PreTraffic:
      !Ref: PreTrafficLambdaFunction
    PostTraffic:
      !Ref: PostTrafficLambdaFunction
```

### Fn::If 組み込み関数を使用する DeploymentPreference
<a name="sam-property-function-deploymentpreference--examples--deploymentpreference-with-fn::if-intrinsic-function"></a>

アラームの設定に `Fn::If` を使用するデプロイプリファレンスの例です。この例では、`MyCondition` が `true` の場合は `Alarm1` が設定され、`MyCondition` が `false` の場合は `Alarm2` と `Alarm5` が設定されます。

#### YAML
<a name="sam-property-function-deploymentpreference--examples--deploymentpreference-with-fn::if-intrinsic-function--yaml"></a>

```
DeploymentPreference:
  Enabled: true
  Type: Canary10Percent10Minutes 
  Alarms:
    Fn::If:
      - MyCondition
      - - Alarm1
      - - Alarm2
        - Alarm5
```

# Hooks
<a name="sam-property-function-hooks"></a>

トラフィックシフトの前後に実行される検証 Lambda 関数です。

**注記**  
このプロパティで参照される Lambda 関数は、生成される [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-alias.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-alias.html) リソースの `CodeDeployLambdaAliasUpdate` オブジェクトを設定します。詳細については、*AWS CloudFormation ユーザーガイド*の「[CodeDeployLambdaAliasUpdate Policy](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-updatepolicy.html#cfn-attributes-updatepolicy-codedeploylambdaaliasupdate)」を参照してください。

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

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

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

```
  [PostTraffic](#sam-function-hooks-posttraffic): String
  [PreTraffic](#sam-function-hooks-pretraffic): String
```

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

 `PostTraffic`   <a name="sam-function-hooks-posttraffic"></a>
トラフィックの移行後に実行される Lambda 関数です。  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のプロパティはありません。

 `PreTraffic`   <a name="sam-function-hooks-pretraffic"></a>
トラフィックの移行前に実行される Lambda 関数 です。  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

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

### フック
<a name="sam-property-function-hooks--examples--hooks"></a>

フック関数の例

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

```
Hooks:
  PreTraffic:
    Ref: PreTrafficLambdaFunction
  PostTraffic:
    Ref: PostTrafficLambdaFunction
```

# DurableConfig
<a name="sam-property-function-durableconfig"></a>

 AWS Lambda 関数の永続的な実行設定を構成します。耐久性のある関数は最大 1 年間実行でき、進行状況を自動的にチェックポイントできるため、長時間実行されるワークフローと耐障害性のあるアプリケーションが可能になります。耐久性のある関数の詳細については、「 *AWS Lambda デベロッパーガイド*」の[「Lambda 耐久性のある関数](https://docs.aws.amazon.com/lambda/latest/dg/durable-functions.html)」を参照してください。

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

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

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

```
  [ExecutionTimeout](#sam-function-durableconfig-executiontimeout): Integer
  [RetentionPeriodInDays](#sam-function-durableconfig-retentionperiodindays): Integer
```

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

 `ExecutionTimeout`   <a name="sam-function-durableconfig-executiontimeout"></a>
Lambda が永続的な関数を停止するまでに実行できる時間 (秒単位）。最大は 366 日または 31,622,400 秒です。  
*タイプ:* 整数  
*必須:* はい  
*最小*: 1  
*最大*: 31622400  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::Function` `DurableConfig` データ型の `[ExecutionTimeout](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-durableconfig.html#cfn-lambda-function-durableconfig-executiontimeout)`プロパティに直接渡されます。

 `RetentionPeriodInDays`   <a name="sam-function-durableconfig-retentionperiodindays"></a>
Lambda が履歴を保持する永続的な実行がクローズされてから 1 日から 90 日までの日数。デフォルトは 14 日間です。  
*タイプ:* 整数  
*必須:* いいえ  
*デフォルト*: 14  
*最小*: 1  
*最大*: 90  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::Function` `DurableConfig` データ型の `[RetentionPeriodInDays](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-durableconfig.html#cfn-lambda-function-durableconfig-retentionperiodindays)`プロパティに直接渡されます。

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

### DurableConfig
<a name="sam-property-function-durableconfig--examples--durableconfig"></a>

1 時間の実行タイムアウトと 7 日間の保持期間を持つ関数の永続的な設定例。

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

```
DurableConfig:
  ExecutionTimeout: 3600
  RetentionPeriodInDays: 7
```

# 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
```

# EventSource
<a name="sam-property-function-eventsource"></a>

関数をトリガーするイベントのソースを説明するオブジェクトです。各イベントは、1 つのタイプと、そのタイプに依存する一連のプロパティで構成されます。各イベントソースのプロパティの詳細については、そのタイプに対応するトピックを参照してください。

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

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

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

```
  [Properties](#sam-function-eventsource-properties): AlexaSkill | Api | CloudWatchEvent | CloudWatchLogs | Cognito | DocumentDB | DynamoDB | EventBridgeRule | HttpApi | IoTRule | Kinesis | MQ | MSK | S3 | Schedule | ScheduleV2 | SelfManagedKafka | SNS | SQS
  [Type](#sam-function-eventsource-type): String
```

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

 `Properties`   <a name="sam-function-eventsource-properties"></a>
このイベントマッピングのプロパティを説明するオブジェクトです。プロパティのセットは、定義されたタイプに準拠する必要があります。  
タイプ: [AlexaSkill](sam-property-function-alexaskill.md) \$1 [Api](sam-property-function-api.md) \$1 [CloudWatchEvent](sam-property-function-cloudwatchevent.md) \$1 [CloudWatchLogs](sam-property-function-cloudwatchlogs.md) \$1 [Cognito](sam-property-function-cognito.md) \$1 [DocumentDB](sam-property-function-documentdb.md) \$1 [DynamoDB](sam-property-function-dynamodb.md) \$1 [EventBridgeRule](sam-property-function-eventbridgerule.md) \$1 [HttpApi](sam-property-function-httpapi.md) \$1 [IoTRule](sam-property-function-iotrule.md) \$1 [Kinesis](sam-property-function-kinesis.md) \$1 [MQ](sam-property-function-mq.md) \$1 [MSK](sam-property-function-msk.md) \$1 [S3](sam-property-function-s3.md) \$1 [Schedule](sam-property-function-schedule.md) \$1 [ScheduleV2](sam-property-function-schedulev2.md) \$1 [SelfManagedKafka](sam-property-function-selfmanagedkafka.md) \$1 [SNS](sam-property-function-sns.md) \$1 [SQS](sam-property-function-sqs.md)  
*必須:* はい  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `Type`   <a name="sam-function-eventsource-type"></a>
イベントタイプです。  
有効な値: `AlexaSkill`、`Api`、`CloudWatchEvent`、`CloudWatchLogs`、`Cognito`、`DocumentDB`、`DynamoDB`、`EventBridgeRule`、`HttpApi`、`IoTRule`、`Kinesis`、`MQ`、`MSK`、`S3`、`Schedule`、`ScheduleV2`、`SelfManagedKafka`、`SNS`、`SQS`  
*タイプ*: 文字列  
*必須*: はい  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

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

### APIEvent
<a name="sam-property-function-eventsource--examples--apievent"></a>

API Event の使用例

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

```
ApiEvent:
  Type: Api
  Properties:
    Method: get
    Path: /group/{user}
    RestApiId: 
      Ref: MyApi
```

# AlexaSkill
<a name="sam-property-function-alexaskill"></a>

`AlexaSkill` イベントソースタイプを説明するオブジェクトです。

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

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

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

```
  [SkillId](#sam-function-alexaskill-skillid): String
```

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

 `SkillId`   <a name="sam-function-alexaskill-skillid"></a>
Alexa Skill の Alexa Skill ID です。Skill ID の詳細については、Alexa Skills Kit ドキュメントの「[Lambda 関数のトリガー設定](https://developer.amazon.com/docs/custom-skills/host-a-custom-skill-as-an-aws-lambda-function.html#configuring-the-alexa-skills-kit-trigger)」を参照してください。  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

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

### AlexaSkillTrigger
<a name="sam-property-function-alexaskill--examples--alexaskilltrigger"></a>

Alexa Skill イベントの例

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

```
AlexaSkillEvent:
  Type: AlexaSkill
```

# Api
<a name="sam-property-function-api"></a>

`Api` イベントソースタイプを説明するオブジェクトです。[AWS::Serverless::Api](sam-resource-api.md) リソースが定義されている場合、パスとメソッドの値は、API の OpenApi 定義にあるオペレーションに対応している必要があります。

[AWS::Serverless::Api](sam-resource-api.md) が定義されていない場合、関数の入出力は HTTP リクエストと HTTP レスポンスの表現です。

例えば、JavaScript API を使用すると、statusCode および body キーを持つオブジェクトを返すことによって、レスポンスのステータスコードと本文を制御できます。

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

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

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

```
  [Auth](#sam-function-api-auth): ApiFunctionAuth
  [Method](#sam-function-api-method): String
  [Path](#sam-function-api-path): String
  [RequestModel](#sam-function-api-requestmodel): RequestModel
  [RequestParameters](#sam-function-api-requestparameters): List of [ String | RequestParameter ]
  [RestApiId](#sam-function-api-restapiid): String
  [ResponseTransferMode](#sam-function-api-responsetransfermode): String
  TimeoutInMillis: Integer
```

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

 `Auth`   <a name="sam-function-api-auth"></a>
この特定の Api とパスとメソッドの認証設定です。  
`DefaultAuthorizer` が指定されていない場合に個々のパス上にある API の `DefaultAuthorizer` 設定の認証設定を上書きする、またはデフォルトの `ApiKeyRequired` 設定を上書きするために役立ちます。  
*タイプ*: [ApiFunctionAuth](sam-property-function-apifunctionauth.md)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `Method`   <a name="sam-function-api-method"></a>
この関数が呼び出される HTTP メソッドです。オプションには `DELETE`、`GET`、`HEAD`、`OPTIONS`、`PATCH`、`POST`、`PUT`、および `ANY` があります。詳細については、「*API Gateway デベロッパーガイド*」の「[HTTP メソッドをセットアップする](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-method-settings-method-request.html#setup-method-add-http-method)」を参照してください。  
*タイプ*: 文字列  
*必須*: はい  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `Path`   <a name="sam-function-api-path"></a>
この関数が呼び出される URI パスです。`/` で始まる必要があります。  
*タイプ*: 文字列  
*必須*: はい  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `RequestModel`   <a name="sam-function-api-requestmodel"></a>
この特定の Api とパスとメソッドに使用するリクエストモデルです。これは、[AWS::Serverless::Api](sam-resource-api.md) リソースの `Models` セクションに指定されているモデルの名前を参照する必要があります。  
*タイプ*: [RequestModel](sam-property-function-requestmodel.md)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のプロパティはありません。

 `RequestParameters`   <a name="sam-function-api-requestparameters"></a>
この特定の API、パス、メソッドのリクエストパラメータ設定です。すべてのパラメータ名は `method.request` で始まり `method.request.header`、`method.request.querystring`、または `method.request.path` に制限する必要があります。  
リストには、パラメータ名の文字列と [RequestParameter](sam-property-function-requestparameter.md) オブジェクトの両方を含めることができます。文字列の場合、`Required` および `Caching` プロパティはデフォルトで `false` になります。  
*タイプ*: [ String \$1 [RequestParameter](sam-property-function-requestparameter.md) ] のリスト  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `RestApiId`   <a name="sam-function-api-restapiid"></a>
RestApi リソースの識別子です。これには、指定されたパスとメソッドを持つオペレーションが含まれている必要があります。通常、このテンプレートで定義される [AWS::Serverless::Api](sam-resource-api.md) リソースを参照するように設定されます。  
このプロパティを定義しない場合、 は生成された`OpenApi`ドキュメントを使用してデフォルトの[AWS::Serverless::Api](sam-resource-api.md)リソース AWS SAM を作成します。そのリソースには、`RestApiId` を指定しない同じテンプレート内の `Api` イベントによって定義されるすべてのパスとメソッドの和集合が含まれます。  
これは、別のテンプレートで定義された [AWS::Serverless::Api](sam-resource-api.md) リソースを参照できません。  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

`ResponseTransferMode`  <a name="sam-function-api-responsetransfermode"></a>
Lambda 関数統合のレスポンス転送モード。に設定する`RESPONSE_STREAM`と、API Gateway を介した Lambda レスポンスのストリーミングが有効になり、関数はレスポンスをクライアントにストリーミングできます。に設定すると`RESPONSE_STREAM`、API Gateway は Lambda InvokeWithResponseStreaming API を使用します。  
*タイプ*: 文字列  
*必須:* いいえ  
*有効な値:* `BUFFERED` \$1 `RESPONSE_STREAM`  
*CloudFormation 互換性*: このプロパティは、 の [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigateway-method-integration.html#cfn-apigateway-method-integration-responsetransfermode](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigateway-method-integration.html#cfn-apigateway-method-integration-responsetransfermode)プロパティに直接渡されます`AWS::ApiGateway::Method Integration`。

`TimeoutInMillis`  <a name="sam-function-api-timeoutinmillis"></a>
50～29,000 ミリ秒のカスタムタイムアウトです。  
このプロパティを指定すると、 は OpenAPI 定義 AWS SAM を変更します。OpenAPI の定義は、`DefinitionBody` プロパティを使用してインラインで指定する必要があります。
*タイプ:* 整数  
*必須:* いいえ  
*デフォルト* = 29,000 ミリ秒 (29 秒)  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、同等の CloudFormation ものはありません。

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

### 基本的な の例
<a name="sam-property-function-api--examples--apievent"></a>

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

```
Events:
  ApiEvent:
    Type: Api
    Properties:
      Path: /path
      Method: get
      RequestParameters:
        - method.request.header.Authorization
        - method.request.querystring.keyword:
            Required: true
            Caching: false
```

# ApiFunctionAuth
<a name="sam-property-function-apifunctionauth"></a>

特定の API、パス、およびメソッドに対して、イベントレベルで認可を設定します。

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

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

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

```
  [ApiKeyRequired](#sam-function-apifunctionauth-apikeyrequired): Boolean
  [AuthorizationScopes](#sam-function-apifunctionauth-authorizationscopes): List
  [Authorizer](#sam-function-apifunctionauth-authorizer): String
  [InvokeRole](#sam-function-apifunctionauth-invokerole): String
  OverrideApiAuth: Boolean
  [ResourcePolicy](#sam-function-apifunctionauth-resourcepolicy): ResourcePolicyStatement
```

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

 `ApiKeyRequired`   <a name="sam-function-apifunctionauth-apikeyrequired"></a>
この API、パス、およびメソッドの API キーが必要です。  
型: ブール  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に AWS SAM 固有であり、 CloudFormation 同等のものはありません。

 `AuthorizationScopes`   <a name="sam-function-apifunctionauth-authorizationscopes"></a>
この API、パス、およびメソッドに適用する認可スコープです。  
指定するスコープは、`DefaultAuthorizer` プロパティが適用するスコープ (指定されている場合) を上書きします。  
*タイプ*: リスト  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に AWS SAM 固有であり、 CloudFormation 同等のものはありません。

 `Authorizer`   <a name="sam-function-apifunctionauth-authorizer"></a>
特定の関数用の `Authorizer` です。  
`AWS::Serverless::Api` リソースにグローバルオーソライザーが指定されている場合は、`Authorizer` を `NONE` に設定することでオーソライザーをオーバーライドできます。例については、[Amazon API Gateway REST API のグローバルオーソライザーをオーバーライドする](#sam-property-function-apifunctionauth--examples--override)を参照してください。  
`AWS::Serverless::Api` リソースの `DefinitionBody` プロパティを使用して API を記述する場合は、`Authorizer` で `OverrideApiAuth` を使用してグローバルオーソライザーをオーバーライドする必要があります。詳細については「`OverrideApiAuth`」を参照してください。
*有効な値*: テンプレートで定義されているオーソライザーの`AWS_IAM``NONE`論理 ID AWS SAM 。  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に AWS SAM 固有であり、 CloudFormation 同等のプロパティはありません。

 `InvokeRole`   <a name="sam-function-apifunctionauth-invokerole"></a>
`AWS_IAM` 認可に使用する `InvokeRole` を指定します。  
*タイプ*: 文字列  
*必須:* いいえ  
*デフォルト*: `CALLER_CREDENTIALS`  
*CloudFormation 互換性*: このプロパティは に AWS SAM 固有であり、 CloudFormation 同等のものはありません。  
*追加のメモ*: `CALLER_CREDENTIALS` は `arn:aws:iam:::<user>/` にマップします。これは、発信者の認証情報を使用してエンドポイントを呼び出します。

`OverrideApiAuth`  <a name="sam-function-apifunctionauth-overrideapiauth"></a>
`true` リソースのグローバルオーソライザー設定をオーバーライドするには、`AWS::Serverless::Api` を指定します。このプロパティは、グローバルオーソライザーを指定し、`AWS::Serverless::Api` リソースの `DefinitionBody` プロパティを使用して API を記述する場合にのみ必要です。  
`OverrideApiAuth` として を指定すると`true`、 AWS SAM は `ApiKeyRequired`、、`Authorizer`または に指定された値でグローバルオーソライザーを上書きします`ResourcePolicy`。したがって、`OverrideApiAuth` を使用するときには、これらのプロパティを少なくとも 1 つ指定する必要もあります。例については、[AWS:: Serverless:: Apiの DefinitionBody が指定されている場合にグローバルオーソライザーをオーバーライドする](#sam-property-function-apifunctionauth--examples--override2)を参照してください。
型: ブール  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `ResourcePolicy`   <a name="sam-function-apifunctionauth-resourcepolicy"></a>
この API のパスのためのリソースポリシーを設定します。  
*タイプ*: [ResourcePolicyStatement](sam-property-function-resourcepolicystatement.md)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に AWS SAM 固有であり、 CloudFormation 同等のものはありません。

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

### Function-Auth
<a name="sam-property-function-apifunctionauth--examples--function-auth"></a>

以下の例は、関数レベルで認可を指定します。

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

```
Auth:
  ApiKeyRequired: true
  Authorizer: NONE
```

### Amazon API Gateway REST API のグローバルオーソライザーをオーバーライドする
<a name="sam-property-function-apifunctionauth--examples--override"></a>

`AWS::Serverless::Api` リソースにグローバルオーソライザーを指定できます。以下は、デフォルトのグローバルオーソライザーの設定例です。

```
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
...
Resources:
  MyApiWithLambdaRequestAuth:
    Type: AWS::Serverless::Api
    Properties:
      ...
      Auth:
        Authorizers:
          MyLambdaRequestAuth:
            FunctionArn: !GetAtt MyAuthFn.Arn
        DefaultAuthorizer: MyLambdaRequestAuth
```

 AWS Lambda 関数のデフォルトのオーソライザーを上書きするには、 を `Authorizer`として指定します`NONE`。以下に例を示します。

```
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
...
Resources:
  ...
  MyFn:
    Type: AWS::Serverless::Function
    Properties:
      ...
      Events:
        LambdaRequest:
          Type: Api
          Properties:
            RestApiId: !Ref MyApiWithLambdaRequestAuth
            Method: GET
            Auth:
              Authorizer: NONE
```

### AWS:: Serverless:: Apiの DefinitionBody が指定されている場合にグローバルオーソライザーをオーバーライドする
<a name="sam-property-function-apifunctionauth--examples--override2"></a>

`DefinitionBody` プロパティを使用して `AWS::Serverless::Api` リソースを記述する場合、以前のオーバーライドメソッドは機能しません。以下は、`AWS::Serverless::Api` リソースの `DefinitionBody` プロパティを使用する例です。

```
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
...
Resources:
  MyApiWithLambdaRequestAuth:
    Type: AWS::Serverless::Api
    Properties:
      ...
      DefinitionBody:
        swagger: 2.0
        ...
        paths:
          /lambda-request:
            ...
      Auth:
        Authorizers:
          MyLambdaRequestAuth:
            FunctionArn: !GetAtt MyAuthFn.Arn
        DefaultAuthorizer: MyLambdaRequestAuth
```

グローバルオーソライザーをオーバーライドするには、`OverrideApiAuth` プロパティを使用します。以下は、`OverrideApiAuth` を使用してグローバルオーソライザーを `Authorizer` に指定された値でオーバーライドする例です。

```
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
...
Resources:
  MyApiWithLambdaRequestAuth:
    Type: AWS::Serverless::Api
    Properties:
      ...
      DefinitionBody:
        swagger: 2-0
        ...
        paths:
          /lambda-request:
            ...
      Auth:
        Authorizers:
          MyLambdaRequestAuth:
            FunctionArn: !GetAtt MyAuthFn.Arn
        DefaultAuthorizer: MyLambdaRequestAuth
    
    MyAuthFn:
      Type: AWS::Serverless::Function
      ...
    
    MyFn:
      Type: AWS::Serverless::Function
        Properties:
          ...
          Events:
            LambdaRequest:
              Type: Api
              Properties:
                RestApiId: !Ref MyApiWithLambdaRequestAuth
                Method: GET
                Auth:
                  Authorizer: NONE
                  OverrideApiAuth: true
                Path: /lambda-token
```

# ResourcePolicyStatement
<a name="sam-property-function-resourcepolicystatement"></a>

API 上のすべてのメソッドとパスのリソースポリシーを設定します。リソースポリシーの詳細については、*API Gateway デベロッパーガイド*の「[API Gateway リソースポリシーを使用して API へのアクセスを制御する](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-resource-policies.html)」を参照してください。

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

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

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

```
  [AwsAccountBlacklist](#sam-function-resourcepolicystatement-awsaccountblacklist): List
  [AwsAccountWhitelist](#sam-function-resourcepolicystatement-awsaccountwhitelist): List
  [CustomStatements](#sam-function-resourcepolicystatement-customstatements): List
  [IntrinsicVpcBlacklist](#sam-function-resourcepolicystatement-intrinsicvpcblacklist): List
  [IntrinsicVpcWhitelist](#sam-function-resourcepolicystatement-intrinsicvpcwhitelist): List
  [IntrinsicVpceBlacklist](#sam-function-resourcepolicystatement-intrinsicvpceblacklist): List
  [IntrinsicVpceWhitelist](#sam-function-resourcepolicystatement-intrinsicvpcewhitelist): List
  [IpRangeBlacklist](#sam-function-resourcepolicystatement-iprangeblacklist): List
  [IpRangeWhitelist](#sam-function-resourcepolicystatement-iprangewhitelist): List
  [SourceVpcBlacklist](#sam-function-resourcepolicystatement-sourcevpcblacklist): List
  [SourceVpcWhitelist](#sam-function-resourcepolicystatement-sourcevpcwhitelist): List
```

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

 `AwsAccountBlacklist`   <a name="sam-function-resourcepolicystatement-awsaccountblacklist"></a>
ブロックする AWS アカウント。  
型: 文字列のリスト  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `AwsAccountWhitelist`   <a name="sam-function-resourcepolicystatement-awsaccountwhitelist"></a>
許可する AWS アカウント。このプロパティの使用例については、このページの下部にある「例」セクションを参照してください。  
型: 文字列のリスト  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `CustomStatements`   <a name="sam-function-resourcepolicystatement-customstatements"></a>
この API に適用するカスタムリソースポリシーステートメントのリストです。このプロパティの使用例については、このページの下部にある「例」セクションを参照してください。  
*タイプ*: リスト  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `IntrinsicVpcBlacklist`   <a name="sam-function-resourcepolicystatement-intrinsicvpcblacklist"></a>
ブロックする仮想プライベートクラウド (VPC) のリストで、各 VPC が[動的参照](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/dynamic-references.html)または `Ref` [組み込み関数](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-ref.html)などのリファレンスとして指定されます。このプロパティの使用例については、このページの下部にある「例」セクションを参照してください。  
*タイプ*: リスト  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `IntrinsicVpcWhitelist`   <a name="sam-function-resourcepolicystatement-intrinsicvpcwhitelist"></a>
許可する VPC のリストで、各 VPC が[動的参照](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/dynamic-references.html)または `Ref` [組み込み関数](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-ref.html)などのリファレンスとして指定されます。  
*タイプ*: リスト  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `IntrinsicVpceBlacklist`   <a name="sam-function-resourcepolicystatement-intrinsicvpceblacklist"></a>
ブロックする VPC エンドポイントのリストで、各 VPC エンドポイントが[動的参照](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/dynamic-references.html)または `Ref` [組み込み関数](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-ref.html)などのリファレンスとして指定されます。  
*タイプ*: リスト  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のプロパティはありません。

 `IntrinsicVpceWhitelist`   <a name="sam-function-resourcepolicystatement-intrinsicvpcewhitelist"></a>
許可する VPC エンドポイントのリストで、各 VPC エンドポイントが[動的参照](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/dynamic-references.html)または `Ref` [組み込み関数](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-ref.html)などのリファレンスとして指定されます。このプロパティの使用例については、このページの下部にある「例」セクションを参照してください。  
*タイプ*: リスト  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `IpRangeBlacklist`   <a name="sam-function-resourcepolicystatement-iprangeblacklist"></a>
ブロックする IP アドレスまたはアドレス範囲です。このプロパティの使用例については、このページの下部にある「例」セクションを参照してください。  
*タイプ*: リスト  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `IpRangeWhitelist`   <a name="sam-function-resourcepolicystatement-iprangewhitelist"></a>
許可する IP アドレスまたはアドレス範囲です。  
*タイプ*: リスト  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `SourceVpcBlacklist`   <a name="sam-function-resourcepolicystatement-sourcevpcblacklist"></a>
ブロックするソース VPC またはソース VPC エンドポイントです。ソース VPC 名は `"vpc-"` で始まり、ソース VPC エンドポイント名は `"vpce-"` で始まる必要があります。このプロパティの使用例については、このページの下部にある「例」セクションを参照してください。  
*タイプ*: リスト  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `SourceVpcWhitelist`   <a name="sam-function-resourcepolicystatement-sourcevpcwhitelist"></a>
許可するソース VPC またはソース VPC エンドポイントです。ソース VPC 名は `"vpc-"` で始まり、ソース VPC エンドポイント名は `"vpce-"` で始まる必要があります。  
*タイプ*: リスト  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

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

### リソースポリシーの例
<a name="sam-property-function-resourcepolicystatement--examples--resource-policy-example"></a>

次の例では、2 つの IP アドレスとソース VPC をブロックし、 AWS アカウントを許可します。

#### YAML
<a name="sam-property-function-resourcepolicystatement--examples--resource-policy-example--yaml"></a>

```
Auth:
  ResourcePolicy:
    CustomStatements: [{
                         "Effect": "Allow",
                         "Principal": "*",
                         "Action": "execute-api:Invoke",
                         "Resource": "execute-api:/Prod/GET/pets",
                         "Condition": {
                           "IpAddress": {
                             "aws:SourceIp": "1.2.3.4"
                           }
                         }
                       }]
    IpRangeBlacklist:
      - "10.20.30.40"
      - "1.2.3.4"
    SourceVpcBlacklist:
      - "vpce-1a2b3c4d"
    AwsAccountWhitelist:
      - "111122223333"
    IntrinsicVpcBlacklist:
      - "{{resolve:ssm:SomeVPCReference:1}}" 
      - !Ref MyVPC
    IntrinsicVpceWhitelist:
      - "{{resolve:ssm:SomeVPCEReference:1}}" 
      - !Ref MyVPCE
```

# RequestModel
<a name="sam-property-function-requestmodel"></a>

特定の API とパスとメソッドのリクエストモデルを設定します。

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

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

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

```
  [Model](#sam-function-requestmodel-model): String
  [Required](#sam-function-requestmodel-required): Boolean
  [ValidateBody](#sam-function-requestmodel-validatebody): Boolean
  [ValidateParameters](#sam-function-requestmodel-validateparameters): Boolean
```

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

 `Model`   <a name="sam-function-requestmodel-model"></a>
[AWS::Serverless::Api](sam-resource-api.md) の Models プロパティで定義されたモデルの名前です。  
*タイプ*: 文字列  
*必須*: はい  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `Required`   <a name="sam-function-requestmodel-required"></a>
指定された API エンドポイントの OpenAPI 定義のパラメータセクションに `required` プロパティを追加します。  
型: ブール  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `ValidateBody`   <a name="sam-function-requestmodel-validatebody"></a>
API Gateway が `Model` を使用してリクエストボディを検証するかどうかを指定します。詳細については、*API Gateway デベロッパーガイド*の[API Gateway でリクエストに対する検証を有効にする](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-method-request-validation.html)を参照してください。  
型: ブール  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `ValidateParameters`   <a name="sam-function-requestmodel-validateparameters"></a>
API Gateway が `Model` を使用してリクエストパスのパラメータ、クエリ文字列、ヘッダーを検証するかどうかを指定します。詳細については、*API Gateway デベロッパーガイド*の[API Gateway でリクエストに対する検証を有効にする](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-method-request-validation.html)を参照してください。  
型: ブール  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

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

### リクエストモデル
<a name="sam-property-function-requestmodel--examples--request-model"></a>

リクエストモデルの例

#### YAML
<a name="sam-property-function-requestmodel--examples--request-model--yaml"></a>

```
RequestModel:
  Model: User
  Required: true
  ValidateBody: true
  ValidateParameters: true
```

# RequestParameter
<a name="sam-property-function-requestparameter"></a>

特定の Api とパスとメソッドのリクエストパラメータを設定します。

リクエストパラメータには、`Required` または `Caching` プロパティを指定する必要があります

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

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

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

```
  [Caching](#sam-function-requestparameter-caching): Boolean
  [Required](#sam-function-requestparameter-required): Boolean
```

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

 `Caching`   <a name="sam-function-requestparameter-caching"></a>
API Gateway OpenApi 定義に `cacheKeyParameters` セクションを追加します。  
型: ブール  
*必須*: 条件に応じて異なります  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `Required`   <a name="sam-function-requestparameter-required"></a>
このフィールドは、パラメータが必須かどうかを指定します。  
型: ブール  
*必須*: 条件に応じて異なります  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

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

### リクエストパラメータ
<a name="sam-property-function-requestparameter--examples--request-parameter"></a>

リクエストパラメータの設定例

#### YAML
<a name="sam-property-function-requestparameter--examples--request-parameter--yaml"></a>

```
RequestParameters:
  - method.request.header.Authorization:
      Required: true
      Caching: true
```

# CloudWatchEvent
<a name="sam-property-function-cloudwatchevent"></a>

`CloudWatchEvent` イベントソースタイプを説明するオブジェクトです。

AWS Serverless Application Model (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)リソースを生成します。

**重要な注意**: [EventBridgeRule](sam-property-function-eventbridgerule.md)は、 の代わりに使用する優先イベントソースタイプです`CloudWatchEvent`。 `EventBridgeRule`および は、同じ基盤となるサービス、API、 CloudFormation リソース`CloudWatchEvent`を使用します。ただし、 AWS SAM は新機能のサポートを にのみ追加します`EventBridgeRule`。

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

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

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

```
  [Enabled](#sam-function-cloudwatchevent-enabled): Boolean
  [EventBusName](#sam-function-cloudwatchevent-eventbusname): String
  [Input](#sam-function-cloudwatchevent-input): String
  [InputPath](#sam-function-cloudwatchevent-inputpath): String
  [Pattern](#sam-function-cloudwatchevent-pattern): [EventPattern](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-rule.html#cfn-events-rule-eventpattern)
  [State](#sam-function-cloudwatchevent-state): String
```

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

 `Enabled`   <a name="sam-function-cloudwatchevent-enabled"></a>
ルールが有効かどうかを示します。  
ルールを無効にするには、このプロパティを `false` に設定します。  
`Enabled` プロパティと `State` プロパティは、両方ではなく、どちらか一方を指定してください。
型: ブール  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Events::Rule`リソースの `[State](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-rule.html#cfn-events-rule-state)`プロパティに似ています。このプロパティが に設定されている場合、 は `ENABLED`を AWS SAM 渡`true`します。それ以外の場合は を渡します`DISABLED`。

 `EventBusName`   <a name="sam-function-cloudwatchevent-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-function-cloudwatchevent-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-function-cloudwatchevent-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)`プロパティに直接渡されます。

 `Pattern`   <a name="sam-function-cloudwatchevent-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)`プロパティに直接渡されます。

 `State`   <a name="sam-function-cloudwatchevent-state"></a>
ルールの状態。  
使用できる値: `DISABLED | ENABLED`  
`Enabled` プロパティと `State` プロパティは、両方ではなく、どちらか一方を指定してください。
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Events::Rule`リソースの `[State](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-rule.html#cfn-events-rule-state)`プロパティに直接渡されます。

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

### CloudWatchEvent
<a name="sam-property-function-cloudwatchevent--examples--cloudwatchevent"></a>

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

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

```
CWEvent:
  Type: CloudWatchEvent
  Properties:
    Enabled: false
    Input: '{"Key": "Value"}'
    Pattern:
      detail:
        state:
          - running
```

# CloudWatchLogs
<a name="sam-property-function-cloudwatchlogs"></a>

`CloudWatchLogs` イベントソースタイプを説明するオブジェクトです。

このイベントは、[https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-subscriptionfilter.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-subscriptionfilter.html) リソースを生成し、サブスクリプションフィルターを指定して、それを特定のロググループに関連付けます。

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

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

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

```
  [FilterPattern](#sam-function-cloudwatchlogs-filterpattern): String
  [LogGroupName](#sam-function-cloudwatchlogs-loggroupname): String
```

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

 `FilterPattern`   <a name="sam-function-cloudwatchlogs-filterpattern"></a>
送信先 AWS リソースに配信される内容を制限するフィルタリング式。フィルターパターン構文の詳細については、「[フィルターとパターンの構文](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/FilterAndPatternSyntax.html)」を参照してください。  
*タイプ*: 文字列  
*必須*: はい  
*CloudFormation 互換性*: このプロパティは、 `AWS::Logs::SubscriptionFilter`リソースの `[FilterPattern](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-subscriptionfilter.html#cfn-cwl-subscriptionfilter-filterpattern)`プロパティに直接渡されます。

 `LogGroupName`   <a name="sam-function-cloudwatchlogs-loggroupname"></a>
サブスクリプションフィルターに関連付けるロググループです。このロググループにアップロードされたすべてのログイベントは、フィルターパターンがログイベントと一致する場合、フィルタリングされ、指定された AWS リソースに配信されます。  
*タイプ*: 文字列  
*必須*: はい  
*CloudFormation 互換性*: このプロパティは、 `AWS::Logs::SubscriptionFilter`リソースの `[LogGroupName](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-subscriptionfilter.html#cfn-cwl-subscriptionfilter-loggroupname)`プロパティに直接渡されます。

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

### CloudWatchLogs サブスクリプションフィルター
<a name="sam-property-function-cloudwatchlogs--examples--cloudwatchlogs-subscription-filter"></a>

CloudWatchLogs サブスクリプションフィルターの例

#### YAML
<a name="sam-property-function-cloudwatchlogs--examples--cloudwatchlogs-subscription-filter--yaml"></a>

```
CWLog:
  Type: CloudWatchLogs
  Properties:
    LogGroupName:
      Ref: CloudWatchLambdaLogsGroup
    FilterPattern: My pattern
```

# Cognito
<a name="sam-property-function-cognito"></a>

`Cognito` イベントソースタイプを説明するオブジェクトです。

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

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

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

```
  [Trigger](#sam-function-cognito-trigger): List
  [UserPool](#sam-function-cognito-userpool): String
```

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

 `Trigger`   <a name="sam-function-cognito-trigger"></a>
新しいユーザープールのための Lambda トリガーの構成情報です。  
*タイプ*: リスト  
*必須:* はい  
*CloudFormation 互換性*: このプロパティは、 `AWS::Cognito::UserPool`リソースの `[LambdaConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cognito-userpool-lambdaconfig.html)`プロパティに直接渡されます。

 `UserPool`   <a name="sam-function-cognito-userpool"></a>
同じテンプレートで定義された UserPool へのリファレンスです。  
*タイプ*: 文字列  
*必須*: はい  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

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

### Cognito イベント
<a name="sam-property-function-cognito--examples--cognito-event"></a>

Cognito イベントの例

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

```
CognitoUserPoolPreSignup:
  Type: Cognito
  Properties:
    UserPool:
      Ref: MyCognitoUserPool
    Trigger: PreSignUp
```

# DocumentDB
<a name="sam-property-function-documentdb"></a>

`DocumentDB` イベントソースタイプを説明するオブジェクトです。詳細については、「 *AWS Lambda デベロッパーガイド*」の[Amazon DocumentDB AWS Lambda での の使用](https://docs.aws.amazon.com/lambda/latest/dg/with-documentdb.html)」を参照してください。

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

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

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

```
BatchSize: Integer
Cluster: [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-filtercriteria.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-filtercriteria.html)
CollectionName: String
DatabaseName: String
Enabled: Boolean
FilterCriteria: [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-filtercriteria.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-filtercriteria.html)
FullDocument: String
KmsKeyArn: String  
MaximumBatchingWindowInSeconds: Integer
SecretsManagerKmsKeyId: String
SourceAccessConfigurations: List
StartingPosition: String
StartingPositionTimestamp: Double
```

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

 `BatchSize`   <a name="sam-function-documentdb-batchsize"></a>
単一のバッチで取得する項目の最大数です。  
*タイプ:* 整数  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventSourceMapping`リソースの `[ BatchSize](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-batchsize)`プロパティに直接渡されます。

 `Cluster`   <a name="sam-function-documentdb-cluster"></a>
Amazon DocumentDB クラスターの Amazon リソースネーム (ARN)。  
*タイプ*: 文字列  
*必須*: はい  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventSourceMapping`リソースの `[ EventSourceArn](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-eventsourcearn)`プロパティに直接渡されます。

 `CollectionName`   <a name="sam-function-documentdb-collectionname"></a>
データベース内で使用するコレクションの名前。コレクションを指定しない場合、Lambda はすべてのコレクションを使用します。  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventSourceMapping` `DocumentDBEventSourceConfig` データ型の `[ CollectionName](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-documentdbeventsourceconfig.html#cfn-lambda-eventsourcemapping-documentdbeventsourceconfig-collectionname)`プロパティに直接渡されます。

 `DatabaseName`   <a name="sam-function-documentdb-databasename"></a>
Amazon DocumentDB クラスター内で使用するデータベースの名前。  
*タイプ*: 文字列  
*必須*: はい  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventSourceMapping` `DocumentDBEventSourceConfig`データ型の `[ DatabaseName](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-documentdbeventsourceconfig.html#cfn-lambda-eventsourcemapping-documentdbeventsourceconfig-databasename)`プロパティに直接渡されます。

 `Enabled`   <a name="sam-function-documentdb-enabled"></a>
`true` の場合、イベントソースマッピングがアクティブになります。ポーリングと呼び出しを一時停止するには、`false` に設定します。  
型: ブール  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventSourceMapping`リソースの `[ Enabled](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-enabled)`プロパティに直接渡されます。

 `FilterCriteria`   <a name="sam-function-documentdb-filtercriteria"></a>
Lambda がイベントを処理する必要があるかどうかを判断する基準を定義するオブジェクト。詳細については、「AWS Lambda デベロッパーガイド」の「[Lambda イベントのフィルタリング](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html)」を参照してください。  
*タイプ*: [FilterCriteria](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-filtercriteria.html)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventSourceMapping`リソースの `[ FilterCriteria](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-filtercriteria.html)`プロパティに直接渡されます。

 `FullDocument`   <a name="sam-function-documentdb-fulldocument"></a>
ドキュメントの更新オペレーション中に Amazon DocumentDB がイベントストリームに送信する内容を決定します。[`UpdateLookup`] に設定すると、Amazon DocumentDB は、ドキュメント全体のコピーとともに、変更について記述するデルタを送信します。それ以外の場合、Amazon DocumentDB は、変更を含む部分的なドキュメントのみを送信します。  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventSourceMapping` `DocumentDBEventSourceConfig` データ型の `[ FullDocument](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-documentdbeventsourceconfig.html#cfn-lambda-eventsourcemapping-documentdbeventsourceconfig-fulldocument)`プロパティに直接渡されます。

 `KmsKeyArn`   <a name="sam-function-documentdb-kmskeyarn"></a>
このイベントに関連する情報を暗号化するためのキーの Amazon リソースネーム (ARN)。  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventSourceMapping`リソースの `[KmsKeyArn](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-kmskeyarn)`プロパティに直接渡されます。

 `MaximumBatchingWindowInSeconds`   <a name="sam-function-documentdb-maximumbatchingwindowinseconds"></a>
関数を呼び出すまでのレコード収集の最大時間 (秒) です。  
*タイプ:* 整数  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventSourceMapping`リソースの `[ MaximumBatchingWindowInSeconds](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-maximumbatchingwindowinseconds)`プロパティに直接渡されます。

 `SecretsManagerKmsKeyId`   <a name="sam-function-documentdb-secretsmanagerkmskeyid"></a>
 AWS Secrets Manager からのカスタマーマネージドキーの AWS Key Management Service (AWS KMS) キー ID。`kms:Decrypt` 許可が含まれていない Lambda 実行ロールを使用して Secrets Manager からのカスタマーマネージドキーを使用する場合に必要です。  
このプロパティの値は UUID です。例: `1abc23d4-567f-8ab9-cde0-1fab234c5d67`。  
*タイプ*: 文字列  
*必須*: 条件に応じて異なります  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、同等の CloudFormation ものはありません。

 `SourceAccessConfigurations`   <a name="sam-function-documentdb-sourceaccessconfigurations"></a>
認証プロトコルまたは仮想ホストの配列です。これは、[SourceAccessConfigurations](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-sourceaccessconfiguration.html) データ型を使用して指定します。  
`DocumentDB` イベントソースタイプの場合、有効な設定タイプは `BASIC_AUTH` のみです。  
+ `BASIC_AUTH` – ブローカー認証情報を保存する Secrets Manager シークレットです。このタイプの場合、資格情報は `{"username": "your-username", "password": "your-password"}` 形式にする必要があります。`BASIC_AUTH` タイプのオブジェクトが 1 つだけ許可されます。
*タイプ*: リスト  
*必須:* はい  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventSourceMapping`リソースの `[ SourceAccessConfigurations](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-sourceaccessconfigurations)`プロパティに直接渡されます。

 `StartingPosition`   <a name="sam-function-documentdb-startingposition"></a>
読み取りを開始するストリームの場所です。  
+ `AT_TIMESTAMP` - レコードの読み取りを開始する時間を指定します。
+ `LATEST` - 新しいレコードのみを読み込みます。
+ `TRIM_HORIZON` - 使用可能なすべてのレコードを処理します。
*タイプ*: 文字列  
*必須*: はい  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventSourceMapping`リソースの `[ StartingPosition](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-startingposition)`プロパティに直接渡されます。

 `StartingPositionTimestamp`   <a name="sam-function-documentdb-startingpositiontimestamp"></a>
Unix タイム秒単位で読み取りをスタートする時間。`StartingPosition` が `AT_TIMESTAMP` として指定されている場合の `StartingPositionTimestamp` を定義します。  
型: 倍精度  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventSourceMapping`リソースの `[ StartingPositionTimestamp](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-startingpositiontimestamp)`プロパティに直接渡されます。

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

### Amazon DocumentDB イベントソース
<a name="sam-property-function-documentdb-examples-example1"></a>

```
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
...
Resources:
  MyFunction:
    Type: AWS::Serverless::Function
    Properties:
    ...
      Events:
        MyDDBEvent:
          Type: DocumentDB
          Properties:
            Cluster: "arn:aws:rds:us-west-2:123456789012:cluster:docdb-2023-01-01"
            BatchSize: 10
            MaximumBatchingWindowInSeconds: 5
            DatabaseName: "db1"
            CollectionName: "collection1"
            FullDocument: "UpdateLookup"
            SourceAccessConfigurations:
              - Type: BASIC_AUTH
                URI: "arn:aws:secretsmanager:us-west-2:123456789012:secret:doc-db"
```

# DynamoDB
<a name="sam-property-function-dynamodb"></a>

`DynamoDB` イベントソースタイプを説明するオブジェクトです。詳細については、「 *AWS Lambda デベロッパーガイド*」の[「Amazon DynamoDB AWS Lambda での の使用](https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html)」を参照してください。

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

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

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

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

```
  [BatchSize](#sam-function-dynamodb-batchsize): Integer
  [BisectBatchOnFunctionError](#sam-function-dynamodb-bisectbatchonfunctionerror): Boolean
  [DestinationConfig](#sam-function-dynamodb-destinationconfig): [DestinationConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-destinationconfig)
  [Enabled](#sam-function-dynamodb-enabled): Boolean
  [FilterCriteria](#sam-function-dynamodb-filtercriteria): [FilterCriteria](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-filtercriteria.html)
  [FunctionResponseTypes](#sam-function-dynamodb-functionresponsetypes): List
  KmsKeyArn: String          
  [MaximumBatchingWindowInSeconds](#sam-function-dynamodb-maximumbatchingwindowinseconds): Integer
  [MaximumRecordAgeInSeconds](#sam-function-dynamodb-maximumrecordageinseconds): Integer
  [MaximumRetryAttempts](#sam-function-dynamodb-maximumretryattempts): Integer
  [MetricsConfig](#sam-function-dynamodb-metricsconfig): [MetricsConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-metricsconfig)
  [ParallelizationFactor](#sam-function-dynamodb-parallelizationfactor): Integer
  [StartingPosition](#sam-function-dynamodb-startingposition): String
  StartingPositionTimestamp: Double
  [Stream](#sam-function-dynamodb-stream): String
  [TumblingWindowInSeconds](#sam-function-dynamodb-tumblingwindowinseconds): Integer
```

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

 `BatchSize`   <a name="sam-function-dynamodb-batchsize"></a>
単一のバッチで取得する項目の最大数です。  
*タイプ:* 整数  
*必須:* いいえ  
*デフォルト*: 100  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventSourceMapping`リソースの `[BatchSize](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-batchsize)`プロパティに直接渡されます。  
*最小*: `1`  
*最大*: `1000`

 `BisectBatchOnFunctionError`   <a name="sam-function-dynamodb-bisectbatchonfunctionerror"></a>
関数がエラーを返す場合は、バッチを 2 つに分割して再試行します。  
型: ブール  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventSourceMapping`リソースの `[BisectBatchOnFunctionError](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-bisectbatchonfunctionerror)`プロパティに直接渡されます。

 `DestinationConfig`   <a name="sam-function-dynamodb-destinationconfig"></a>
破棄されたレコードのための Amazon Simple Queue Service (Amazon SQS) キューまたは Amazon Simple Notification Service (Amazon SNS) トピック送信先です。  
*タイプ*: [DestinationConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-destinationconfig)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventSourceMapping`リソースの `[DestinationConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-destinationconfig)`プロパティに直接渡されます。

 `Enabled`   <a name="sam-function-dynamodb-enabled"></a>
ポーリングと呼び出しを一時停止するために、イベントソースマッピングを無効にします。  
型: ブール  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventSourceMapping`リソースの `[Enabled](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-enabled)`プロパティに直接渡されます。

 `FilterCriteria`   <a name="sam-function-dynamodb-filtercriteria"></a>
Lambda がイベントを処理する必要があるかどうかを判断するための基準を定義するオブジェクト。詳細については、*AWS Lambda デベロッパーガイド*の [AWS Lambda イベントのフィルタリング](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html)を参照してください。  
*タイプ*: [FilterCriteria](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-filtercriteria.html)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventSourceMapping`リソースの `[FilterCriteria](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-filtercriteria.html)`プロパティに直接渡されます。

 `FunctionResponseTypes`   <a name="sam-function-dynamodb-functionresponsetypes"></a>
現在イベントソースマッピングに適用されているレスポンスタイプのリストです。詳細については、「AWS Lambda デベロッパーガイド」の「[バッチアイテムの失敗をレポートする](https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html#services-ddb-batchfailurereporting)」を参照してください。  
*有効な値:* `ReportBatchItemFailures`  
*タイプ*: リスト  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventSourceMapping`リソースの `[FunctionResponseTypes](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-functionresponsetypes)`プロパティに直接渡されます。

 `KmsKeyArn`   <a name="sam-function-dynamodb-kmskeyarn"></a>
このイベントに関連する情報を暗号化するためのキーの Amazon リソースネーム (ARN)。  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventSourceMapping`リソースの `[KmsKeyArn](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-kmskeyarn)`プロパティに直接渡されます。

 `MaximumBatchingWindowInSeconds`   <a name="sam-function-dynamodb-maximumbatchingwindowinseconds"></a>
関数を呼び出すまでのレコード収集の最大時間 (秒) です。  
*タイプ:* 整数  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventSourceMapping`リソースの `[MaximumBatchingWindowInSeconds](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-maximumbatchingwindowinseconds)`プロパティに直接渡されます。

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

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

 `MetricsConfig`   <a name="sam-function-dynamodb-metricsconfig"></a>
処理の各ステージをキャプチャするイベントソースマッピングの拡張メトリクスを取得するためのオプトイン設定。例については、[MetricsConfig イベント](#sam-property-function-dynamodb-example-metricsconfigevent)を参照してください。  
*タイプ*: [MetricsConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-metricsconfig)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventSourceMapping`リソースの `[MetricsConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-metricsconfig)`プロパティに直接渡されます。

 `ParallelizationFactor`   <a name="sam-function-dynamodb-parallelizationfactor"></a>
各シャードから同時に処理するバッチの数です。  
*タイプ:* 整数  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventSourceMapping`リソースの `[ParallelizationFactor](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-parallelizationfactor)`プロパティに直接渡されます。

 `StartingPosition`   <a name="sam-function-dynamodb-startingposition"></a>
読み取りを開始するストリームの場所です。  
+ `AT_TIMESTAMP` - レコードの読み取りを開始する時間を指定します。
+ `LATEST` - 新しいレコードのみを読み込みます。
+ `TRIM_HORIZON` - 使用可能なすべてのレコードを処理します。
有効な値: `AT_TIMESTAMP` \$1 `LATEST` \$1 `TRIM_HORIZON`  
*タイプ*: 文字列  
*必須*: はい  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventSourceMapping`リソースの `[StartingPosition](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-startingposition)`プロパティに直接渡されます。

 `StartingPositionTimestamp`   <a name="sam-function-dynamodb-startingpositiontimestamp"></a>
Unix タイム秒単位で読み取りをスタートする時間。`StartingPosition` が `AT_TIMESTAMP` として指定されている場合の `StartingPositionTimestamp` を定義します。  
型: 倍精度  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventSourceMapping`リソースの `[StartingPositionTimestamp](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-startingpositiontimestamp)`プロパティに直接渡されます。

 `Stream`   <a name="sam-function-dynamodb-stream"></a>
DynamoDB Streams の Amazon リソースネーム (ARN) です。  
*タイプ*: 文字列  
*必須*: はい  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventSourceMapping`リソースの `[EventSourceArn](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-eventsourcearn)`プロパティに直接渡されます。

 `TumblingWindowInSeconds`   <a name="sam-function-dynamodb-tumblingwindowinseconds"></a>
処理ウィンドウの継続時間 (秒) です。有効範囲は 1～900 (15 分) です。  
詳細については、*AWS Lambda デベロッパーガイド*の「[タンブリングウィンドウ](https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html#streams-tumbling)」を参照してください。  
*タイプ:* 整数  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventSourceMapping`リソースの `[TumblingWindowInSeconds](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-tumblingwindowinseconds)`プロパティに直接渡されます。

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

### MetricsConfig イベント
<a name="sam-property-function-dynamodb-example-metricsconfigevent"></a>

以下は、`MetricsConfig` プロパティを使用してイベントソースマッピングの各処理ステージをキャプチャするリソースの例です。

```
Resources:
  FilteredEventsFunction:
    Type: AWS::Serverless::Function
    Properties:
      CodeUri: s3://sam-demo-bucket/metricsConfig.zip
      Handler: index.handler
      Runtime: nodejs16.x
      Events:
        KinesisStream:
          Type: Kinesis
          Properties:
            Stream: !GetAtt KinesisStream.Arn
            StartingPosition: LATEST
            MetricsConfig:
              Metrics:
              - EventCount
```

### 既存の DynamoDB テーブル用の DynamoDB イベントソース
<a name="sam-property-function-dynamodb--examples--dynamodb-event-source-for-existing-dynamodb-table"></a>

 AWS アカウント内に既に存在する DynamoDB テーブルの DynamoDB イベントソース。

#### YAML
<a name="sam-property-function-dynamodb--examples--dynamodb-event-source-for-existing-dynamodb-table--yaml"></a>

```
Events:
  DDBEvent:
    Type: DynamoDB
    Properties:
      Stream: arn:aws:dynamodb:us-east-1:123456789012:table/TestTable/stream/2016-08-11T21:21:33.291
      StartingPosition: TRIM_HORIZON
      BatchSize: 10
      Enabled: false
```

### テンプレートで宣言された DynamoDB テーブルの DynamoDB イベント
<a name="sam-property-function-dynamodb--examples--dynamodb-event-for-dynamodb-table-declared-in-template"></a>

同じテンプレートファイルで宣言されている DynamoDB テーブルの DynamoDB イベントです。

#### YAML
<a name="sam-property-function-dynamodb--examples--dynamodb-event-for-dynamodb-table-declared-in-template--yaml"></a>

```
Events:
  DDBEvent:
    Type: DynamoDB
    Properties:
      Stream: 
        !GetAtt MyDynamoDBTable.StreamArn   # This must be the name of a DynamoDB table declared in the same template file
      StartingPosition: TRIM_HORIZON
      BatchSize: 10
      Enabled: false
```

# EventBridgeRule
<a name="sam-property-function-eventbridgerule"></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) リソースを生成します。 AWS SAM また、 は、 が Lambda `EventBridgeRule`を呼び出すために必要な `AWS::Lambda::Permission`リソースを作成します。

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

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

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

```
  [DeadLetterConfig](#sam-function-eventbridgerule-deadletterconfig): DeadLetterConfig
  [EventBusName](#sam-function-eventbridgerule-eventbusname): String
  [Input](#sam-function-eventbridgerule-input): String
  [InputPath](#sam-function-eventbridgerule-inputpath): String
  InputTransformer: [InputTransformer](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-events-rule-inputtransformer.html)
  [Pattern](#sam-function-eventbridgerule-pattern): [EventPattern](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-rule.html#cfn-events-rule-eventpattern)
  [RetryPolicy](#sam-function-eventbridgerule-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](#sam-function-eventbridgerule-target): Target
```

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

 `DeadLetterConfig`   <a name="sam-function-eventbridgerule-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)」を参照してください。  
[AWS::Serverless::Function](sam-resource-function.md) リソースタイプには `DeadLetterQueue` という同じようなデータ型があります。これは、ターゲット Lambda 関数の呼び出しが成功した後で発生する失敗を処理します。これらのタイプの失敗の例には、Lambda のスロットリングや、Lambda ターゲット関数によって返されるエラーなどがあります。`DeadLetterQueue` 関数プロパティの詳細については、「*AWS Lambda デベロッパーガイド*」の「[デッドレターキュー](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html#invocation-dlq)」を参照してください。
*タイプ*: [DeadLetterConfig](sam-property-function-deadletterconfig.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-function-eventbridgerule-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-function-eventbridgerule-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-function-eventbridgerule-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-function-eventbridgerule-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-function-eventbridgerule-pattern"></a>
どのイベントが指定されたターゲットにルーティングされるかを説明します。詳細については、「*Amazon EventBridge User Guide*」の「[Amazon EventBridge events](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-events.html)」と「[EventBridge event patterns](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-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-function-eventbridgerule-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-function-eventbridgerule-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-function-eventbridgerule-state"></a>
ルールの状態。  
*使用できる値*: `DISABLED` \$1 `ENABLED` \$1 `ENABLED_WITH_ALL_CLOUDTRAIL_MANAGEMENT_EVENTS`  
*タイプ*: 文字列  
*必須:* いいえ  
*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-function-eventbridgerule-target"></a>
ルールがトリガーされたときに EventBridge が呼び出す AWS リソース。このプロパティを使用して、ターゲットの論理 ID を指定できます。このプロパティが指定されていない場合、 はターゲットの論理 ID AWS SAM を生成します。  
*タイプ*: [Target](sam-property-function-target.md)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Events::Rule`リソースの `[Targets](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-rule.html#cfn-events-rule-targets)` プロパティに似ています。 `Amazon EC2 RebootInstances API call`はターゲットプロパティの例です。このプロパティの AWS SAM バージョンでは、単一のターゲットの論理 ID しか指定できません。

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

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

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

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

```
EBRule:
  Type: EventBridgeRule
  Properties:
    Input: '{"Key": "Value"}'
    Pattern:
      detail:
        state:
          - terminated
    RetryPolicy:
      MaximumRetryAttempts: 5
      MaximumEventAgeInSeconds: 900
    DeadLetterConfig:
      Type: SQS
      QueueLogicalId: EBRuleDLQ
    Target:
      Id: MyTarget
```

# DeadLetterConfig
<a name="sam-property-function-deadletterconfig"></a>

ターゲットの呼び出しに失敗した後で EventBridge がイベントを送信する Amazon Simple Queue Service (Amazon SQS) キューを指定するために使用されるオブジェクトです。呼び出しは、存在しない Lambda 関数にイベントを送信した場合、または Lambda 関数を呼び出すために十分な許可がない場合などに失敗します。詳細については、*Amazon EventBridge ユーザーガイド*の「[Event retry policy and using dead-letter queues](https://docs.aws.amazon.com/eventbridge/latest/userguide/rule-dlq.html)」を参照してください。

**注記**  
[AWS::Serverless::Function](sam-resource-function.md) リソースタイプには `DeadLetterQueue` という同じようなデータ型があります。これは、ターゲット Lambda 関数の呼び出しが成功した後で発生する失敗を処理します。このタイプの失敗の例には、Lambda のスロットリングや、Lambda ターゲット関数によって返されるエラーなどがあります。関数の `DeadLetterQueue` プロパティの詳細については、「AWS Lambda デベロッパーガイド」の「[デッドレターキュー](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html#invocation-dlq)」を参照してください。

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

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

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

```
  [Arn](#sam-function-deadletterconfig-arn): String
  [QueueLogicalId](#sam-function-deadletterconfig-queuelogicalid): String
  [Type](#sam-function-deadletterconfig-type): String
```

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

 `Arn`   <a name="sam-function-deadletterconfig-arn"></a>
デッドレターキューのターゲットとして指定された Amazon SQS キューの Amazon リソースネーム (ARN) です。  
`Type` プロパティと `Arn` プロパティは、両方ではなく、どちらか一方を指定してください。
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Events::Rule` `DeadLetterConfig` データ型の `[Arn](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-events-rule-deadletterconfig.html#cfn-events-rule-deadletterconfig-arn)`プロパティに直接渡されます。

 `QueueLogicalId`   <a name="sam-function-deadletterconfig-queuelogicalid"></a>
`Type` が指定されている場合に が AWS SAM 作成するデッドレターキューのカスタム名。  
`Type` プロパティが設定されていない場合、このプロパティは無視されます。
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `Type`   <a name="sam-function-deadletterconfig-type"></a>
キューのタイプです。このプロパティが設定されると、 はデッドレターキュー AWS SAM を自動的に作成し、必要な[リソースベースのポリシー](https://docs.aws.amazon.com/eventbridge/latest/userguide/rule-dlq.html#dlq-perms)をアタッチして、キューにイベントを送信するアクセス許可をリソースにルールします。  
`Type` プロパティと `Arn` プロパティは、両方ではなく、どちらか一方を指定してください。
*有効な値:* `SQS`  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

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

### DeadLetterConfig
<a name="sam-property-function-deadletterconfig--examples--deadletterconfig"></a>

DeadLetterConfig

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

```
DeadLetterConfig:
  Type: SQS
  QueueLogicalId: MyDLQ
```

# 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
```

## プロパティ
<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
```

# HttpApi
<a name="sam-property-function-httpapi"></a>

HttpApi タイプのイベントソースを説明するオブジェクトです。

指定したパスとメソッドの OpenApi 定義が API に存在する場合、SAM は Lambda 統合とセキュリティセクション (該当する場合) を追加します。

指定したパスとメソッドの OpenApi 定義が API に存在しない場合は、SAM がこの定義を作成します。

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

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

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

```
  [ApiId](#sam-function-httpapi-apiid): String
  [Auth](#sam-function-httpapi-auth): HttpApiFunctionAuth
  [Method](#sam-function-httpapi-method): String
  [Path](#sam-function-httpapi-path): String
  [PayloadFormatVersion](#sam-function-httpapi-payloadformatversion): String
  [RouteSettings](#sam-function-httpapi-routesettings): [RouteSettings](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigatewayv2-stage.html#cfn-apigatewayv2-stage-routesettings)
  [TimeoutInMillis](#sam-function-httpapi-timeoutinmillis): Integer
```

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

 `ApiId`   <a name="sam-function-httpapi-apiid"></a>
このテンプレートで定義されている [AWS::Serverless::HttpApi](sam-resource-httpapi.md) リソースの識別子です。  
定義されていない場合、生成された OpenApi ドキュメント ([AWS::Serverless::HttpApi](sam-resource-httpapi.md) を指定しないこのテンプレートで定義された Api イベントによって定義されるすべてのパスとメソッドの和集合が含まれるもの) を使用して、`ServerlessHttpApi` と呼ばれるデフォルトの `ApiId` リソースが作成されます。  
これは、別のテンプレートで定義された [AWS::Serverless::HttpApi](sam-resource-httpapi.md) リソースを参照できません。  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `Auth`   <a name="sam-function-httpapi-auth"></a>
この特定の Api とパスとメソッドの認証設定です。  
API の `DefaultAuthorizer` を上書きする、または `DefaultAuthorizer` が指定されていない場合に個々のパス上の認証設定を設定するために役立ちます。  
*タイプ*: [HttpApiFunctionAuth](sam-property-function-httpapifunctionauth.md)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `Method`   <a name="sam-function-httpapi-method"></a>
この関数が呼び出される HTTP メソッドです。  
`Path` と `Method` が指定されていない場合は、SAM がデフォルトの API パスを作成します。このパスは、別のエンドポイントにマップされないリクエストをこの Lambda 関数にルーティングします。これらのデフォルトパスは、API ごとに 1 つしか存在できません。  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `Path`   <a name="sam-function-httpapi-path"></a>
この関数が呼び出される URI パスです。`/` で始まる必要があります。  
`Path` と `Method` が指定されていない場合は、SAM がデフォルトの API パスを作成します。このパスは、別のエンドポイントにマップされないリクエストをこの Lambda 関数にルーティングします。これらのデフォルトパスは、API ごとに 1 つしか存在できません。  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `PayloadFormatVersion`   <a name="sam-function-httpapi-payloadformatversion"></a>
統合に送信されるペイロードの形式を指定します。  
注意: PayloadFormatVersion では OpenAPI 定義の変更に SAM が必要となるため、これが機能するのは `DefinitionBody` で Inline OpenApi が定義されている場合のみです。  
*タイプ*: 文字列  
*必須:* いいえ  
*デフォルト*: 2.0  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `RouteSettings`   <a name="sam-function-httpapi-routesettings"></a>
この HTTP API に対するルートごとのルート設定です。ルート設定の詳細については、*API Gateway デベロッパーガイド*の「[AWS::ApiGatewayV2::Stage RouteSettings](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigatewayv2-stage-routesettings.html)」を参照してください。  
注: RouteSettings が HttpApi リソースとイベントソースの両方で指定されている場合、 はイベントソースプロパティを優先して AWS SAM マージします。  
*Type*: [RouteSettings](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigatewayv2-stage.html#cfn-apigatewayv2-stage-routesettings)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::ApiGatewayV2::Stage`リソースの `[RouteSettings](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigatewayv2-stage.html#cfn-apigatewayv2-stage-routesettings)`プロパティに直接渡されます。

 `TimeoutInMillis`   <a name="sam-function-httpapi-timeoutinmillis"></a>
50～29,000 ミリ秒のカスタムタイムアウトです。  
注意: TimeoutInMillis では OpenAPI 定義の変更に SAM が必要となるため、これが機能するのは `DefinitionBody` で Inline OpenApi が定義されている場合のみです。  
*タイプ:* 整数  
*必須:* いいえ  
デフォルト: 5000  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

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

### デフォルトの HttpApi イベント
<a name="sam-property-function-httpapi--examples--default-httpapi-event"></a>

デフォルトパスを使用する HttpApi イベントです。この API 上にあるマップされていないパスとメソッドのすべてがこのエンドポイントにルーティングされます。

#### YAML
<a name="sam-property-function-httpapi--examples--default-httpapi-event--yaml"></a>

```
Events:
  HttpApiEvent:
    Type: HttpApi
```

### HttpApi
<a name="sam-property-function-httpapi--examples--httpapi"></a>

特定のパスとメソッドを使用する HttpApi イベントです。

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

```
Events:
  HttpApiEvent:
    Type: HttpApi
    Properties:
      Path: /
      Method: GET
```

### HTTP API の認可
<a name="sam-property-function-httpapi--examples--httpapi-authorization"></a>

オーソライザーを使用する HttpApi イベントです。

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

```
Events:
  HttpApiEvent:
    Type: HttpApi
    Properties:
      Path: /authenticated
      Method: GET
      Auth:
        Authorizer: OpenIdAuth
        AuthorizationScopes:
          - scope1
          - scope2
```

# HttpApiFunctionAuth
<a name="sam-property-function-httpapifunctionauth"></a>

イベントレベルでの認可を設定します。

特定の API とパスとメソッドの認証を設定します

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

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

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

```
  [AuthorizationScopes](#sam-function-httpapifunctionauth-authorizationscopes): List
  [Authorizer](#sam-function-httpapifunctionauth-authorizer): String
```

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

 `AuthorizationScopes`   <a name="sam-function-httpapifunctionauth-authorizationscopes"></a>
この API、パス、およびメソッドに適用する認可スコープです。  
ここにリストされているスコープは、`DefaultAuthorizer` によって適用されたスコープを上書きします (存在する場合)。  
*タイプ*: リスト  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `Authorizer`   <a name="sam-function-httpapifunctionauth-authorizer"></a>
特定の関数用の `Authorizer` です。IAM 認証を使用するには、 テンプレートの `Globals` セクションで `EnableIamAuthorizer` の `AWS_IAM` および `true` を指定します。  
API でグローバルオーソライザーを指定しており、特定の関数を公開する場合は、`Authorizer` を `NONE` に設定して上書きします。  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のプロパティはありません。

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

### Function-Auth
<a name="sam-property-function-httpapifunctionauth--examples--function-auth"></a>

関数レベルでの認可の指定

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

```
Auth:
  Authorizer: OpenIdAuth
  AuthorizationScopes:
    - scope1
    - scope2
```

### IAM 認可
<a name="sam-property-function-httpapifunctionauth--examples--iam-authorization"></a>

イベントレベルで IAM 認可を指定します。イベントレベルで `AWS_IAM` 認可を使用するには、テンプレートの `Globals` セクションで `EnableIamAuthorizer` の `true` を指定する必要もあります。詳細については、「[AWS SAM テンプレートのグローバルセクション](sam-specification-template-anatomy-globals.md)」を参照してください。

#### YAML
<a name="sam-property-function-httpapifunctionauth--examples--iam-authorization--yaml"></a>

```
Globals:
  HttpApi:
    Auth:
      EnableIamAuthorizer: true

Resources:
  HttpApiFunctionWithIamAuth:
    Type: AWS::Serverless::Function
    Properties:
      Events:
        ApiEvent:
          Type: HttpApi
          Properties:
            Path: /iam-auth
            Method: GET
            Auth:
              Authorizer: AWS_IAM
      Handler: index.handler
      InlineCode: |
        def handler(event, context):
          return {'body': 'HttpApiFunctionWithIamAuth', 'statusCode': 200}
      Runtime: python3.9
```

# IoTRule
<a name="sam-property-function-iotrule"></a>

`IoTRule` イベントソースタイプを説明するオブジェクトです。

 AWS IoT ルールを宣言する [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iot-topicrule.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iot-topicrule.html)リソースを作成します。詳細については、[CloudFormation ドキュメント](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iot-topicrule.html)を参照してください。

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

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

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

```
  [AwsIotSqlVersion](#sam-function-iotrule-awsiotsqlversion): String
  [Sql](#sam-function-iotrule-sql): String
```

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

 `AwsIotSqlVersion`   <a name="sam-function-iotrule-awsiotsqlversion"></a>
ルールを評価するときに使用する SQL ルールエンジンのバージョンです。  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::IoT::TopicRule TopicRulePayload`リソースの `[AwsIotSqlVersion](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iot-topicrule-topicrulepayload.html#cfn-iot-topicrule-topicrulepayload-awsiotsqlversion)`プロパティに直接渡されます。

 `Sql`   <a name="sam-function-iotrule-sql"></a>
トピックのクエリに使用される SQL ステートメントです。詳細については、[AWS IoT デベロッパーガイド](https://docs.aws.amazon.com/iot/latest/developerguide/iot-rules.html#aws-iot-sql-reference)の *AWS IoT SQL リファレンス*を参照してください。  
*タイプ*: 文字列  
*必須*: はい  
*CloudFormation 互換性*: このプロパティは、 `AWS::IoT::TopicRule TopicRulePayload`リソースの `[Sql](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iot-topicrule-topicrulepayload.html#cfn-iot-topicrule-topicrulepayload-sql)`プロパティに直接渡されます。

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

### IOT Rule
<a name="sam-property-function-iotrule--examples--iot-rule"></a>

IOT Rule の例

#### YAML
<a name="sam-property-function-iotrule--examples--iot-rule--yaml"></a>

```
IoTRule:
  Type: IoTRule
  Properties:
    Sql: SELECT * FROM 'topic/test'
```

# Kinesis
<a name="sam-property-function-kinesis"></a>

`Kinesis` イベントソースタイプを説明するオブジェクトです。詳細については、「 *AWS Lambda デベロッパーガイド*」の[Amazon Kinesis AWS Lambda での の使用](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html)」を参照してください。

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

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

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

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

```
  [BatchSize](#sam-function-kinesis-batchsize): Integer
  [BisectBatchOnFunctionError](#sam-function-kinesis-bisectbatchonfunctionerror): Boolean
  [DestinationConfig](#sam-function-kinesis-destinationconfig): [DestinationConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-destinationconfig)
  [Enabled](#sam-function-kinesis-enabled): Boolean
  [FilterCriteria](#sam-function-kinesis-filtercriteria): [FilterCriteria](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-filtercriteria.html)
  [FunctionResponseTypes](#sam-function-kinesis-functionresponsetypes): List
  KmsKeyArn: String          
  [MaximumBatchingWindowInSeconds](#sam-function-kinesis-maximumbatchingwindowinseconds): Integer
  [MaximumRecordAgeInSeconds](#sam-function-kinesis-maximumrecordageinseconds): Integer
  [MaximumRetryAttempts](#sam-function-kinesis-maximumretryattempts): Integer
  [MetricsConfig](#sam-function-kinesis-metricsconfig): [MetricsConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-metricsconfig)
  [ParallelizationFactor](#sam-function-kinesis-parallelizationfactor): Integer
  [StartingPosition](#sam-function-kinesis-startingposition): String
  StartingPositionTimestamp: Double
  [Stream](#sam-function-kinesis-stream): String
  [TumblingWindowInSeconds](#sam-function-kinesis-tumblingwindowinseconds): Integer
```

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

 `BatchSize`   <a name="sam-function-kinesis-batchsize"></a>
単一のバッチで取得する項目の最大数です。  
*タイプ:* 整数  
*必須:* いいえ  
*デフォルト*: 100  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventSourceMapping`リソースの `[BatchSize](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-batchsize)`プロパティに直接渡されます。  
*最小*: `1`  
*最大*: `10000`

 `BisectBatchOnFunctionError`   <a name="sam-function-kinesis-bisectbatchonfunctionerror"></a>
関数がエラーを返す場合は、バッチを 2 つに分割して再試行します。  
型: ブール  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventSourceMapping`リソースの `[BisectBatchOnFunctionError](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-bisectbatchonfunctionerror)`プロパティに直接渡されます。

 `DestinationConfig`   <a name="sam-function-kinesis-destinationconfig"></a>
破棄されたレコードのための Amazon Simple Queue Service (Amazon SQS) キューまたは Amazon Simple Notification Service (Amazon SNS) トピック送信先です。  
*タイプ*: [DestinationConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-destinationconfig)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventSourceMapping`リソースの `[DestinationConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-destinationconfig)`プロパティに直接渡されます。

 `Enabled`   <a name="sam-function-kinesis-enabled"></a>
ポーリングと呼び出しを一時停止するために、イベントソースマッピングを無効にします。  
型: ブール  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventSourceMapping`リソースの `[Enabled](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-enabled)`プロパティに直接渡されます。

 `FilterCriteria`   <a name="sam-function-kinesis-filtercriteria"></a>
Lambda がイベントを処理する必要があるかどうかを判断するための基準を定義するオブジェクト。詳細については、*AWS Lambda デベロッパーガイド*の [AWS Lambda イベントのフィルタリング](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html)を参照してください。  
*タイプ*: [FilterCriteria](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-filtercriteria.html)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventSourceMapping`リソースの `[FilterCriteria](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-filtercriteria.html)`プロパティに直接渡されます。

 `FunctionResponseTypes`   <a name="sam-function-kinesis-functionresponsetypes"></a>
現在イベントソースマッピングに適用されているレスポンスタイプのリストです。詳細については、「AWS Lambda デベロッパーガイド」の「[バッチアイテムの失敗をレポートする](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html#services-kinesis-batchfailurereporting)」を参照してください。  
*有効な値:* `ReportBatchItemFailures`  
*タイプ*: リスト  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventSourceMapping`リソースの `[FunctionResponseTypes](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-functionresponsetypes)`プロパティに直接渡されます。

 `KmsKeyArn`   <a name="sam-function-kinesis-kmskeyarn"></a>
このイベントに関連する情報を暗号化するためのキーの Amazon リソースネーム (ARN)。  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventSourceMapping`リソースの `[KmsKeyArn](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-kmskeyarn)`プロパティに直接渡されます。

 `MaximumBatchingWindowInSeconds`   <a name="sam-function-kinesis-maximumbatchingwindowinseconds"></a>
関数を呼び出すまでのレコード収集の最大時間 (秒) です。  
*タイプ:* 整数  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventSourceMapping`リソースの `[MaximumBatchingWindowInSeconds](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-maximumbatchingwindowinseconds)`プロパティに直接渡されます。

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

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

 `MetricsConfig`   <a name="sam-function-kinesis-metricsconfig"></a>
処理の各ステージをキャプチャするイベントソースマッピングの拡張メトリクスを取得するためのオプトイン設定。例については、[MetricsConfig イベント](sam-property-function-dynamodb.md#sam-property-function-dynamodb-example-metricsconfigevent)を参照してください。  
*タイプ*: [MetricsConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-metricsconfig)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventSourceMapping`リソースの `[MetricsConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-metricsconfig)`プロパティに直接渡されます。

 `ParallelizationFactor`   <a name="sam-function-kinesis-parallelizationfactor"></a>
各シャードから同時に処理するバッチの数です。  
*タイプ:* 整数  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventSourceMapping`リソースの `[ParallelizationFactor](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-parallelizationfactor)`プロパティに直接渡されます。

 `StartingPosition`   <a name="sam-function-kinesis-startingposition"></a>
読み取りを開始するストリームの場所です。  
+ `AT_TIMESTAMP` - レコードの読み取りを開始する時間を指定します。
+ `LATEST` - 新しいレコードのみを読み込みます。
+ `TRIM_HORIZON` - 使用可能なすべてのレコードを処理します。
有効な値: `AT_TIMESTAMP` \$1 `LATEST` \$1 `TRIM_HORIZON`  
*タイプ*: 文字列  
*必須*: はい  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventSourceMapping`リソースの `[StartingPosition](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-startingposition)`プロパティに直接渡されます。

 `StartingPositionTimestamp`   <a name="sam-function-kinesis-startingpositiontimestamp"></a>
Unix タイム秒単位で読み取りをスタートする時間。`StartingPosition` が `AT_TIMESTAMP` として指定されている場合の `StartingPositionTimestamp` を定義します。  
型: 倍精度  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventSourceMapping`リソースの `[StartingPositionTimestamp](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-startingpositiontimestamp)`プロパティに直接渡されます。

 `Stream`   <a name="sam-function-kinesis-stream"></a>
データストリームまたはストリームコンシューマーの Amazon リソースネーム (ARN) です。  
*タイプ*: 文字列  
*必須*: はい  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventSourceMapping`リソースの `[EventSourceArn](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-eventsourcearn)`プロパティに直接渡されます。

 `TumblingWindowInSeconds`   <a name="sam-function-kinesis-tumblingwindowinseconds"></a>
処理ウィンドウの継続時間 (秒) です。有効範囲は 1～900 (15 分) です。  
詳細については、*AWS Lambda デベロッパーガイド*の「[タンブリングウィンドウ](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html#streams-tumbling)」を参照してください。  
*タイプ:* 整数  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventSourceMapping`リソースの `[TumblingWindowInSeconds](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-tumblingwindowinseconds)`プロパティに直接渡されます。

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

### MetricsConfig イベント
<a name="sam-property-function-kinesis-example-metricsconfigevent"></a>

以下は、`MetricsConfig` プロパティを使用してイベントソースマッピングの各処理ステージをキャプチャするリソースの例です。

```
Resources:
  FilteredEventsFunction:
    Type: AWS::Serverless::Function
    Properties:
      CodeUri: s3://sam-demo-bucket/metricsConfig.zip
      Handler: index.handler
      Runtime: nodejs16.x
      Events:
        KinesisStream:
          Type: Kinesis
          Properties:
            Stream: !GetAtt KinesisStream.Arn
            StartingPosition: LATEST
            MetricsConfig:
              Metrics:
              - EventCount
```

### Kinesis イベントソース
<a name="sam-property-function-kinesis--examples--kinesis-event-source"></a>

以下は、Kinesis イベントソースの例です。

#### YAML
<a name="sam-property-function-kinesis--examples--kinesis-event-source--yaml"></a>

```
Events:
  KinesisEvent:
    Type: Kinesis
    Properties:
      Stream: arn:aws:kinesis:us-east-1:123456789012:stream/my-stream
      StartingPosition: TRIM_HORIZON
      BatchSize: 10
      Enabled: false
      FilterCriteria: 
        Filters: 
          - Pattern: '{"key": ["val1", "val2"]}'
```

# MQ
<a name="sam-property-function-mq"></a>

`MQ` イベントソースタイプを説明するオブジェクトです。詳細については、*AWS Lambda デベロッパーガイド*の「[Amazon MQ での Lambda の使用](https://docs.aws.amazon.com/lambda/latest/dg/with-mq.html)」を参照してください。

AWS Serverless Application Model (AWS SAM) このイベントタイプが設定されている場合、 は [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html)リソースを生成します。

**注記**  
パブリックネットワークで Lambda 関数に接続する仮想プライベートクラウド (VPC) に Amazon MQ キューを配置するには、関数の実行ロールに次の許可が含まれている必要があります。  
`ec2:CreateNetworkInterface`
`ec2:DeleteNetworkInterface`
`ec2:DescribeNetworkInterfaces`
`ec2:DescribeSecurityGroups`
`ec2:DescribeSubnets`
`ec2:DescribeVpcs`
詳細については、*AWS Lambda デベロッパーガイド*の「[実行ロールのアクセス許可](https://docs.aws.amazon.com/lambda/latest/dg/with-mq.html#events-mq-permissions)」を参照してください。

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

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

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

```
  [BatchSize](#sam-function-mq-batchsize): Integer
  [Broker](#sam-function-mq-broker): String
  DynamicPolicyName: Boolean
  [Enabled](#sam-function-mq-enabled): Boolean
  [FilterCriteria](#sam-function-mq-filtercriteria): [FilterCriteria](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-filtercriteria.html)
  KmsKeyArn: String 
  [MaximumBatchingWindowInSeconds](#sam-function-mq-maximumbatchingwindowinseconds): Integer
  [Queues](#sam-function-mq-queues): List
  [SecretsManagerKmsKeyId](#sam-function-mq-secretsmanagerkmskeyid): String
  [SourceAccessConfigurations](#sam-function-mq-sourceaccessconfigurations): List
```

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

 `BatchSize`   <a name="sam-function-mq-batchsize"></a>
単一のバッチで取得する項目の最大数です。  
*タイプ:* 整数  
*必須:* いいえ  
*デフォルト*: 100  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventSourceMapping`リソースの `[BatchSize](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-batchsize)`プロパティに直接渡されます。  
*最小*: `1`  
*最大*: `10000`

 `Broker`   <a name="sam-function-mq-broker"></a>
Amazon MQ ブローカーの Amazon リソースネーム (ARN) です。  
*タイプ*: 文字列  
*必須*: はい  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventSourceMapping`リソースの `[EventSourceArn](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-eventsourcearn)`プロパティに直接渡されます。

 `DynamicPolicyName`   <a name="sam-function-mq-dynamicpolicyname"></a>
デフォルトでは、 AWS Identity and Access Management (IAM) ポリシー名は下位互換性`SamAutoGeneratedAMQPolicy`のために です。IAM ポリシーのために自動生成された名前を使用するには `true` を指定します。この名前には、Amazon MQ イベントソースの論理 ID が含まれます。  
複数の Amazon MQ イベントソースを使用する場合は、IAM ポリシー名の重複を避けるために `true` を指定します。
型: ブール  
*必須:* いいえ  
*デフォルト*: `false`  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `Enabled`   <a name="sam-function-mq-enabled"></a>
`true` の場合、イベントソースマッピングがアクティブになります。ポーリングと呼び出しを一時停止するには、`false` に設定します。  
型: ブール  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventSourceMapping`リソースの `[Enabled](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-enabled)`プロパティに直接渡されます。

 `FilterCriteria`   <a name="sam-function-mq-filtercriteria"></a>
Lambda がイベントを処理する必要があるかどうかを判断する基準を定義するオブジェクト。詳細については、*AWS Lambda デベロッパーガイド*の [AWS Lambda イベントのフィルタリング](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html)を参照してください。  
*タイプ*: [FilterCriteria](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-filtercriteria.html)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventSourceMapping`リソースの `[FilterCriteria](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-filtercriteria.html)`プロパティに直接渡されます。

 `KmsKeyArn`   <a name="sam-function-mq-kmskeyarn"></a>
このイベントに関連する情報を暗号化するためのキーの Amazon リソースネーム (ARN)。  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventSourceMapping`リソースの `[KmsKeyArn](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-kmskeyarn)`プロパティに直接渡されます。

 `MaximumBatchingWindowInSeconds`   <a name="sam-function-mq-maximumbatchingwindowinseconds"></a>
関数を呼び出すまでのレコード収集の最大時間 (秒) です。  
*タイプ:* 整数  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventSourceMapping`リソースの `[MaximumBatchingWindowInSeconds](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-maximumbatchingwindowinseconds)`プロパティに直接渡されます。

 `Queues`   <a name="sam-function-mq-queues"></a>
消費する Amazon MQ ブローカーの送信先キューの名前です。  
*タイプ*: リスト  
*必須:* はい  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventSourceMapping`リソースの `[Queues](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-queues)`プロパティに直接渡されます。

 `SecretsManagerKmsKeyId`   <a name="sam-function-mq-secretsmanagerkmskeyid"></a>
カスタマーマネージドキーの AWS Key Management Service (AWS KMS) キー ID AWS Secrets Manager。`kms:Decrypt` アクセス許可が含まれていない Lambda 実行ロールを使用して Secrets Manager からのカスタマーマネージドキーを使用する場合に必要です。  
このプロパティの値は UUID です。例: `1abc23d4-567f-8ab9-cde0-1fab234c5d67`。  
*タイプ*: 文字列  
*必須*: 条件に応じて異なります  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `SourceAccessConfigurations`   <a name="sam-function-mq-sourceaccessconfigurations"></a>
認証プロトコルまたは仮想ホストの配列です。これは、[SourceAccessConfigurations](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-sourceaccessconfiguration.html) データ型を使用して指定します。  
`MQ` イベントソースタイプの場合、有効な設定タイプは `BASIC_AUTH` と `VIRTUAL_HOST` だけです。  
+ **`BASIC_AUTH`** – ブローカー認証情報を保存する Secrets Manager シークレットです。このタイプの場合、資格情報は `{"username": "your-username", "password": "your-password"}` 形式にする必要があります。`BASIC_AUTH` タイプのオブジェクトが 1 つだけ許可されます。
+ **`VIRTUAL_HOST`** – RabbitMQ ブローカー内の仮想ホストの名前です。Lambda は、この Rabbit MQ のホストをイベントソースとして使用します。`VIRTUAL_HOST` タイプのオブジェクトが 1 つだけ許可されます。
*タイプ*: リスト  
*必須:* はい  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventSourceMapping`リソースの `[SourceAccessConfigurations](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-sourceaccessconfigurations)`プロパティに直接渡されます。

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

### Amazon MQ イベントソース
<a name="sam-property-function-mq--examples--amazon-mq-event-source"></a>

以下は、Amazon MQ ブローカー向けの `MQ` イベントソースタイプの例です。

#### YAML
<a name="sam-property-function-mq--examples--amazon-mq-event-source--yaml"></a>

```
Events:
  MQEvent:
    Type: MQ
    Properties:
      Broker: arn:aws:mq:us-east-2:123456789012:broker:MyBroker:b-1234a5b6-78cd-901e-2fgh-3i45j6k178l9
      Queues: List of queues
      SourceAccessConfigurations:
        - Type: BASIC_AUTH
          URI: arn:aws:secretsmanager:us-east-1:01234567890:secret:MyBrokerSecretName
      BatchSize: 200
      Enabled: true
```

# MSK
<a name="sam-property-function-msk"></a>

`MSK` イベントソースタイプを説明するオブジェクトです。詳細については、「 *AWS Lambda デベロッパーガイド*」の[「Amazon MSK AWS Lambda での の使用](https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html)」を参照してください。

AWS Serverless Application Model (AWS SAM) このイベントタイプが設定されている場合、 は [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html)リソースを生成します。

Schema Registry を使用するには、関数に特定の IAM ロール許可を定義する必要があります。必要な設定の例については、「[Complete setup with IAM roles](#sam-property-function-msk-example-complete)」を参照してください。

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

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

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

```
  [BatchSize](#sam-function-msk-batchsize): Integer
  [BisectBatchOnFunctionError](#sam-function-msk-bisectbatchonfunctionerror): Boolean
  [ConsumerGroupId](#sam-function-msk-consumergroupid): String
  DestinationConfig: [DestinationConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-destinationconfig.html)
  [Enabled](#sam-function-msk-enabled): Boolean
  [FilterCriteria](#sam-function-msk-filtercriteria): [FilterCriteria](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-filtercriteria.html)
  [FunctionResponseTypes](#sam-function-msk-functionresponsetypes): List
  KmsKeyArn: String
  [MaximumBatchingWindowInSeconds](#sam-function-msk-maximumbatchingwindowinseconds): Integer
  [MaximumRecordAgeInSeconds](#sam-function-msk-maximumrecordageinseconds): Integer
  [MaximumRetryAttempts](#sam-function-msk-maximumretryattempts): Integer
  [LoggingConfig](#sam-function-msk-loggingconfig): [LoggingConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-loggingconfig.html)
  [MetricsConfig](#sam-function-msk-metricsconfig): [MetricsConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-metricsconfig.html)
  [ProvisionedPollerConfig](#sam-function-msk-provisionedpollerconfig): [ProvisionedPollerConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-provisionedpollerconfig)
  [SchemaRegistryConfig](#sam-function-msk-schemaregistryconfig): [SchemaRegistryConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-schemaregistryconfig.html)
  SourceAccessConfigurations: [SourceAccessConfigurations](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-sourceaccessconfigurations)
  [StartingPosition](#sam-function-msk-startingposition): String
  StartingPositionTimestamp: Double
  [Stream](#sam-function-msk-stream): String
  [Topics](#sam-function-msk-topics): List
```

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

 `BatchSize`   <a name="sam-function-msk-batchsize"></a>
Lambda がストリームまたはキューから取り出し、関数に送信する各バッチ内の最大レコード数。Lambda は、同期呼び出しのペイロード上限 (6 MB) まで、バッチ内のすべてのレコードを単一の呼び出しで関数に渡します。  
*デフォルト*: 100  
*有効範囲*: 最小値 1。最大値は 10,000 です。  
*タイプ:* 整数  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventSourceMapping`リソースの `[BatchSize](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-batchsize)`プロパティに直接渡されます。

 `BisectBatchOnFunctionError`   <a name="sam-function-msk-bisectbatchonfunctionerror"></a>
関数がエラーを返す場合は、バッチを 2 つに分割して再試行します。  
型: ブール  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventSourceMapping`リソースの `[BisectBatchOnFunctionError](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-bisectbatchonfunctionerror)`プロパティに直接渡されます。

 `ConsumerGroupId`   <a name="sam-function-msk-consumergroupid"></a>
Kafka トピックからイベントを読み取る方法を設定する文字列。  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventSourceMapping`リソースの `[AmazonManagedKafkaConfiguration](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html)`プロパティに直接渡されます。

 `DestinationConfig`   <a name="sam-function-msk-destinationconfig"></a>
Lambda がイベントを処理した後のイベントの送信先を指定する構成オブジェクト。  
このプロパティを使用して、Amazon MSK イベントソースから失敗した呼び出しの送信先を指定します。  
*タイプ*: [DestinationConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-destinationconfig)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventSourceMapping`リソースの `[ DestinationConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-destinationconfig.html)`プロパティに直接渡されます。

 `Enabled`   <a name="sam-function-msk-enabled"></a>
ポーリングと呼び出しを一時停止するために、イベントソースマッピングを無効にします。  
型: ブール  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventSourceMapping`リソースの `[Enabled](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-enabled)`プロパティに直接渡されます。

 `FilterCriteria`   <a name="sam-function-msk-filtercriteria"></a>
Lambda がイベントを処理する必要があるかどうかを判断する基準を定義するオブジェクト。詳細については、*AWS Lambda デベロッパーガイド*の [AWS Lambda イベントのフィルタリング](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html)を参照してください。  
*タイプ*: [FilterCriteria](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-filtercriteria.html)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventSourceMapping`リソースの `[FilterCriteria](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-filtercriteria.html)`プロパティに直接渡されます。

 `FunctionResponseTypes`   <a name="sam-function-msk-functionresponsetypes"></a>
現在イベントソースマッピングに適用されているレスポンスタイプのリストです。詳細については、「AWS Lambda デベロッパーガイド」の「[バッチアイテムの失敗をレポートする](https://docs.aws.amazon.com/lambda/latest/dg/kafka-retry-configurations.html)」を参照してください。  
*有効な値:* `ReportBatchItemFailures`  
*タイプ*: リスト  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventSourceMapping`リソースの `[FunctionResponseTypes](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-functionresponsetypes)`プロパティに直接渡されます。

 `KmsKeyArn`   <a name="sam-function-msk-kmskeyarn"></a>
このイベントに関連する情報を暗号化するためのキーの Amazon リソースネーム (ARN)。  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventSourceMapping`リソースの `[KmsKeyArn](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-kmskeyarn)`プロパティに直接渡されます。

 `MaximumBatchingWindowInSeconds`   <a name="sam-function-msk-maximumbatchingwindowinseconds"></a>
関数を呼び出すまでのレコード収集の最大時間 (秒) です。  
*タイプ:* 整数  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventSourceMapping`リソースの `[MaximumBatchingWindowInSeconds](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-maximumbatchingwindowinseconds)`プロパティに直接渡されます。

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

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

 `LoggingConfig`   <a name="sam-function-msk-loggingconfig"></a>
イベントソースマッピングのログ記録設定を指定する設定オブジェクト。  
*Type*: [LoggingConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-loggingconfig.html)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventSourceMapping`リソースの `[LoggingConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-loggingconfig.html)`プロパティに直接渡されます。

 `MetricsConfig`   <a name="sam-function-msk-metricsconfig"></a>
イベントソースマッピングのメトリクス設定を指定する設定オブジェクト。  
*タイプ*: [MetricsConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-metricsconfig.html)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventSourceMapping`リソースの `[MetricsConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-metricsconfig.html)`プロパティに直接渡されます。

 `ProvisionedPollerConfig`   <a name="sam-function-msk-provisionedpollerconfig"></a>
イベントソースマッピングの計算に使用されるポーラーの数を増やすための設定。この設定では、最小 1 つのポーラーと最大 2000 のポーラーを使用できます。例については、「[ProvisionedPollerConfig の例](#sam-property-function-msk-example-provisionedpollerconfig)」を参照してください。  
*タイプ*: [ProvisionedPollerConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-provisionedpollerconfig)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventSourceMapping`リソースの `[ProvisionedPollerConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-provisionedpollerconfig)`プロパティに直接渡されます。

`SchemaRegistryConfig`  <a name="sam-function-msk-schemaregistryconfig"></a>
Kafka イベントソースでスキーマレジストリを使用するための設定。  
この機能は `ProvisionedPollerConfig` を設定するために必要です。
*タイプ*: SchemaRegistryConfig  
*必須:* いいえ  
*CloudFormation 互換性:* このプロパティは、 `AWS::Lambda::EventSourceMapping`リソースの `[AmazonManagedKafkaEventSourceConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-amazonmanagedkafkaeventsourceconfig)`プロパティに直接渡されます。

 `SourceAccessConfigurations`   <a name="sam-function-msk-sourceaccessconfigurations"></a>
認証プロトコルの配列、VPC コンポーネント、イベントソースを保護して定義する仮想ホスト。  
*有効な値:* `CLIENT_CERTIFICATE_TLS_AUTH`  
型: [SourceAccessConfiguration](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-sourceaccessconfiguration.html) のリスト  
*必須:* いいえ  
*CloudFormation 互換性:* このプロパティは、 `AWS::Lambda::EventSourceMapping`リソースの [AmazonManagedKafkaEventSourceConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/aws-properties-lambda-eventsourcemapping-amazonmanagedkafkaeventsourceconfig) プロパティの一部です。

 `StartingPosition`   <a name="sam-function-msk-startingposition"></a>
読み取りを開始するストリームの場所です。  
+ `AT_TIMESTAMP` - レコードの読み取りを開始する時間を指定します。
+ `LATEST` - 新しいレコードのみを読み込みます。
+ `TRIM_HORIZON` - 使用可能なすべてのレコードを処理します。
有効な値: `AT_TIMESTAMP` \$1 `LATEST` \$1 `TRIM_HORIZON`  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventSourceMapping`リソースの `[StartingPosition](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-startingposition)`プロパティに直接渡されます。

 `StartingPositionTimestamp`   <a name="sam-function-msk-startingpositiontimestamp"></a>
Unix タイム秒単位で読み取りをスタートする時間。`StartingPosition` が `AT_TIMESTAMP` として指定されている場合の `StartingPositionTimestamp` を定義します。  
型: 倍精度  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventSourceMapping`リソースの `[StartingPositionTimestamp](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-startingpositiontimestamp)`プロパティに直接渡されます。

 `Stream`   <a name="sam-function-msk-stream"></a>
データストリームまたはストリームコンシューマーの Amazon リソースネーム (ARN) です。  
*タイプ*: 文字列  
*必須*: はい  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventSourceMapping`リソースの `[EventSourceArn](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-eventsourcearn)`プロパティに直接渡されます。

 `Topics`   <a name="sam-function-msk-topics"></a>
Kafka トピックの名前です。  
*タイプ*: リスト  
*必須:* はい  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventSourceMapping`リソースの `[Topics](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-topics)`プロパティに直接渡されます。

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

### IAM ロールを使用してセットアップを完了する
<a name="sam-property-function-msk-example-complete"></a>

次の例は、Schema Registry を使用するために必要な IAM ロール設定を含む完全なセットアップを示しています。

```
Parameters:
  PreCreatedSubnetOne:
    Type: String
  PreCreatedSubnetTwo:
    Type: String
  MskClusterName4:
    Type: String

Resources:
  MyLambdaExecutionRole:
    Type: AWS::IAM::Role
    Properties:
      AssumeRolePolicyDocument:
        Version: '2012-10-17		 	 	 '
        Statement:
        - Action: [sts:AssumeRole]
          Effect: Allow
          Principal:
            Service: [lambda.amazonaws.com]
      Policies:
      - PolicyName: KafkaClusterPermissions
        PolicyDocument:
          Statement:
          - Action: [kafka:DescribeClusterV2, kafka:GetBootstrapBrokers]
            Effect: Allow
            Resource: 'arn:aws:kafka:us-east-1:123456789012:cluster/*'
      - PolicyName: KafkaAuthPolicy
        PolicyDocument:
          Statement:
          - Action: [secretsmanager:GetSecretValue, kms:Decrypt]
            Effect: "Allow"
            Resource: ['arn:aws:secretsmanager:us-west-2:123456789012:secret:kafkaSecret-******',
                        'arn:aws:kms:us-west-2:123456789012:key/keyId']
      - PolicyName: ENIPolicy
        PolicyDocument:
          Statement:
          - Action: [ec2:CreateNetworkInterface,
              ec2:DescribeNetworkInterfaces, ec2:DescribeVpcs, ec2:DeleteNetworkInterface,
              ec2:DescribeSubnets, ec2:DescribeSecurityGroups]
            Effect: Allow
            Resource: '*'
      - PolicyName: SchemaRegistryPolicy
        PolicyDocument:
          Statement:
          - Action: [glue:GetRegistry]
            Effect: Allow
            Resource: 'arn:aws:glue:{region}:{account-id}:registry/{registry-name}'
      - PolicyName: SchemaVersionsPolicy
        PolicyDocument:
          Statement:
          - Action: [glue:GetSchemaVersions]
            Effect: Allow
            Resource: '*'
      ManagedPolicyArns:
      - !Sub arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole
      Tags:
      - {Value: SAM, Key: lambda:createdBy}

  MyMskCluster:
    Type: AWS::MSK::Cluster
    Properties:
      BrokerNodeGroupInfo:
        ClientSubnets:
        - Ref: PreCreatedSubnetOne
        - Ref: PreCreatedSubnetTwo
        InstanceType: kafka.t3.small
        StorageInfo:
          EBSStorageInfo:
            VolumeSize: 1
      ClusterName:
        Ref: MskClusterName4
      KafkaVersion: 3.8.x
      NumberOfBrokerNodes: 2

  MyMskStreamProcessor:
    Type: AWS::Serverless::Function
    Properties:
      Runtime: nodejs18.x
      Handler: index.handler
      CodeUri: ${codeuri}
      Role:
        Fn::GetAtt: [MyLambdaExecutionRole, Arn]
      Events:
        MyMskEvent:
          Type: MSK
          Properties:
            StartingPosition: LATEST
            Stream:
              Ref: MyMskCluster
            SourceAccessConfigurations:
            - Type: SASL_SCRAM_512_AUTH
              URI: !Sub arn:${AWS::Partition}:secretsmanager:us-west-2:123456789012:secret:my-path/my-secret-name-1a2b3c
            Topics:
            - SchemaRegistryTestTopic
            ProvisionedPollerConfig:
              MinimumPollers: 1
            SchemaRegistryConfig:
              AccessConfigs:
              - Type: BASIC_AUTH
                URI: !Sub arn:${AWS::Partition}:secretsmanager:us-west-2:123456789012:secret:my-path/my-secret-name-1a2b3c
              SchemaValidationConfigs:
              - Attribute: KEY
              EventRecordFormat: JSON
              SchemaRegistryURI: !Sub arn:${AWS::Partition}:glue:us-west-2:123456789012:registry/myregistry
```

### ProvisionedPollerConfig の例
<a name="sam-property-function-msk-example-provisionedpollerconfig"></a>

```
ProvisionedPollerConfig:
  MinimumPollers: 1
  MaximumPollers: 200
```

### 既存のクラスターの Amazon MSK の例
<a name="sam-property-function-msk--examples--amazon-msk-example-for-existing-cluster"></a>

以下は、 AWS アカウントに既に存在する Amazon MSK クラスター用の `MSK` イベントソースタイプの例です。

#### YAML
<a name="sam-property-function-msk--examples--amazon-msk-example-for-existing-cluster--yaml"></a>

```
Events:
  MSKEvent:
    Type: MSK
    Properties:
      StartingPosition: LATEST
      Stream: arn:aws:kafka:us-east-1:012345678012:cluster/exampleClusterName/abcdefab-1234-abcd-5678-cdef0123ab01-2
      Topics:
        - MyTopic
```

### 同じテンプレートで宣言されたクラスターの Amazon MSK の例
<a name="sam-property-function-msk--examples--amazon-msk-example-for-cluster-declared-in-same-template"></a>

以下は、同じテンプレートファイルで宣言されている Amazon MSK クラスター用の `MSK` イベントソースタイプの例です。

#### YAML
<a name="sam-property-function-msk--examples--amazon-msk-example-for-cluster-declared-in-same-template--yaml"></a>

```
Events:
  MSKEvent:
    Type: MSK
    Properties:
      StartingPosition: LATEST
      Stream:
        Ref: MyMskCluster   # This must be the name of an MSK cluster declared in the same template file
      Topics:
        - MyTopic
```

#### スキーマレジストリを使用した MSK イベントソース
<a name="sam-property-function-msk-example-schemaregistry"></a>

以下は、スキーマレジストリを使用して設定された `MSK` イベントソースタイプの例です。

```
Events:
  MSKEvent:
    Type: MSK
    Properties:
      StartingPosition: LATEST
      Stream:
        Ref: MyMskCluster
      Topics:
        - SchemaRegistryTestTopic
      ProvisionedPollerConfig:
        MinimumPollers: 1
      SchemaRegistryConfig:
        SchemaRegistryURI: !Sub arn:${AWS::Partition}:glue:us-west-2:123456789012:registry/myregistry
        EventRecordFormat: JSON
        SchemaValidationConfigs:
          - Attribute: KEY
          - Attribute: VALUE
```

#### Confluent Schema Registry を使用した MSK イベントソース
<a name="sam-property-function-msk-example-schemaregistry-confluent"></a>

以下は、Confluent Schema Registry を使用して設定された `MSK` イベントソースタイプの例です。

```
Events:
  MSKEvent:
    Type: MSK
    Properties:
      StartingPosition: LATEST
      Stream:
        Ref: MyMskCluster
      Topics:
        - SchemaRegistryTestTopic
      ProvisionedPollerConfig:
        MinimumPollers: 1
      SchemaRegistryConfig:
        SchemaRegistryURI: https://my-schema-registry.confluent.cloud
        AccessConfigs:
          - Type: BASIC_AUTH
            URI: !Sub arn:${AWS::Partition}:secretsmanager:us-west-2:123456789012:secret:my-secret
        EventRecordFormat: JSON
        SchemaValidationConfigs:
          - Attribute: KEY
          - Attribute: VALUE
```

# S3
<a name="sam-property-function-s3"></a>

`S3` イベントソースタイプを説明するオブジェクトです。

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

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

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

```
  [Bucket](#sam-function-s3-bucket): String
  [Events](#sam-function-s3-events): String | List
  [Filter](#sam-function-s3-filter): [NotificationFilter](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-notificationconfiguration-config-filter.html)
```

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

 `Bucket`   <a name="sam-function-s3-bucket"></a>
S3 バケット名です。このバケットは、同じテンプレートに存在する必要があります。  
*タイプ*: 文字列  
*必須*: はい  
*CloudFormation 互換性*: このプロパティは、 `AWS::S3::Bucket`リソースの `[BucketName](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket.html#cfn-s3-bucket-name)`プロパティに似ています。これは SAM の必須フィールドです。このフィールドは、このテンプレートで作成された S3 バケットへのリファレンスのみを受け入れます。

 `Events`   <a name="sam-function-s3-events"></a>
Lambda 関数を呼び出す Amazon S3 バケットイベントです。有効な値のリストについては、Amazon S3 の「[サポートされるイベントタイプ](https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html#supported-notification-event-types)」を参照してください。  
*タイプ*: 文字列 \$1 リスト  
*必須:* はい  
*CloudFormation 互換性*: このプロパティは、 `AWS::S3::Bucket` `LambdaConfiguration` データ型の `[Event](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-notificationconfig-lambdaconfig.html#cfn-s3-bucket-notificationconfig-lambdaconfig-event)`プロパティに直接渡されます。

 `Filter`   <a name="sam-function-s3-filter"></a>
どの Amazon S3 オブジェクトが Lambda 関数を呼び出すかを決定するフィルタリングルールです。Amazon S3 キー名によるフィルタリングの詳細については、*Amazon Simple Storage Service ユーザーガイド*で [Amazon S3 イベント通知の設定](https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html)を参照してください。  
*タイプ*: [NotificationFilter](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-notificationconfiguration-config-filter.html)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::S3::Bucket` `LambdaConfiguration` データ型の `[Filter](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-notificationconfiguration-config-filter.html)`プロパティに直接渡されます。

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

### S3 イベント
<a name="sam-property-function-s3--examples--s3-event"></a>

S3 イベントの例です。

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

```
Events:
  S3Event:
    Type: S3
    Properties:
      Bucket:
        Ref: ImagesBucket     # This must be the name of an S3 bucket declared in the same template file
      Events: s3:ObjectCreated:*
      Filter:
        S3Key:
          Rules:
          - Name: prefix      # or "suffix"
            Value: value      # The value to search for in the S3 object key names
```

# Schedule
<a name="sam-property-function-schedule"></a>

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

AWS Serverless Application Model (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)リソースを生成します。

**注記**  
EventBridge では、[Amazon EventBridge Scheduler](https://docs.aws.amazon.com/scheduler/latest/UserGuide/what-is-scheduler.html) という新しいスケジューリング機能が提供されるようになりました。Amazon EventBridge Scheduler はサーバーレススケジューラで、一元化されたマネージドサービスからタスクを作成、実行、管理できます。EventBridge Scheduler は高度にカスタマイズ可能で、EventBridge のスケジュールルールよりもスケーラビリティが高く、ターゲット API オペレーションと AWS のサービスの範囲が広がります。  
スケジュールに従ってターゲットを呼び出すには、EventBridge Scheduler を使用することをお勧めします。 AWS SAM テンプレートでこのイベントソースタイプを定義するには、「」を参照してください[ScheduleV2](sam-property-function-schedulev2.md)。

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

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

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

```
  [DeadLetterConfig](#sam-function-schedule-deadletterconfig): DeadLetterConfig
  [Description](#sam-function-schedule-description): String
  [Enabled](#sam-function-schedule-enabled): Boolean
  [Input](#sam-function-schedule-input): String
  [Name](#sam-function-schedule-name): String
  [RetryPolicy](#sam-function-schedule-retrypolicy): [RetryPolicy](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-events-rule-target.html#cfn-events-rule-target-retrypolicy)
  [Schedule](#sam-function-schedule-schedule): String
  [State](#sam-function-schedule-state): String
```

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

 `DeadLetterConfig`   <a name="sam-function-schedule-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)」を参照してください。  
[AWS::Serverless::Function](sam-resource-function.md) リソースタイプには `DeadLetterQueue` という同じようなデータ型があります。これは、ターゲット Lambda 関数の呼び出しが成功した後で発生する失敗を処理します。これらのタイプの失敗の例には、Lambda のスロットリングや、Lambda ターゲット関数によって返されるエラーなどがあります。`DeadLetterQueue` 関数プロパティの詳細については、「*AWS Lambda デベロッパーガイド*」の「[デッドレターキュー](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html#invocation-dlq)」を参照してください。
*タイプ*: [DeadLetterConfig](sam-property-function-scheduledeadletterconfig.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 を作成する場合に備えて、追加のサブプロパティが含まれています。

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

 `Enabled`   <a name="sam-function-schedule-enabled"></a>
ルールが有効かどうかを示します。  
ルールを無効にするには、このプロパティを `false` に設定します。  
`Enabled` プロパティと `State` プロパティは、両方ではなく、どちらか一方を指定してください。
型: ブール  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Events::Rule`リソースの `[State](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-rule.html#cfn-events-rule-state)`プロパティに似ています。このプロパティが に設定されている場合、 は `ENABLED`を AWS SAM 渡`true`します。それ以外の場合は を渡します`DISABLED`。

 `Input`   <a name="sam-function-schedule-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)`プロパティに直接渡されます。

 `Name`   <a name="sam-function-schedule-name"></a>
 ルールの名前。名前を指定しない場合、 は一意の物理 ID CloudFormation を生成し、その ID をルール名として使用します。  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Events::Rule`リソースの `[Name](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-rule.html#cfn-events-rule-name)`プロパティに直接渡されます。

 `RetryPolicy`   <a name="sam-function-schedule-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)`プロパティに直接渡されます。

 `Schedule`   <a name="sam-function-schedule-schedule"></a>
ルールがいつ、どのくらいの頻度で実行されるかを決定するスケジューリング式です。詳細については、「[Schedule Expressions for Rules](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-create-rule-schedule.html)」を参照してください。  
*タイプ*: 文字列  
*必須*: はい  
*CloudFormation 互換性*: このプロパティは、 `AWS::Events::Rule`リソースの `[ScheduleExpression](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-rule.html#cfn-events-rule-scheduleexpression)`プロパティに直接渡されます。

 `State`   <a name="sam-function-schedule-state"></a>
ルールの状態。  
使用できる値: `DISABLED | ENABLED`  
`Enabled` プロパティと `State` プロパティは、両方ではなく、どちらか一方を指定してください。
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Events::Rule`リソースの `[State](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-rule.html#cfn-events-rule-state)`プロパティに直接渡されます。

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

### CloudWatch スケジュールイベント
<a name="sam-property-function-schedule--examples--cloudwatch-schedule-event"></a>

CloudWatch スケジュールイベントの例

#### YAML
<a name="sam-property-function-schedule--examples--cloudwatch-schedule-event--yaml"></a>

```
CWSchedule:
  Type: Schedule
  Properties:
    Schedule: 'rate(1 minute)'
    Name: TestSchedule
    Description: test schedule
    Enabled: false
```

# DeadLetterConfig
<a name="sam-property-function-scheduledeadletterconfig"></a>

ターゲットの呼び出しに失敗した後で EventBridge がイベントを送信する Amazon Simple Queue Service (Amazon SQS) キューを指定するために使用されるオブジェクトです。呼び出しは、存在しない Lambda 関数にイベントを送信した場合、または Lambda 関数を呼び出すために十分な許可がない場合などに失敗します。詳細については、*Amazon EventBridge ユーザーガイド*の「[Event retry policy and using dead-letter queues](https://docs.aws.amazon.com/eventbridge/latest/userguide/rule-dlq.html)」を参照してください。

**注記**  
[AWS::Serverless::Function](sam-resource-function.md) リソースタイプには `DeadLetterQueue` という同じようなデータ型があります。これは、ターゲット Lambda 関数の呼び出しが成功した後で発生する失敗を処理します。このタイプの失敗の例には、Lambda のスロットリングや、Lambda ターゲット関数によって返されるエラーなどがあります。関数の `DeadLetterQueue` プロパティの詳細については、「AWS Lambda デベロッパーガイド」の「[デッドレターキュー](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html#invocation-dlq)」を参照してください。

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

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

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

```
  [Arn](#sam-function-scheduledeadletterconfig-arn): String
  [QueueLogicalId](#sam-function-scheduledeadletterconfig-queuelogicalid): String
  [Type](#sam-function-scheduledeadletterconfig-type): String
```

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

 `Arn`   <a name="sam-function-scheduledeadletterconfig-arn"></a>
デッドレターキューのターゲットとして指定された Amazon SQS キューの Amazon リソースネーム (ARN) です。  
`Type` プロパティと `Arn` プロパティは、両方ではなく、どちらか一方を指定してください。
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Events::Rule` `DeadLetterConfig` データ型の `[Arn](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-events-rule-deadletterconfig.html#cfn-events-rule-deadletterconfig-arn)`プロパティに直接渡されます。

 `QueueLogicalId`   <a name="sam-function-scheduledeadletterconfig-queuelogicalid"></a>
`Type` が指定されている場合に が AWS SAM 作成するデッドレターキューのカスタム名。  
`Type` プロパティが設定されていない場合、このプロパティは無視されます。
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `Type`   <a name="sam-function-scheduledeadletterconfig-type"></a>
キューのタイプです。このプロパティが設定されると、 はデッドレターキュー AWS SAM を自動的に作成し、必要な[リソースベースのポリシー](https://docs.aws.amazon.com/eventbridge/latest/userguide/rule-dlq.html#dlq-perms)をアタッチして、キューにイベントを送信するアクセス許可をリソースにルールします。  
`Type` プロパティと `Arn` プロパティは、両方ではなく、どちらか一方を指定してください。
*有効な値:* `SQS`  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

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

### DeadLetterConfig
<a name="sam-property-function-scheduledeadletterconfig--examples--deadletterconfig"></a>

DeadLetterConfig

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

```
DeadLetterConfig:
  Type: SQS
  QueueLogicalId: MyDLQ
```

# ScheduleV2
<a name="sam-property-function-schedulev2"></a>

`ScheduleV2` イベントソースタイプを説明するオブジェクトです。これは、サーバーレス関数をスケジュールに従ってトリガーする Amazon EventBridge スケジューライベントのターゲットとして設定します。詳細については、「EventBridge スケジューラユーザーガイド」の「[What is Amazon EventBridge Scheduler?](https://docs.aws.amazon.com/scheduler/latest/UserGuide/what-is-scheduler.html)」(Amazon EventBridge スケジューラとは) を参照してください。

AWS Serverless Application Model (AWS SAM) このイベントタイプが設定されている場合、 は [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-scheduler-schedule.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-scheduler-schedule.html)リソースを生成します。

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

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

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

```
[DeadLetterConfig](#sam-function-schedulev2-deadletterconfig): DeadLetterConfig
[Description](#sam-function-schedulev2-description): String
[EndDate](#sam-function-schedulev2-enddate): String
[FlexibleTimeWindow](#sam-function-schedulev2-flexibletimewindow): FlexibleTimeWindow
[GroupName](#sam-function-schedulev2-groupname): String
[Input](#sam-function-schedulev2-input): String
[KmsKeyArn](#sam-function-schedulev2-kmskeyarn): String
[Name](#sam-function-schedulev2-name): String
OmitName: Boolean
[PermissionsBoundary](#sam-function-schedulev2-permissionsboundary): String
[RetryPolicy](#sam-function-schedulev2-retrypolicy): RetryPolicy
[RoleArn](#sam-function-schedulev2-rolearn): String
[ScheduleExpression](#sam-function-schedulev2-schedule): String
[ScheduleExpressionTimezone](#sam-function-schedulev2-scheduleexpressiontimezone): String
[StartDate](#sam-function-schedulev2-startdate): String
[State](#sam-function-schedulev2-state): String
```

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

 `DeadLetterConfig`   <a name="sam-function-schedulev2-deadletterconfig"></a>
ターゲットの呼び出しに失敗した後で EventBridge がイベントを送信する Amazon Simple Queue Service (Amazon SQS) キューを設定します。呼び出しは、存在しない Lambda 関数にイベントを送信した場合、または Lambda 関数を呼び出すために十分な許可が EventBridge にない場合などに失敗します。詳細については、「EventBridge スケジューラユーザーガイド」の「[Configuring a dead-letter queue for EventBridge Scheduler](https://docs.aws.amazon.com/scheduler/latest/UserGuide/configuring-schedule-dlq.html)」(EventBridge スケジューラのデッドレターキューの設定) を参照してください。  
[AWS::Serverless::Function](sam-resource-function.md) リソースタイプには `DeadLetterQueue` という同じようなデータ型があります。これは、ターゲット Lambda 関数の呼び出しが成功した後で発生する失敗を処理します。これらのタイプの失敗の例には、Lambda のスロットリングや、Lambda ターゲット関数によって返されるエラーなどがあります。`DeadLetterQueue` 関数プロパティの詳細については、「*AWS Lambda デベロッパーガイド*」の「[デッドレターキュー](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html#invocation-dlq)」を参照してください。
*タイプ*: [DeadLetterConfig](sam-property-function-scheduledeadletterconfig.md)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Scheduler::Schedule` `Target` データ型の `[DeadLetterConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-scheduler-schedule-target.html#cfn-scheduler-schedule-target-deadletterconfig)`プロパティに似ています。このプロパティ AWS SAM のバージョンには、デッドレターキュー AWS SAM を作成する場合に備えて、追加のサブプロパティが含まれています。

 `Description`   <a name="sam-function-schedulev2-description"></a>
スケジュールの説明。  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Scheduler::Schedule`リソースの `[Description](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-scheduler-schedule.html#cfn-scheduler-schedule-description)`プロパティに直接渡されます。

 `EndDate`   <a name="sam-function-schedulev2-enddate"></a>
スケジュールがターゲットを呼び出すことができる日付 (UTC)。スケジュールの繰り返し式によっては、指定した **EndDate** またはそれより前に呼び出しが停止する場合があります。  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Scheduler::Schedule`リソースの `[EndDate](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-scheduler-schedule.html#cfn-scheduler-schedule-enddate)`プロパティに直接渡されます。

 `FlexibleTimeWindow`   <a name="sam-function-schedulev2-flexibletimewindow"></a>
スケジュールを呼び出すことができるウィンドウを設定できます。  
*タイプ*: [FlexibleTimeWindow](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-scheduler-schedule.html#cfn-scheduler-schedule-flexibletimewindow)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Scheduler::Schedule`リソースの `[FlexibleTimeWindow](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-scheduler-schedule.html#cfn-scheduler-schedule-flexibletimewindow)`プロパティに直接渡されます。

 `GroupName`   <a name="sam-function-schedulev2-groupname"></a>
このスケジュールに関連付けるスケジュールグループの名前。定義されていない場合、デフォルトグループが使用されます。  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Scheduler::Schedule`リソースの `[GroupName](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-scheduler-schedule.html#cfn-scheduler-schedule-groupname)`プロパティに直接渡されます。

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

 `KmsKeyArn`   <a name="sam-function-schedulev2-kmskeyarn"></a>
お客様のデータの暗号化に使用する KMS キーの ARN。  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Scheduler::Schedule`リソースの `[KmsKeyArn](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-scheduler-schedule.html#cfn-scheduler-schedule-kmskeyarn)`プロパティに直接渡されます。

 `Name`   <a name="sam-function-schedulev2-name"></a>
スケジュールの名前。名前を指定しない場合、 は 形式で名前 AWS SAM を生成`Function-Logical-IDEvent-Source-Name`し、その ID をスケジュール名として使用します。  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Scheduler::Schedule`リソースの `[Name](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-scheduler-schedule.html#cfn-scheduler-schedule-name)`プロパティに直接渡されます。

`OmitName`  <a name="sam-function-schedulev2-omitname"></a>
デフォルトでは、 は *<Function-logical-ID><event-source-name> *形式のスケジュール名 AWS SAM を生成して使用します。このプロパティ`true`を に設定すると、 は一意の物理 ID CloudFormation を生成し、代わりにスケジュール名に使用します。  
型: ブール  
*必須:* いいえ  
*デフォルト*: `false`  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、同等の CloudFormation ものはありません。

 `PermissionsBoundary`   <a name="sam-function-schedulev2-permissionsboundary"></a>
ロールのアクセス許可の境界を設定するために使用するポリシーの ARN。  
`PermissionsBoundary` が定義されている場合、 AWS SAM はスケジューラスケジュールのターゲット IAM ロールに同じ境界を適用します。
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::IAM::Role`リソースの `[PermissionsBoundary](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-role.html#cfn-iam-role-permissionsboundary)`プロパティに直接渡されます。

 `RetryPolicy`   <a name="sam-function-schedulev2-retrypolicy"></a>
再試行ポリシーの設定に関する情報が含まれた **RetryPolicy** オブジェクトです。  
タイプ: [RetryPolicy](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-scheduler-schedule-target.html#cfn-scheduler-schedule-target-retrypolicy)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Scheduler::Schedule` `Target` データ型の `[RetryPolicy](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-scheduler-schedule-target.html#cfn-scheduler-schedule-target-retrypolicy)`プロパティに直接渡されます。

 `RoleArn`   <a name="sam-function-schedulev2-rolearn"></a>
スケジュールが呼び出されたときに EventBridge スケジューラがターゲットとして使用する IAM ロールの ARN。  
*タイプ*: [RoleArn](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-scheduler-schedule-target.html#cfn-scheduler-schedule-target-rolearn)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Scheduler::Schedule` `Target` データ型の `[RoleArn](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-scheduler-schedule-target.html#cfn-scheduler-schedule-target-rolearn)`プロパティに直接渡されます。

 `ScheduleExpression`   <a name="sam-function-schedulev2-scheduleexpression"></a>
スケジューラのスケジュールイベントがいつ、どのくらいの頻度で実行されるかを決定するスケジューリング式です。  
*タイプ*: 文字列  
*必須*: はい  
*CloudFormation 互換性*: このプロパティは、 `AWS::Scheduler::Schedule`リソースの `[ScheduleExpression](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-scheduler-schedule.html#cfn-scheduler-schedule-scheduleexpression)`プロパティに直接渡されます。

 `ScheduleExpressionTimezone`   <a name="sam-function-schedulev2-scheduleexpressiontimezone"></a>
スケジュール式が評価されるタイムゾーン。  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Scheduler::Schedule`リソースの `[ScheduleExpressionTimezone](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-scheduler-schedule.html#cfn-scheduler-schedule-scheduleexpressiontimezone)`プロパティに直接渡されます。

 `StartDate`   <a name="sam-function-schedulev2-startdate"></a>
スケジュールがターゲットの呼び出しを開始できる日付 (UTC)。スケジュールの繰り返し式によっては、指定した **StartDate** またはそれより後に呼び出しが発生する場合があります。  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Scheduler::Schedule`リソースの `[StartDate](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-scheduler-schedule.html#cfn-scheduler-schedule-startdate)`プロパティに直接渡されます。

 `State`   <a name="sam-function-schedulev2-state"></a>
スケジューラのスケジュールの状態。  
使用できる値: `DISABLED | ENABLED`  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Scheduler::Schedule`リソースの `[State](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-scheduler-schedule.html#cfn-scheduler-schedule-state)`プロパティに直接渡されます。

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

### ScheduleV2 リソースを定義する基本的な例
<a name="sam-property-function-schedulev2--examples--example1"></a>

```
Resources:
  Function:
    Properties:
      ...
      Events:
        ScheduleEvent:
          Type: ScheduleV2
          Properties:
            ScheduleExpression: "rate(1 minute)"
        ComplexScheduleEvent:
          Type: ScheduleV2
          Properties:
            ScheduleExpression: rate(1 minute)
            FlexibleTimeWindow:
              Mode: FLEXIBLE
              MaximumWindowInMinutes: 5
            StartDate: '2022-12-28T12:00:00.000Z'
            EndDate: '2023-01-28T12:00:00.000Z'
            ScheduleExpressionTimezone: UTC
            RetryPolicy:
              MaximumRetryAttempts: 5
              MaximumEventAgeInSeconds: 300
            DeadLetterConfig:
              Type: SQS
```

**注記**  
生成された ScheduleV2 の物理 ID には、スタック名は含まれません。

# SelfManagedKafka
<a name="sam-property-function-selfmanagedkafka"></a>

`SelfManagedKafka` イベントソースタイプを説明するオブジェクトです。詳細については、「 *AWS Lambda デベロッパーガイド*」の「[Using AWS Lambda with self-managed Apache Kafka](https://docs.aws.amazon.com/lambda/latest/dg/with-kafka.html)」を参照してください。

AWS Serverless Application Model (AWS SAM) このイベントタイプが設定されている場合、 は [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html)リソースを生成します。

Schema Registry を使用するには、関数に特定の IAM ロール許可を定義する必要があります。必要な設定の例については、「[Complete setup with IAM roles](sam-property-function-msk.md#sam-property-function-msk-example-complete)」を参照してください。

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

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

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

```
  [BatchSize](#sam-function-selfmanagedkafka-batchsize): Integer
  [BisectBatchOnFunctionError](#sam-function-selfmanagedkafka-bisectbatchonfunctionerror): Boolean
  [ConsumerGroupId](#sam-function-selfmanagedkafka-consumergroupid): String
  DestinationConfig: [DestinationConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-destinationconfig.html)
  [Enabled](#sam-function-selfmanagedkafka-enabled): Boolean
  [FilterCriteria](#sam-function-selfmanagedkafka-filtercriteria): [FilterCriteria](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-filtercriteria.html)
  [KafkaBootstrapServers](#sam-function-selfmanagedkafka-kafkabootstrapservers): List
  [FunctionResponseTypes](#sam-function-selfmanagedkafka-functionresponsetypes): List
  KmsKeyArn: String
  [LoggingConfig](#sam-function-selfmanagedkafka-loggingconfig): LoggingConfig
  [MaximumRecordAgeInSeconds](#sam-function-selfmanagedkafka-maximumrecordageinseconds): Integer
  [MaximumRetryAttempts](#sam-function-selfmanagedkafka-maximumretryattempts): Integer
  [MetricsConfig](#sam-function-selfmanagedkafka-metricsconfig): MetricsConfig
  [ProvisionedPollerConfig](#sam-function-selfmanagedkafka-provisionedpollerconfig): [ProvisionedPollerConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-provisionedpollerconfig)
  [SchemaRegistryConfig](#sam-function-selfmanagedkafka-schemaregistryconfig): [SchemaRegistryConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-schemaregistryconfig.html)
  [SourceAccessConfigurations](#sam-function-selfmanagedkafka-sourceaccessconfigurations): [SourceAccessConfigurations](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-sourceaccessconfigurations)
  StartingPosition: String
  StartingPositionTimestamp: Double
  [Topics](#sam-function-selfmanagedkafka-topics): List
```

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

 `BatchSize`   <a name="sam-function-selfmanagedkafka-batchsize"></a>
Lambda がストリームから取り出し、関数に送信する各バッチ内の最大レコード数。  
*タイプ:* 整数  
*必須:* いいえ  
*デフォルト*: 100  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventSourceMapping`リソースの `[BatchSize](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-batchsize)`プロパティに直接渡されます。  
*最小*: `1`  
*最大*: `10000`

 `BisectBatchOnFunctionError`   <a name="sam-function-selfmanagedkafka-bisectbatchonfunctionerror"></a>
関数がエラーを返す場合は、バッチを 2 つに分割して再試行します。  
型: ブール  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventSourceMapping`リソースの `[BisectBatchOnFunctionError](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-bisectbatchonfunctionerror)`プロパティに直接渡されます。

 `ConsumerGroupId`   <a name="sam-function-selfmanagedkafka-consumergroupid"></a>
Kafka トピックからイベントを読み取る方法を設定する文字列。  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventSourceMapping`リソースの `[SelfManagedKafkaEventSourceConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-selfmanagedkafkaeventsourceconfig)`プロパティに直接渡されます。

 `DestinationConfig`   <a name="sam-function-selfmanagedkafka-destinationconfig"></a>
Lambda がイベントを処理した後のイベントの送信先を指定する構成オブジェクト。  
このプロパティを使用して、自己管理型の Kafka イベントソースからの失敗した呼び出しの送信先を指定します。  
*タイプ*: [DestinationConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-destinationconfig.html)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventSourceMapping`リソースの `[ DestinationConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-destinationconfig)`プロパティに直接渡されます。

 `Enabled`   <a name="sam-function-selfmanagedkafka-enabled"></a>
ポーリングと呼び出しを一時停止するために、イベントソースマッピングを無効にします。  
型: ブール  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventSourceMapping`リソースの `[Enabled](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-enabled)`プロパティに直接渡されます。

 `FilterCriteria`   <a name="sam-function-selfmanagedkafka-filtercriteria"></a>
Lambda がイベントを処理する必要があるかどうかを判断するための基準を定義するオブジェクト。詳細については、*AWS Lambda デベロッパーガイド*の [AWS Lambda イベントのフィルタリング](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html)を参照してください。  
*タイプ*: [FilterCriteria](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-filtercriteria.html)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventSourceMapping`リソースの `[FilterCriteria](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-filtercriteria)`プロパティに直接渡されます。

 `KafkaBootstrapServers`   <a name="sam-function-selfmanagedkafka-kafkabootstrapservers"></a>
Kafka ブローカー用のブートストラップサーバーのリスト。ポートを含めます。例: `broker.example.com:xxxx`  
*タイプ*: リスト  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `FunctionResponseTypes`   <a name="sam-function-selfmanagedkafka-functionresponsetypes"></a>
現在イベントソースマッピングに適用されているレスポンスタイプのリストです。詳細については、「AWS Lambda デベロッパーガイド」の「[バッチアイテムの失敗をレポートする](https://docs.aws.amazon.com/lambda/latest/dg/kafka-retry-configurations.html)」を参照してください。  
*有効な値:* `ReportBatchItemFailures`  
*タイプ*: リスト  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventSourceMapping`リソースの `[FunctionResponseTypes](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-functionresponsetypes)`プロパティに直接渡されます。

 `KmsKeyArn`   <a name="sam-function-selfmanagedkafka-kmskeyarn"></a>
このイベントに関連する情報を暗号化するためのキーの Amazon リソースネーム (ARN)。  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventSourceMapping`リソースの `[KmsKeyArn](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-kmskeyarn)`プロパティに直接渡されます。

 `LoggingConfig`   <a name="sam-function-selfmanagedkafka-loggingconfig"></a>
イベントソースのログ記録設定。  
*Type*: [LoggingConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-loggingconfig)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventSourceMapping`リソースの `[LoggingConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-loggingconfig)`プロパティに直接渡されます。

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

 `MetricsConfig`   <a name="sam-function-selfmanagedkafka-metricsconfig"></a>
イベントソースのメトリクス設定。  
*タイプ*: [MetricsConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-metricsconfig)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventSourceMapping`リソースの `[MetricsConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-metricsconfig)`プロパティに直接渡されます。

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

 `ProvisionedPollerConfig`   <a name="sam-function-selfmanagedkafka-provisionedpollerconfig"></a>
イベントソースマッピングの計算に使用されるポーラーの数を増やすための設定。この設定では、少なくとも 1 つのポーラーと最大 2000 のポーラーを使用できます。例については、「[ProvisionedPollerConfig の例](#sam-property-function-selfmanagedkafka-example-provisionedpollerconfig)」を参照してください。  
*タイプ*: [ProvisionedPollerConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-provisionedpollerconfig)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventSourceMapping`リソースの `[ProvisionedPollerConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-provisionedpollerconfig)`プロパティに直接渡されます。

`SchemaRegistryConfig`  <a name="sam-function-selfmanagedkafka-schemaregistryconfig"></a>
セルフマネージド Kafka イベントソースでスキーマレジストリを使用するための設定。  
この機能は `ProvisionedPollerConfig` を設定するために必要です。
*タイプ*: [SchemaRegistryConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-schemaregistryconfig)  
*必須:* いいえ  
*CloudFormation 互換性:* このプロパティは、 `AWS::Lambda::EventSourceMapping`リソースの `[SelfManagedKafkaEventSourceConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-selfmanagedkafkaeventsourceconfig)`プロパティに直接渡されます。

 `SourceAccessConfigurations`   <a name="sam-function-selfmanagedkafka-sourceaccessconfigurations"></a>
認証プロトコルの配列、VPC コンポーネント、イベントソースを保護して定義する仮想ホスト。  
*有効な値:* `BASIC_AUTH | CLIENT_CERTIFICATE_TLS_AUTH | SASL_SCRAM_256_AUTH | SASL_SCRAM_512_AUTH | SERVER_ROOT_CA_CERTIFICATE`  
型: [SourceAccessConfiguration](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-sourceaccessconfiguration) のリスト  
*必須:* はい  
*CloudFormation 互換性:* このプロパティは、 `AWS::Lambda::EventSourceMapping`リソースの `[SelfManagedKafkaEventSourceConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-selfmanagedkafkaeventsourceconfig)`プロパティの一部です。

 `StartingPosition`   <a name="sam-function-selfmanagedkafka-startingposition"></a>
読み取りを開始するストリームの場所です。  
+ `AT_TIMESTAMP` - レコードの読み取りを開始する時間を指定します。
+ `LATEST` - 新しいレコードのみを読み込みます。
+ `TRIM_HORIZON` - 使用可能なすべてのレコードを処理します。
有効な値: `AT_TIMESTAMP` \$1 `LATEST` \$1 `TRIM_HORIZON`  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventSourceMapping`リソースの `[StartingPosition](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-startingposition)`プロパティに直接渡されます。

 `StartingPositionTimestamp`   <a name="sam-function-selfmanagedkafka-startingpositiontimestamp"></a>
Unix タイム秒単位で読み取りをスタートする時間。`StartingPosition` が `AT_TIMESTAMP` として指定されている場合の `StartingPositionTimestamp` を定義します。  
型: 倍精度  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventSourceMapping`リソースの `[StartingPositionTimestamp](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-startingpositiontimestamp)`プロパティに直接渡されます。

 `Topics`   <a name="sam-function-selfmanagedkafka-topics"></a>
Kafka トピックの名前です。  
*タイプ*: リスト  
*必須:* はい  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventSourceMapping`リソースの `[Topics](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-topics)`プロパティに直接渡されます。

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

### IAM ロールを使用してセットアップを完了する
<a name="sam-property-function-selfmanagedkafka-example-complete"></a>

次の例は、Schema Registry を使用するために必要な IAM ロール設定を含む完全なセットアップを示しています。

```
Parameters:
  PreCreatedSubnetOne:
    Type: String
  PreCreatedSubnetTwo:
    Type: String

Resources:
  MyLambdaExecutionRole:
    Type: AWS::IAM::Role
    Properties:
      AssumeRolePolicyDocument:
        Version: '2012-10-17		 	 	 '
        Statement:
        - Action: [sts:AssumeRole]
          Effect: Allow
          Principal:
            Service: [lambda.amazonaws.com]
      Policies:
      - PolicyName: KafkaAuthPolicy
        PolicyDocument:
          Statement:
          - Action: [secretsmanager:GetSecretValue, kms:Decrypt]
            Effect: "Allow"
            Resource: ['arn:aws:secretsmanager:us-west-2:123456789012:secret:kafkaSecret-******',
                        'arn:aws:kms:us-west-2:123456789012:key/keyId']
      - PolicyName: ENIPolicy
        PolicyDocument:
          Statement:
          - Action: [ec2:CreateNetworkInterface,
              ec2:DescribeNetworkInterfaces, ec2:DescribeVpcs, ec2:DeleteNetworkInterface,
              ec2:DescribeSubnets, ec2:DescribeSecurityGroups]
            Effect: Allow
            Resource: '*'
      - PolicyName: SchemaRegistryPolicy
        PolicyDocument:
          Statement:
          - Action: [glue:GetRegistry]
            Effect: Allow
            Resource: 'arn:aws:glue:{region}:{account-id}:registry/{registry-name}'
      - PolicyName: SchemaVersionsPolicy
        PolicyDocument:
          Statement:
          - Action: [glue:GetSchemaVersions]
            Effect: Allow
            Resource: '*'
      ManagedPolicyArns:
      - !Sub arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole
      Tags:
      - {Value: SAM, Key: lambda:createdBy}

  MyKafkaProcessor:
    Type: AWS::Serverless::Function
    Properties:
      Runtime: nodejs18.x
      Handler: index.handler
      CodeUri: ${codeuri}
      Role:
        Fn::GetAtt: [MyLambdaExecutionRole, Arn]
      Events:
        SelfManagedKafkaEvent:
          Type: SelfManagedKafka
          Properties:
            KafkaBootstrapServers:
              - my-kafka-broker-1:9092
              - my-kafka-broker-2:9092
            Topics:
              - SchemaRegistryTestTopic
            StartingPosition: LATEST
            SourceAccessConfigurations:
              - Type: VPC_SUBNET
                URI: subnet:subnet-12345678
              - Type: VPC_SECURITY_GROUP
                URI: security_group:sg-12345678
              - Type: BASIC_AUTH
                URI: !Sub arn:${AWS::Partition}:secretsmanager:us-west-2:123456789012:secret:my-path/my-secret-name-1a2b3c
            ProvisionedPollerConfig:
              MinimumPollers: 1
            SchemaRegistryConfig:
              AccessConfigs:
              - Type: BASIC_AUTH
                URI: !Sub arn:${AWS::Partition}:secretsmanager:us-west-2:123456789012:secret:my-path/my-secret-name-1a2b3c
              SchemaValidationConfigs:
              - Attribute: KEY
              EventRecordFormat: JSON
              SchemaRegistryURI: !Sub arn:${AWS::Partition}:glue:us-west-2:123456789012:registry/myregistry
```

### ProvisionedPollerConfig の例
<a name="sam-property-function-selfmanagedkafka-example-provisionedpollerconfig"></a>

```
ProvisionedPollerConfig:
  MinimumPollers: 1
  MaximumPollers: 200
```

### セルフマネージド型の Kafka イベントソース
<a name="sam-property-function-selfmanagedkafka--examples--self-managed-kafka-event-source"></a>

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

#### YAML
<a name="sam-property-function-selfmanagedkafka--examples--self-managed-kafka-event-source--yaml"></a>

```
Events:
  SelfManagedKafkaEvent:
    Type: SelfManagedKafka
    Properties:
      BatchSize: 1000
      Enabled: true
      KafkaBootstrapServers:
        - abc.xyz.com:xxxx
      SourceAccessConfigurations:
        -  Type: BASIC_AUTH
           URI: arn:aws:secretsmanager:us-west-2:123456789012:secret:my-path/my-secret-name-1a2b3c
      Topics:
        - MyKafkaTopic
```

### AWS Glue Schema Registry を使用したセルフマネージド Kafka イベントソース
<a name="sam-property-function-selfmanagedkafka-example-schemaregistry"></a>

 AWS Glue Schema Registry で設定された`SelfManagedKafka`イベントソースタイプの例を次に示します。

```
Events:
  SelfManagedKafkaEvent:
    Type: SelfManagedKafka
    Properties:
      KafkaBootstrapServers:
        - abc.xyz.com:9092
      Topics:
        - SchemaRegistryTestTopic
      StartingPosition: LATEST
      ProvisionedPollerConfig:
        MinimumPollers: 1
      SchemaRegistryConfig:
        SchemaRegistryURI: !Sub arn:${AWS::Partition}:glue:us-west-2:123456789012:registry/myregistry
        EventRecordFormat: JSON
        SchemaValidationConfigs:
          - Attribute: KEY
          - Attribute: VALUE
      SourceAccessConfigurations:
        - Type: VPC_SUBNET
          URI: subnet:subnet-12345678
        - Type: VPC_SECURITY_GROUP
          URI: security_group:sg-12345678
```

### Confluent Schema Registry を使用したセルフマネージド Kafka イベントソース
<a name="sam-property-function-selfmanagedkafka-example-schemaregistry-confluent"></a>

以下は、Confluent Schema Registry を使用して設定された `SelfManagedKafka` イベントソースタイプの例です。

```
Events:
  SelfManagedKafkaEvent:
    Type: SelfManagedKafka
    Properties:
      KafkaBootstrapServers:
        - abc.xyz.com:9092
      Topics:
        - SchemaRegistryTestTopic
      StartingPosition: LATEST
      ProvisionedPollerConfig:
        MinimumPollers: 1
      SchemaRegistryConfig:
        SchemaRegistryURI: https://my-schema-registry.confluent.cloud
        AccessConfigs:
          - Type: BASIC_AUTH
            URI: !Sub arn:${AWS::Partition}:secretsmanager:us-west-2:123456789012:secret:my-secret
        EventRecordFormat: JSON
        SchemaValidationConfigs:
          - Attribute: KEY
          - Attribute: VALUE
      SourceAccessConfigurations:
        - Type: VPC_SUBNET
          URI: subnet:subnet-12345678
        - Type: VPC_SECURITY_GROUP
          URI: security_group:sg-12345678
        - Type: BASIC_AUTH
          URI: !Sub arn:${AWS::Partition}:secretsmanager:us-west-2:123456789012:secret:kafka-secret
```

# SNS
<a name="sam-property-function-sns"></a>

`SNS` イベントソースタイプを説明するオブジェクトです。

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

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

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

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

```
  [FilterPolicy](#sam-function-sns-filterpolicy): [SnsFilterPolicy](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sns-subscription.html#cfn-sns-subscription-filterpolicy)
  FilterPolicyScope: String
  RedrivePolicy: Json
  [Region](#sam-function-sns-region): String
  [SqsSubscription](#sam-function-sns-sqssubscription): Boolean | SqsSubscriptionObject
  [Topic](#sam-function-sns-topic): String
```

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

 `FilterPolicy`   <a name="sam-function-sns-filterpolicy"></a>
サブスクリプションに割り当てられているフィルターポリシー JSON です。詳細については、Amazon Simple Notification Service API リファレンスの「[GetSubscriptionAttributes](https://docs.aws.amazon.com/sns/latest/api/API_GetSubscriptionAttributes.html)」を参照してください。  
*タイプ*: [SNSFilterPolicy](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sns-subscription.html#cfn-sns-subscription-filterpolicy)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::SNS::Subscription`リソースの `[FilterPolicy](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sns-subscription.html#cfn-sns-subscription-filterpolicy)`プロパティに直接渡されます。

 `FilterPolicyScope`   <a name="sam-function-sns-filterpolicyscope"></a>
この属性では、次の文字列値のタイプのいずれかを使用してフィルタリング範囲を選択できます。  
+ `MessageAttributes` – フィルターはメッセージ属性に適用されます。
+ `MessageBody` - フィルターはメッセージ本文に適用されます。
*タイプ*: 文字列  
*必須:* いいえ  
*デフォルト*: `MessageAttributes`  
*CloudFormation 互換性*: このプロパティは、 `AWS::SNS::Subscription`リソースの ` [ FilterPolicyScope](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sns-subscription.html#cfn-sns-subscription-filterpolicyscope)`プロパティに直接渡されます。

 `RedrivePolicy`   <a name="sam-function-sns-redrivepolicy"></a>
指定すると、指定された Amazon SQS デッドレターキューに配信不能メッセージを送信します。クライアントエラー（例: サブスクライブされたエンドポイントに到達できない）またはサーバーエラー（例: サブスクライブされたエンドポイントに電力を供給するサービスが使用できなくなる）が原因で配信できないメッセージは、詳細な分析や再処理のためにデッドレターキューに保持されます。  
リドライブポリシーとデッドレターキューの詳細については、「*Amazon Simple Queue Service Developer Guide*」の「[Amazon SQS dead-letter queues](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-dead-letter-queues.html)」を参照してください。  
型: Json  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::SNS::Subscription`リソースの `[ RedrivePolicy](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sns-subscription.html#cfn-sns-subscription-redrivepolicy)`プロパティに直接渡されます。

 `Region`   <a name="sam-function-sns-region"></a>
クロスリージョンサブスクリプションの場合に、トピックが格納されるリージョンです。  
リージョンが指定されていない場合、CloudFormation は発信者のリージョンをデフォルトとして使用します。  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::SNS::Subscription`リソースの `[Region](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sns-subscription.html#cfn-sns-subscription-region)`プロパティに直接渡されます。

 `SqsSubscription`   <a name="sam-function-sns-sqssubscription"></a>
このプロパティを true に設定するか、`SqsSubscriptionObject` を指定して SQS キューで SNS トピック通知のバッチ処理を有効にします。このプロパティを `true` に設定することによって新しい SQS キューが作成されますが、`SqsSubscriptionObject` を指定すると既存の SQS キューが使用されます。  
*タイプ*: ブール \$1 [SqsSubscriptionObject](sam-property-function-sqssubscriptionobject.md)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `Topic`   <a name="sam-function-sns-topic"></a>
サブスクライブ先のトピックの ARN です。  
*タイプ*: 文字列  
*必須*: はい  
*CloudFormation 互換性*: このプロパティは、 `AWS::SNS::Subscription`リソースの `[TopicArn](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sns-subscription.html#topicarn)`プロパティに直接渡されます。

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

### SNS イベントソースの例
<a name="sam-property-function-sns--examples--sns-event-source-example"></a>

SNS イベントソースの例

#### YAML
<a name="sam-property-function-sns--examples--sns-event-source-example--yaml"></a>

```
Events:
  SNSEvent:
    Type: SNS
    Properties:
      Topic: arn:aws:sns:us-east-1:123456789012:my_topic
      SqsSubscription: true
      FilterPolicy:
        store:
          - example_corp
        price_usd:
          - numeric:
              - ">="
              - 100
```

# SqsSubscriptionObject
<a name="sam-property-function-sqssubscriptionobject"></a>

SNS イベントに既存の SQS キューオプションを指定します。

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

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

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

```
  [BatchSize](#sam-function-sqssubscriptionobject-batchsize): String
  [Enabled](#sam-function-sqssubscriptionobject-enabled): Boolean
  [QueueArn](#sam-function-sqssubscriptionobject-queuearn): String
  [QueuePolicyLogicalId](#sam-function-sqssubscriptionobject-queuepolicylogicalid): String
  [QueueUrl](#sam-function-sqssubscriptionobject-queueurl): String
```

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

 `BatchSize`   <a name="sam-function-sqssubscriptionobject-batchsize"></a>
SQS キューの 単一バッチで取得する項目の最大数です。  
*タイプ*: 文字列  
*必須:* いいえ  
*デフォルト*: 10  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `Enabled`   <a name="sam-function-sqssubscriptionobject-enabled"></a>
ポーリングと呼び出しを中断する SQS イベントソースマッピングを無効にします。  
型: ブール  
*必須:* いいえ  
*デフォルト*: True  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `QueueArn`   <a name="sam-function-sqssubscriptionobject-queuearn"></a>
既存の SQS キュー ARN を指定します。  
*タイプ*: 文字列  
*必須*: はい  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `QueuePolicyLogicalId`   <a name="sam-function-sqssubscriptionobject-queuepolicylogicalid"></a>
[AWS::SQS::QueuePolicy](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sqs-policy.html) リソースのカスタム LogicalID 名を指定します。  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `QueueUrl`   <a name="sam-function-sqssubscriptionobject-queueurl"></a>
`QueueArn` プロパティに関連付けられたキュー URL を指定します。  
*タイプ*: 文字列  
*必須*: はい  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

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

### SNS イベント用の既存の SQS
<a name="sam-property-function-sqssubscriptionobject--examples--existing-sqs-for-sns-event"></a>

SNS トピックにサブスクライブするための既存の SQS キューを追加する例です。

#### YAML
<a name="sam-property-function-sqssubscriptionobject--examples--existing-sqs-for-sns-event--yaml"></a>

```
QueuePolicyLogicalId: CustomQueuePolicyLogicalId
QueueArn:
  Fn::GetAtt: MyCustomQueue.Arn
QueueUrl:
  Ref: MyCustomQueue
BatchSize: 5
```

# SQS
<a name="sam-property-function-sqs"></a>

`SQS` イベントソースタイプを説明するオブジェクトです。詳細については、「 *AWS Lambda デベロッパーガイド*」の[Amazon SQS AWS Lambda での の使用](https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html)」を参照してください。

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

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

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

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

```
  [BatchSize](#sam-function-sqs-batchsize): Integer
  [Enabled](#sam-function-sqs-enabled): Boolean
  [FilterCriteria](#sam-function-sqs-filtercriteria): [FilterCriteria](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-filtercriteria.html)
  [FunctionResponseTypes](#sam-function-sqs-functionresponsetypes): List
  KmsKeyArn: String
  [MaximumBatchingWindowInSeconds](#sam-function-sqs-maximumbatchingwindowinseconds): Integer
  [MetricsConfig](#sam-function-sqs-metricsconfig): [MetricsConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-metricsconfig)
  [ProvisionedPollerConfig](#sam-function-sqs-provisionedpollerconfig): [ProvisionedPollerConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-provisionedpollerconfig)
  [Queue](#sam-function-sqs-queue): String
  ScalingConfig: [ScalingConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-scalingconfig.html)
```

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

 `BatchSize`   <a name="sam-function-sqs-batchsize"></a>
単一のバッチで取得する項目の最大数です。  
*タイプ:* 整数  
*必須:* いいえ  
*デフォルト*: 10  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventSourceMapping`リソースの `[BatchSize](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-batchsize)`プロパティに直接渡されます。  
*最小*: `1`  
*最大*: `10000`

 `Enabled`   <a name="sam-function-sqs-enabled"></a>
ポーリングと呼び出しを一時停止するために、イベントソースマッピングを無効にします。  
型: ブール  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventSourceMapping`リソースの `[Enabled](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-enabled)`プロパティに直接渡されます。

 `FilterCriteria`   <a name="sam-function-sqs-filtercriteria"></a>
Lambda がイベントを処理する必要があるかどうかを判断するための基準を定義するオブジェクト。詳細については、*AWS Lambda デベロッパーガイド*の [AWS Lambda イベントのフィルタリング](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html)を参照してください。  
*タイプ*: [FilterCriteria](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-filtercriteria.html)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventSourceMapping`リソースの `[FilterCriteria](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-filtercriteria.html)`プロパティに直接渡されます。

 `FunctionResponseTypes`   <a name="sam-function-sqs-functionresponsetypes"></a>
 現在イベントソースマッピングに適用されているレスポンスタイプのリストです。詳細については、「AWS Lambda デベロッパーガイド」の「[バッチアイテムの失敗をレポートする](https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#services-sqs-batchfailurereporting)」を参照してください。  
 *有効な値:* `ReportBatchItemFailures`   
 *タイプ*: リスト   
 *必須:* いいえ   
 *CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventSourceMapping`リソースの `[FunctionResponseTypes](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-functionresponsetypes)`プロパティに直接渡されます。

 `KmsKeyArn`   <a name="sam-function-sqs-kmskeyarn"></a>
このイベントに関連する情報を暗号化するためのキーの Amazon リソースネーム (ARN)。  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventSourceMapping`リソースの `[KmsKeyArn](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-kmskeyarn)`プロパティに直接渡されます。

 `MaximumBatchingWindowInSeconds`   <a name="sam-function-sqs-maximumbatchingwindowinseconds"></a>
関数を呼び出すまでのレコード収集の最大時間 (秒) です。  
*タイプ:* 整数  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventSourceMapping`リソースの `[MaximumBatchingWindowInSeconds](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-maximumbatchingwindowinseconds)`プロパティに直接渡されます。

 `MetricsConfig`   <a name="sam-function-sqs-metricsconfig"></a>
処理の各ステージをキャプチャするイベントソースマッピングの拡張メトリクスを取得するためのオプトイン設定。例については、[MetricsConfig イベント](sam-property-function-dynamodb.md#sam-property-function-dynamodb-example-metricsconfigevent)を参照してください。  
*タイプ*: [MetricsConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-metricsconfig)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventSourceMapping`リソースの `[MetricsConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-metricsconfig)`プロパティに直接渡されます。

 `ProvisionedPollerConfig`   <a name="sam-function-sqs-provisionedpollerconfig"></a>
イベントソースマッピングの計算に使用されるポーラーの数を増やすための設定。この設定では、最小 2 つのポーラーと最大 2000 のポーラーを使用できます。例については、「[ProvisionedPollerConfig の例](#sam-property-function-sqs-example-provisionedpollerconfig)」を参照してください。  
*タイプ*: [ProvisionedPollerConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-provisionedpollerconfig)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventSourceMapping`リソースの `[ProvisionedPollerConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-provisionedpollerconfig)`プロパティに直接渡されます。

 `Queue`   <a name="sam-function-sqs-queue"></a>
キューの ARN です。  
*タイプ*: 文字列  
*必須*: はい  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventSourceMapping`リソースの `[EventSourceArn](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-eventsourcearn)`プロパティに直接渡されます。

 `ScalingConfig`   <a name="sam-function-sqs-scalingconfig"></a>
SQS ポーラーのスケーリング設定により、呼び出し速度を制御し、同時呼び出しの最大数を設定します。  
*タイプ*: `[ScalingConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-scalingconfig.html)`  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::EventSourceMapping`リソースの `[ ScalingConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-scalingconfig.html)`プロパティに直接渡されます。

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

### MetricsConfig イベント
<a name="sam-property-function-sqs-example-metricsconfigevent"></a>

以下は、イベントソースマッピングの各処理ステージをキャプチャするために `MetricsConfig` プロパティを使用するリソースの例です。

```
Resources:
  FilteredEventsFunction:
    Type: AWS::Serverless::Function
    Properties:
      CodeUri: s3://sam-demo-bucket/metricsConfig.zip
      Handler: index.handler
      Runtime: nodejs16.x
      Events:
        KinesisStream:
          Type: Kinesis
          Properties:
            Stream: !GetAtt KinesisStream.Arn
            StartingPosition: LATEST
            MetricsConfig:
              Metrics:
              - EventCount
```

### 基本的な SQS イベント
<a name="sam-property-function-sqs--examples--sqs-event"></a>

```
Events:
  SQSEvent:
    Type: SQS
    Properties:
      Queue: arn:aws:sqs:us-west-2:012345678901:my-queue
      BatchSize: 10
      Enabled: false
      FilterCriteria:
        Filters:
          - Pattern: '{"key": ["val1", "val2"]}'
```

### SQS キューの部分的なバッチレポートを設定する
<a name="sam-property-function-sqs--examples--sqs-partial-batch"></a>

```
Events:
  SQSEvent:
    Type: SQS
    Properties:
      Enabled: true
      FunctionResponseTypes:
        - ReportBatchItemFailures
      Queue: !GetAtt MySqsQueue.Arn
      BatchSize: 10
```

### スケーリングが設定された SQS イベントを含む Lambda 関数
<a name="sam-property-function-sqs--examples--sqs-event-scaling"></a>

```
MyFunction:
  Type: AWS::Serverless::Function
  Properties:
    ...
    Events:
      MySQSEvent:
        Type: SQS
        Properties:
          ...
          ScalingConfig:
            MaximumConcurrency: 10
```

### ProvisionedPollerConfig の例
<a name="sam-property-function-sqs-example-provisionedpollerconfig"></a>

```
MyFunction:
  Type: AWS::Serverless::Function
  Properties:
    Handler: index.handler
    Runtime: nodejs18.x
    Timeout: 30
    Events:
      SQSEvent:
        Type: SQS
        Properties:
          Queue: !GetAtt MyQueue.Arn
          BatchSize: 10
          Enabled: True
          ProvisionedPollerConfig:
            MaximumPollers: 300
            MinimumPollers: 10
```

# FunctionCode
<a name="sam-property-function-functioncode"></a>

Lambda 関数の[デプロイパッケージ](https://docs.aws.amazon.com/lambda/latest/dg/deployment-package-v2.html)です。

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

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

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

```
  [Bucket](#sam-function-functioncode-bucket): String
  [Key](#sam-function-functioncode-key): String
  [Version](#sam-function-functioncode-version): String
```

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

 `Bucket`   <a name="sam-function-functioncode-bucket"></a>
関数と同じ AWS リージョンにある Amazon S3 バケット。  
*タイプ*: 文字列  
*必須*: はい  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::Function` `Code` データ型の `[S3Bucket](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-code.html#cfn-lambda-function-code-s3bucket)`プロパティに直接渡されます。

 `Key`   <a name="sam-function-functioncode-key"></a>
デプロイパッケージの Amazon S3 キーです。  
*タイプ*: 文字列  
*必須*: はい  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::Function` `Code` データ型の `[S3Key](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-code.html#cfn-lambda-function-code-s3key)`プロパティに直接渡されます。

 `Version`   <a name="sam-function-functioncode-version"></a>
バージョニングオブエクトの場合、使用するデプロイパッケージオブジェクトのバージョンです。  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::Function` `Code` データ型の `[S3ObjectVersion](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-code.html#cfn-lambda-function-code-s3objectversion)`プロパティに直接渡されます。

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

### FunctionCode
<a name="sam-property-function-functioncode--examples--functioncode"></a>

`CodeUri`: 関数コードの例

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

```
CodeUri:
  Bucket: sam-s3-demo-bucket-name
  Key: mykey-name
  Version: 121212
```

# FunctionUrlConfig
<a name="sam-property-function-functionurlconfig"></a>

指定された設定パラメータを使用して AWS Lambda 関数 URL を作成します。Lambda 関数 URL は、関数を呼び出すために使用する HTTPS エンドポイントです。

デフォルトでは、作成する関数 URL は Lambda 関数のバージョン `$LATEST` を使用します。Lambda 関数に `AutoPublishAlias` を指定した場合、エンドポイントは指定された関数エイリアスに接続します。

詳細については、「AWS Lambda デベロッパーガイド」の「[Lambda 関数 URL](https://docs.aws.amazon.com/lambda/latest/dg/lambda-urls.html)」を参照してください。

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

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

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

```
[AuthType](#sam-function-functionurlconfig-authtype): String
[Cors](#sam-function-functionurlconfig-cors): [Cors](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-url-cors.html)
[InvokeMode](#sam-function-functionurlconfig-invokemode): String
```

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

 `AuthType`   <a name="sam-function-functionurlconfig-authtype"></a>
関数 URL が使用する認可のタイプ。 AWS Identity and Access Management (IAM) を使用してリクエストを承認するには、 を に設定します`AWS_IAM`。オープンアクセスの場合は、[`NONE`] に設定します。  
*タイプ*: 文字列  
*必須*: はい  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::Url`リソースの `[AuthType](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-url.html#cfn-lambda-url-authtype)`プロパティに直接渡されます。

 `Cors`   <a name="sam-function-functionurlconfig-cors"></a>
関数 URL のための、Cross-Origin Resource Sharing (CORS) 設定。  
型: [Cors](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-url-cors.html)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::Url`リソースの `[Cors](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-url-cors.html)`プロパティに直接渡されます。

 `InvokeMode`  <a name="sam-function-functionurlconfig-invokemode"></a>
関数 URL が呼び出されるモード。呼び出しの完了後に関数がレスポンスを返すようにするには、`BUFFERED` に設定します。関数がレスポンスをストリーミングするようにするには、`RESPONSE_STREAM` に設定します。デフォルト値は `BUFFERED` です。  
*有効な値*: `BUFFERED` または `RESPONSE_STREAM`  
*タイプ*: 文字列  
*必須:* いいえ  
*AWS CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::Url`リソースの [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-url.html#cfn-lambda-url-invokemode](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-url.html#cfn-lambda-url-invokemode)プロパティに直接渡されます。

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

### 関数 URL
<a name="sam-property-function-functionurlconfig--examples--function-url"></a>

次の例では、関数 URL を使用して Lambda 関数を作成します。関数 URL は IAM 認可を使用します。

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

```
HelloWorldFunction:
  Type: AWS::Serverless::Function
  Properties:
    CodeUri: hello_world/
    Handler: index.handler
    Runtime: nodejs20.x
    FunctionUrlConfig:
      AuthType: AWS_IAM
      InvokeMode: RESPONSE_STREAM

Outputs:
  MyFunctionUrlEndpoint:
      Description: "My Lambda Function URL Endpoint"
      Value:
        Fn::GetAtt: HelloWorldFunctionUrl.FunctionUrl
```

# CapacityProviderConfig
<a name="sam-property-function-capacityproviderconfig"></a>

関数の公開バージョンがアタッチされるキャパシティープロバイダーを設定します。これにより、関数は Lambda によって管理される顧客所有の EC2 インスタンスで実行できます。

**注記**  
この設定は、関数のコンピューティングタイプを決定し、最初の関数のデプロイ時に指定する必要があります。関数リソースの作成後に追加または削除することはできません。

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

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

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

```
[Arn](#sam-function-capacityproviderconfig-arn): String
[ExecutionEnvironmentMemoryGiBPerVCpu](#sam-function-capacityproviderconfig-executionenvironmentmemorygibpervcpu): Float
[PerExecutionEnvironmentMaxConcurrency](#sam-function-capacityproviderconfig-perexecutionenvironmentmaxconcurrency): Integer
```

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

 `Arn`   <a name="sam-function-capacityproviderconfig-arn"></a>
この関数に使用するキャパシティープロバイダーの ARN。  
*タイプ*: 文字列  
*必須*: はい  
*CloudFormation 互換性*: このプロパティは SAM に固有です。

 `ExecutionEnvironmentMemoryGiBPerVCpu`   <a name="sam-function-capacityproviderconfig-executionenvironmentmemorygibpervcpu"></a>
各実行環境のメモリと vCPU の比率 (GiB 単位）。  
CPU あたりのメモリ比率は、関数の合計メモリ 2048MB を超えることはできません。サポートされているmemory-to-CPU の比率は2GB, 4GB、または 8GB です。
*タイプ*: Float  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::Function`リソースの `[ExecutionEnvironmentMemoryGiBPerVCpu](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-lambdamanagedinstancescapacityproviderconfig)`プロパティに直接渡されます。

 `PerExecutionEnvironmentMaxConcurrency`   <a name="sam-function-capacityproviderconfig-perexecutionenvironmentmaxconcurrency"></a>
実行環境あたりの同時実行の最大数 (サンドボックス）。  
*タイプ:* 整数  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::Function`リソースの `[PerExecutionEnvironmentMaxConcurrency](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-lambdamanagedinstancescapacityproviderconfig)`プロパティに直接渡されます。

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

### キャパシティープロバイダーの設定
<a name="sam-property-function-capacityproviderconfig-examples-basic"></a>

次の例は、キャパシティープロバイダーリソースを参照するキャパシティープロバイダー設定を示しています。

```
CapacityProviderConfig:
  Arn: !GetAtt MyCapacityProvider.Arn
  ExecutionEnvironmentMemoryGiBPerVCpu: 4.0
  PerExecutionEnvironmentMaxConcurrency: 100
```

# FunctionScalingConfig
<a name="sam-property-function-functionscalingconfig"></a>

Lambda 関数バージョンのスケーリング動作を設定し、作成できる実行環境 (サンドボックス) の数を制御します。この設定は、\$1LATEST.PUBLISHED 関数バージョンと数値関数バージョンの両方に適用されます。

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

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

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

```
[MinExecutionEnvironments](#sam-function-functionscalingconfig-minexecutionenvironments): Integer
[MaxExecutionEnvironments](#sam-function-functionscalingconfig-maxexecutionenvironments): Integer
```

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

 `MinExecutionEnvironments`   <a name="sam-function-functionscalingconfig-minexecutionenvironments"></a>
関数バージョンで維持する実行環境の最小数。  
*タイプ:* 整数  
*必須:* いいえ  
*デフォルト*: `3`  
*最小*: `0`  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::Function`リソースの `[MinExecutionEnvironments](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-functionscalingconfig-minexecutionenvironments)`プロパティに直接渡されます。

 `MaxExecutionEnvironments`   <a name="sam-function-functionscalingconfig-maxexecutionenvironments"></a>
関数バージョンに対して作成できる実行環境の最大数。  
*タイプ:* 整数  
*必須:* いいえ  
*デフォルト*: `3`  
*最小*: `0`  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::Function`リソースの `[MaxExecutionEnvironments](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-functionscalingconfig-maxexecutionenvironments)`プロパティに直接渡されます。

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

### 関数スケーリング設定
<a name="sam-property-function-functionscalingconfig-examples-basic"></a>

次の例は、最小実行環境と最大実行環境を使用した関数スケーリング設定を示しています。

```
FunctionScalingConfig:
  MinExecutionEnvironments: 5
  MaxExecutionEnvironments: 100
```