

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

# AWS SAM テンプレート
<a name="sam-specification"></a>

**sam init** コマンドを実行して後続のワークフローを完了すると、 はアプリケーションプロジェクトディレクトリ AWS SAM を作成します。これは AWS SAM プロジェクトです。サーバーレスアプリケーションを定義するには、 AWS SAM プロジェクトにコードを追加します。 AWS SAM プロジェクトは一連のファイルとフォルダで構成されますが、主に使用するファイルは AWS SAM テンプレート ( という名前) です`template.yaml`。このテンプレートでは、リソース、イベントソースマッピング、およびサーバーレスアプリケーションを定義するその他のプロパティを表すコードを記述します。

**注記**  
 AWS SAM テンプレートのキー要素は AWS SAM 、テンプレート仕様です。この仕様は、 と比較して CloudFormation、より少ないコード行を使用してサーバーレスアプリケーションのリソース、イベントソースマッピング、アクセス許可、APIs、およびその他のプロパティを定義できる短縮構文を提供します。

このセクションでは、 AWS SAM テンプレートのセクションを使用して、リソースタイプ、リソースプロパティ、データ型、リソース属性、組み込み関数、API Gateway 拡張機能を定義する方法について詳しく説明します。

AWS SAM テンプレートは CloudFormation テンプレートの拡張機能であり、短縮構文を使用する一意の構文タイプで、 よりもコード行が少なくなります CloudFormation。これにより、サーバーレスアプリケーションを構築する際に開発をスピードアップできます。詳細については、[AWS SAM リソースとプロパティ](sam-specification-resources-and-properties.md) を参照してください。 CloudFormation テンプレートの完全なリファレンスについては、「 *AWS CloudFormation ユーザーガイド*」の[CloudFormation 「テンプレートリファレンス](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-reference.html)」を参照してください。

開発時には、アプリケーションコードを個別のファイルに分割すると、アプリケーションをより適切に整理および管理できる場合がよくあります。この基本的な例は、 AWS SAM テンプレートにこのコードを含めるのではなく、 AWS Lambda 関数コードに別のファイルを使用することです。これを行うには、Lambda 関数コードをプロジェクトのサブディレクトリに整理し、 AWS Serverless Application Model (AWS SAM) テンプレート内のローカルパスを参照します。

**Topics**
+ [

# AWS SAM テンプレートの構造
](sam-specification-template-anatomy.md)
+ [

# AWS SAM リソースとプロパティ
](sam-specification-resources-and-properties.md)
+ [

# の生成済み CloudFormation リソース AWS SAM
](sam-specification-generated-resources.md)
+ [

# でサポートされるリソース属性 AWS SAM
](sam-specification-resource-attributes.md)
+ [

# の API Gateway 拡張機能 AWS SAM
](sam-specification-api-gateway-extensions.md)
+ [

# の組み込み関数 AWS SAM
](sam-specification-intrinsic-functions.md)

# AWS SAM テンプレートの構造
<a name="sam-specification-template-anatomy"></a>

 AWS SAM テンプレートファイルは、 CloudFormation 「 *AWS CloudFormation ユーザーガイド*」の「テンプレート構造」で[説明されているテンプレート](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html)ファイルの形式に厳密に従います。 AWS SAM テンプレートファイルと CloudFormation テンプレートファイルの主な違いは次のとおりです。
+ **変換の宣言。**`Transform: AWS::Serverless-2016-10-31` 宣言は AWS SAM テンプレートファイルに必須です。この宣言は、 CloudFormation テンプレートファイルをテンプレートファイルとして識別します AWS SAM 。Transform の詳細については、*AWS CloudFormation ユーザーガイド*の「[Transform](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/transform-section-structure.html)」を参照してください。
+ **Globals セクション。**`Globals` セクションは に固有です AWS SAM。これは、すべてのサーバーレス関数と API に共通するプロパティを定義します。`AWS::Serverless::Function`、、`AWS::Serverless::Api`、`AWS::Serverless::CapacityProvider`、`AWS::Serverless::HttpApi`、および `AWS::Serverless::StateMachine`リソースはすべて`AWS::Serverless::SimpleTable`、 `Globals`セクションで定義されているプロパティを継承します。このセクションの詳細については、「[AWS SAM テンプレートのグローバルセクション](sam-specification-template-anatomy-globals.md)」を参照してください。
+ **Resources セクション。** AWS SAM テンプレートでは、 `Resources`セクションに CloudFormation リソースと AWS SAM リソースの組み合わせを含めることができます。 CloudFormation リソースの詳細については、「 *AWS CloudFormation ユーザーガイド*」の[AWS 「リソースタイプとプロパティタイプのリファレンス](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html)」を参照してください。 AWS SAM リソースの詳細については、「」を参照してください[AWS SAM リソースとプロパティ](sam-specification-resources-and-properties.md)。

 AWS SAM テンプレートファイルの他のすべてのセクションは、同じ名前の CloudFormation テンプレートファイルセクションに対応しています。

## YAML
<a name="template-anatomy-outline.yaml"></a>

以下の例は、YAML 形式のテンプレートフラグメントを示しています。

```
Transform: AWS::Serverless-2016-10-31

Globals:
  set of globals

Description:
  String

Metadata:
  template metadata

Parameters:
  set of parameters

Mappings:
  set of mappings

Conditions:
  set of conditions

Resources:
  set of resources

Outputs:
  set of outputs
```

## テンプレートセクション
<a name="template-anatomy-sections"></a>

AWS SAM テンプレートには、いくつかの主要なセクションを含めることができます。必須のセクションは、`Transform` と `Resources` のみです。

テンプレートセクションは任意の順序で含めることができますが、ただし次の例に示すように、言語拡張機能を使用する場合には、サーバーレス変換の前 (`AWS::Serverless-2016-10-31` の前) に `AWS::LanguageExtensions` を追加する必要があります。

```
Transform:
  - AWS::LanguageExtensions
  - AWS::Serverless-2016-10-31
```

テンプレートを作成する際には、以下の一覧が示す論理的な順序の使用が役に立つ場合があります。これは、1 つのセクションの値が前のセクションの値を参照している可能性があるためです。

**[変換 (必須)](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/transform-section-structure.html)**  
 AWS SAM テンプレートの場合は、このセクションに の値を含める必要があります`AWS::Serverless-2016-10-31`。  
追加の transform はオプションです。Transform の詳細については、*AWS CloudFormation ユーザーガイド*の「[Transform](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/transform-section-structure.html)」を参照してください。

**[グローバル (オプション)](sam-specification-template-anatomy-globals.md)**  
すべてのサーバーレス関数、API、および単純テーブルに共通のプロパティです。`AWS::Serverless::Function`、、`AWS::Serverless::Api`、`AWS::Serverless::CapacityProvider`、`AWS::Serverless::HttpApi`、および `AWS::Serverless::StateMachine`リソースはすべて`AWS::Serverless::SimpleTable`、 `Globals`セクションで定義されているプロパティを継承します。  
このセクションは に固有です AWS SAM。 CloudFormation テンプレートに対応するセクションはありません。

**[Description (オプション) ](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-description-structure.html)**  
テンプレートを説明するテキスト文字列です。  
このセクションは、 CloudFormation テンプレートの `Description`セクションに直接対応しています。

**[メタデータ (オプション)](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html)**  
テンプレートに関する追加情報を提供するオブジェクトです。  
このセクションは、 CloudFormation テンプレートの `Metadata`セクションに直接対応しています。

**[パラメータ (任意)](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/parameters-section-structure.html)**  
実行時 (スタックを作成または更新するとき) にテンプレートに渡す値です。テンプレートの `Resources` および `Outputs` セクションからのパラメータを参照できます。`Parameters` セクションで宣言されるオブジェクトによって、**sam deploy --guided** コマンドがユーザーに追加のプロンプトを表示するようになります。  
`sam deploy` コマンドの `--parameter-overrides` パラメータ (および設定ファイルのエントリ) を使用することで渡される値で、 AWS SAM テンプレートファイルよりも優先されます。`sam deploy` コマンドの詳細については、 AWS SAM CLI コマンドリファレンスの「[sam deploy](sam-cli-command-reference-sam-deploy.md)」を参照してください。設定ファイルの詳細については、「[AWS SAM CLI 設定ファイル](serverless-sam-cli-config.md)」を参照してください。

**[マッピング (任意)](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/mappings-section-structure.html)**  
キーと関連する値のマッピングで、条件パラメータ値の指定に使用でき、ルックアップテーブルに似ています。`Resources` セクションと `Outputs` セクションで [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-findinmap.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-findinmap.html) 組み込み関数を使用することによって、キーを対応する値と一致させることができます。  
このセクションは、 CloudFormation テンプレートの `Mappings`セクションに直接対応しています。

**[条件 (オプション)](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/conditions-section-structure.html)**  
スタックの作成中または更新中に、特定のリソースが作成されるかどうか、または特定のリソースプロパティに値が割り当てられるかどうかを制御する条件です。例えば、スタックが実稼働用であるかテスト環境用であるかに依存するリソースを、条件付きで作成できます。  
このセクションは、 CloudFormation テンプレートの `Conditions`セクションに直接対応しています。

**[リソース (必須)](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/resources-section-structure.html)**  
Amazon Elastic Compute Cloud (Amazon EC2) インスタンスや Amazon Simple Storage Service (Amazon S3) バケットなどのスタックリソースとそれらのプロパティです。テンプレートの `Resources` と `Outputs` セクションのリソースを参照できます。  
このセクションは、 CloudFormation テンプレートの `Resources` セクションに似ています。 AWS SAM テンプレートでは、このセクションには AWS SAM リソースに加えて CloudFormation リソースを含めることができます。

**[出力 (任意)](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/outputs-section-structure.html)**  
スタックのプロパティを表示するたびに返される値です。たとえば、S3 バケット名の出力を宣言し、 `aws cloudformation describe-stacks` AWS Command Line Interface (AWS CLI) コマンドを呼び出して名前を表示できます。  
このセクションは、 CloudFormation テンプレートの `Outputs` セクションに直接対応します。

## 次の手順
<a name="template-anatomy-next-steps"></a>

 AWS SAM テンプレートファイルを含むサンプルサーバーレスアプリケーションをダウンロードしてデプロイするには、[の開始方法 AWS SAM](serverless-getting-started.md)「」を参照して、「」の手順に従います[チュートリアル: を使用して Hello World アプリケーションをデプロイする AWS SAM](serverless-getting-started-hello-world.md)。

# AWS SAM テンプレートのグローバルセクション
<a name="sam-specification-template-anatomy-globals"></a>

 AWS SAM テンプレートで宣言するリソースに共通の設定がある場合があります。例えば、アプリケーションに 同一の `Runtime`、`Memory`、`VPCConfig`、`Environment`、および `Cors` 設定を持つ複数の `AWS::Serverless::Function` がある場合があります。すべてのリソースにこの情報を複製する代わりに、`Globals` セクションでそれらを一度だけ宣言し、リソースに継承させることができます。

`Globals` セクションでは、次の AWS SAM リソースタイプがサポートされています。
+ `AWS::Serverless::Api`
+ `AWS::Serverless::CapacityProvider`
+ `AWS::Serverless::Function`
+ `AWS::Serverless::HttpApi`
+ `AWS::Serverless::SimpleTable`
+ `AWS::Serverless::StateMachine`

例:

```
Globals:
  Function:
    Runtime: nodejs12.x
    Timeout: 180
    Handler: index.handler
    Environment:
      Variables:
        TABLE_NAME: data-table

Resources:
  HelloWorldFunction:
    Type: AWS::Serverless::Function
    Properties:
      Environment:
        Variables:
          MESSAGE: "Hello From SAM"

  ThumbnailFunction:
    Type: AWS::Serverless::Function
    Properties:
      Events:
        Thumbnail:
          Type: Api
          Properties:
            Path: /thumbnail
            Method: POST
```

この例では、`HelloWorldFunction` と `ThumbnailFunction` の両方が `Runtime` に「nodejs12.x」、`Timeout` に「180」秒、および `Handler` に「index.handler」を使用しています。`HelloWorldFunction` は、継承された TABLE\$1NAME に加えて、MESSAGE 環境変数を追加します。`ThumbnailFunction` はすべての `Globals` プロパティを継承し、API イベントソースを追加します。

## サポートされるリソースとプロパティ
<a name="sam-specification-template-anatomy-globals-supported-resources-and-properties"></a>

AWS SAM では、次のリソースとプロパティがサポートされています。

```
Globals:
  Api:
    AccessLogSetting:
    Auth:
    BinaryMediaTypes:
    CacheClusterEnabled:
    CacheClusterSize:
    CanarySetting:
    Cors:
    DefinitionUri:
    Domain:
    EndpointConfiguration:
    GatewayResponses:
    MethodSettings:
    MinimumCompressionSize:
    Name:
    OpenApiVersion:
    PropagateTags:
    TracingEnabled:
    Variables:
  
  CapacityProvider:
    InstanceRequirements:
    KmsKeyArn:
    OperatorRole:
    PropagateTags:
    ScalingConfig:
    Tags:
    VpcConfig:
  
  Function:
    Architectures:
    AssumeRolePolicyDocument:
    AutoPublishAlias:
    AutoPublishAliasAllProperties:
    CapacityProviderConfig:
    CodeSigningConfigArn:
    CodeUri:
    DeadLetterQueue:
    DeploymentPreference:
    Description:
    DurableConfig:
    Environment:
    EphemeralStorage:
    EventInvokeConfig:
    FileSystemConfigs:
    FunctionScalingConfig:
    FunctionUrlConfig:
    Handler:
    KmsKeyArn:
    Layers:
    LoggingConfig:
    MemorySize:
    PermissionsBoundary:
    PropagateTags:
    ProvisionedConcurrencyConfig:
    PublishToLatestPublished:
    RecursiveLoop:
    ReservedConcurrentExecutions:
    RolePath:
    Runtime:
    RuntimeManagementConfig:
    SnapStart:
    SourceKMSKeyArn:
    Tags:
    TenancyConfig:
    Timeout:
    Tracing:
    VersionDeletionPolicy:
    VpcConfig:

  HttpApi:
    AccessLogSettings:
    Auth:
    PropagateTags:
    StageVariables:
    Tags:

  SimpleTable:
    SSESpecification:
    
  StateMachine:
    PropagateTags:
```

**注記**  
上記のリストに含まれていないリソースとプロパティはサポートされません。それらをサポートしない理由には、1) セキュリティ問題を発生させる可能性がある、または 2) テンプレートを理解しにくくするなどがあります。

## 暗黙的な API
<a name="sam-specification-template-anatomy-globals-implicit-apis"></a>

AWS SAM `Events`セクションで * APIs を宣言すると、 は暗黙的な* API を作成します。`Globals` を使用して、暗黙的な API のすべてのプロパティを上書きできます。

## 上書き可能なプロパティ
<a name="sam-specification-template-anatomy-globals-overrideable"></a>

リソースは、`Globals` セクションで宣言するプロパティを上書きできます。例えば、環境変数マップに新しい変数を追加する、またはグローバルに宣言された変数を上書きすることができます。ただし、リソースは `Globals` セクションで指定されたプロパティを削除できません。

一般に、`Globals` セクションはすべてのリソースが共有するプロパティを宣言します。リソースには、グローバルに宣言されたプロパティに新しい値を提供できるものもありますが、それらを完全に削除することはできません。一部のリソースがあるプロパティを使用するが、他のリソースは使用しないという場合は、それを `Globals` セクションで宣言しない必要があります。

以下のセクションでは、さまざまなデータ型に対して上書きがどのように機能するかについて説明します。

### プリミティブデータ型が置き換えられる
<a name="sam-specification-template-anatomy-globals-overrideable-primitives"></a>

プリミティブデータ型には、文字列、数値、ブール値などがあります。

`Globals` セクションの値が `Resources` セクションで指定された値に置き換えられます。

例:

```
Globals:
  Function:
    Runtime: nodejs12.x

Resources:
  MyFunction:
    Type: AWS::Serverless::Function
    Properties:
      Runtime: python3.9
```

`MyFunction` の `Runtime` は `python3.9` に設定されます。

### マップが統合される
<a name="sam-specification-template-anatomy-globals-overrideable-maps"></a>

マップは、ディクショナリまたはキーバリューペアのコレクションとしても知られています。

`Resources` セクションのマップエントリは、グローバルマップエントリと統合されます。重複がある場合は、`Globals` セクションのエントリが `Resource` セクションのエントリで上書きされます。

例:

```
Globals:
  Function:
    Environment:
      Variables:
        STAGE: Production
        TABLE_NAME: global-table

Resources:
  MyFunction:
    Type: AWS::Serverless::Function
    Properties:
      Environment:
        Variables:
          TABLE_NAME: resource-table
          NEW_VAR: hello
```

`MyFunction` の環境変数は、以下のように設定されます。

```
{
  "STAGE": "Production",
  "TABLE_NAME": "resource-table",
  "NEW_VAR": "hello"
}
```

### リストが付加される
<a name="sam-specification-template-anatomy-globals-overrideable-lists"></a>

リストは配列としても知られています。

`Globals` セクションのリストエントリは、`Resources` セクションのリストの先頭に付加されます。

例:

```
Globals:
  Function:
    VpcConfig:
      SecurityGroupIds:
        - sg-123
        - sg-456

Resources:
  MyFunction:
    Type: AWS::Serverless::Function
    Properties:
      VpcConfig:
        SecurityGroupIds:
          - sg-first
```

`MyFunction` の `VpcConfig` の `SecurityGroupIds` は、以下のように設定されます。

```
[ "sg-123", "sg-456", "sg-first" ]
```

# AWS SAM リソースとプロパティ
<a name="sam-specification-resources-and-properties"></a>

このセクションでは、 固有のリソースタイプとプロパティタイプについて説明します AWS SAM。これらのリソースとプロパティは、 AWS SAM 短縮構文を使用して定義します。 は CloudFormation リソースタイプとプロパティタイプ AWS SAM もサポートしています。すべての AWS リソースおよびプロパティタイプ CloudFormation と AWS SAM サポートのリファレンス情報については、*AWS CloudFormation 「 ユーザーガイド*」の[AWS 「リソースおよびプロパティタイプのリファレンス](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html)」を参照してください。

**Topics**
+ [

# AWS::Serverless::Api
](sam-resource-api.md)
+ [

# AWS::Serverless::Application
](sam-resource-application.md)
+ [

# AWS::Serverless::CapacityProvider
](sam-resource-capacityprovider.md)
+ [

# AWS::Serverless::Connector
](sam-resource-connector.md)
+ [

# AWS::Serverless::Function
](sam-resource-function.md)
+ [

# AWS::Serverless::GraphQLApi
](sam-resource-graphqlapi.md)
+ [

# AWS::Serverless::HttpApi
](sam-resource-httpapi.md)
+ [

# AWS::Serverless::LayerVersion
](sam-resource-layerversion.md)
+ [

# AWS::Serverless::SimpleTable
](sam-resource-simpletable.md)
+ [

# AWS::Serverless::StateMachine
](sam-resource-statemachine.md)

# AWS::Serverless::Api
<a name="sam-resource-api"></a>

HTTPS エンドポイント経由で呼び出すことができる Amazon API Gateway リソースとメソッドのコレクションを作成します。

[AWS::Serverless::Api](#sam-resource-api) リソースを AWS サーバーレスアプリケーション定義テンプレートに明示的に追加する必要はありません。このタイプのリソースは、[AWS::Serverless::Function](sam-resource-function.md) リソースを参照しないテンプレートで定義された [AWS::Serverless::Api](#sam-resource-api) リソースに定義される Api イベントの和集合から暗黙的に作成されます。

[AWS::Serverless::Api](#sam-resource-api) リソースは、OpenApi を使用して API を定義および文書化するために使用する必要があります。これは、基盤となる Amazon API Gateway リソースを設定する機能をより多く提供します。

 CloudFormation フックまたは IAM ポリシーを使用して、API Gateway リソースにアクセスを制御するオーソライザーがアタッチされていることを確認することをお勧めします。

 CloudFormation フックの使用の詳細については、*CloudFormation CLI ユーザーガイド*の[「フックの登録](https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/registering-hook-python.html)」および[apigw-enforce-authorizer](https://github.com/aws-cloudformation/aws-cloudformation-samples/tree/main/hooks/python-hooks/apigw-enforce-authorizer/) GitHub リポジトリ」を参照してください。

IAM ポリシーの使用の詳細については、「*API ゲートウェイデベロッパーガイド*」の「[API ルートに認可を要求する](https://docs.aws.amazon.com/apigateway/latest/developerguide/security_iam_id-based-policy-examples.html#security_iam_id-based-policy-examples-require-authorization)」を参照してください。

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

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

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

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

```
Type: AWS::Serverless::Api
Properties:
  [AccessLogSetting](#sam-api-accesslogsetting): [AccessLogSetting](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-stage.html#cfn-apigateway-stage-accesslogsetting)
  AlwaysDeploy: Boolean
  [ApiKeySourceType](#sam-api-apikeysourcetype): String
  [Auth](#sam-api-auth): ApiAuth
  [BinaryMediaTypes](#sam-api-binarymediatypes): List
  [CacheClusterEnabled](#sam-api-cacheclusterenabled): Boolean
  [CacheClusterSize](#sam-api-cacheclustersize): String
  [CanarySetting](#sam-api-canarysetting): [CanarySetting](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-stage.html#cfn-apigateway-stage-canarysetting)
  [Cors](#sam-api-cors): String | CorsConfiguration
  [DefinitionBody](#sam-api-definitionbody): JSON
  [DefinitionUri](#sam-api-definitionuri): String | ApiDefinition
  [Description](#sam-api-description): String
  [DisableExecuteApiEndpoint](#sam-api-disableexecuteapiendpoint): Boolean
  [Domain](#sam-api-domain): DomainConfiguration
  [EndpointConfiguration](#sam-api-endpointconfiguration): EndpointConfiguration
  [FailOnWarnings](#sam-api-failonwarnings): Boolean
  [GatewayResponses](#sam-api-gatewayresponses): Map
  MergeDefinitions: Boolean
  [MethodSettings](#sam-api-methodsettings): MethodSettings
  [MinimumCompressionSize](#sam-api-minimumcompressionsize): Integer
  [Mode](#sam-api-mode): String
  [Models](#sam-api-models): Map
  [Name](#sam-api-name): String
  [OpenApiVersion](#sam-api-openapiversion): String
  PropagateTags: Boolean
  [Policy](#sam-api-policy): JSON
  [StageName](#sam-api-stagename): String
  [Tags](#sam-api-tags): Map
  [TracingEnabled](#sam-api-tracingenabled): Boolean
  [Variables](#sam-api-variables): Map
```

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

 `AccessLogSetting`   <a name="sam-api-accesslogsetting"></a>
ステージのアクセスログ設定を行います。  
*タイプ*: [AccessLogSetting](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-stage.html#cfn-apigateway-stage-accesslogsetting)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::ApiGateway::Stage`リソースの `[AccessLogSetting](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-stage.html#cfn-apigateway-stage-accesslogsetting)`プロパティに直接渡されます。

 `AlwaysDeploy`   <a name="sam-api-alwaysdeploy"></a>
API への変更が検出されない場合でも、常に API をデプロイします。  
型: ブール  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `ApiKeySourceType`   <a name="sam-api-apikeysourcetype"></a>
使用量プランに沿ってリクエストを計測するための API キーのソース。有効な値は、`HEADER` および `AUTHORIZER` です。  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::ApiGateway::RestApi`リソースの `[ApiKeySourceType](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-restapi.html#cfn-apigateway-restapi-apikeysourcetype)`プロパティに直接渡されます。

 `Auth`   <a name="sam-api-auth"></a>
API Gateway API へのアクセスを制御するための認可を設定します。  
を使用したアクセスの設定の詳細については、 AWS SAM 「」を参照してください[AWS SAM テンプレートを使用して API アクセスを制御する](serverless-controlling-access-to-apis.md)。グローバルオーソライザーを上書きする方法の例については、「[Amazon API Gateway REST API のグローバルオーソライザーをオーバーライドする](sam-property-function-apifunctionauth.md#sam-property-function-apifunctionauth--examples--override)」を参照してください。  
*タイプ*: [ApiAuth](sam-property-api-apiauth.md)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `BinaryMediaTypes`   <a name="sam-api-binarymediatypes"></a>
API が返すことができる MIME タイプのリストです。これは、API のバイナリサポートを有効化するために使用します。  
*タイプ*: リスト  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::ApiGateway::RestApi`リソースの `[BinaryMediaTypes](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-restapi.html#cfn-apigateway-restapi-binarymediatypes)`プロパティに似ています。BinaryMediaTypes のリストが CloudFormation リソースと OpenAPI ドキュメントの両方に追加されます。

 `CacheClusterEnabled`   <a name="sam-api-cacheclusterenabled"></a>
ステージでキャッシュが有効化されているかどうかを示します。レスポンスをキャッシュするには、`MethodSettings` で `CachingEnabled` を `true` に設定することも必要です。  
型: ブール  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::ApiGateway::Stage`リソースの `[CacheClusterEnabled](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-stage.html#cfn-apigateway-stage-cacheclusterenabled)`プロパティに直接渡されます。

 `CacheClusterSize`   <a name="sam-api-cacheclustersize"></a>
ステージのキャッシュクラスターサイズです。  
タイプ：文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::ApiGateway::Stage`リソースの `[CacheClusterSize](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-stage.html#cfn-apigateway-stage-cacheclustersize)`プロパティに直接渡されます。

 `CanarySetting`   <a name="sam-api-canarysetting"></a>
通常のデプロイの段階に Canary 設定を設定します。  
*タイプ*: [CanarySetting](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-stage.html#cfn-apigateway-stage-canarysetting)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::ApiGateway::Stage`リソースの `[CanarySetting](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-stage.html#cfn-apigateway-stage-canarysetting)`プロパティに直接渡されます。

 `Cors`   <a name="sam-api-cors"></a>
すべての API Gateway API のクロスオリジンリソース共有 (CORS) を管理します。許可するドメインを文字列として指定するか、追加の CORS 設定でディクショナリを指定します。  
CORS では AWS SAM 、OpenAPI 定義を変更する必要があります。CORS を有効にするには、`DefinitionBody` の中でインライン OpenAPI 定義を作成します。
CORS の詳細については、*Amazon API Gateway デベロッパーガイド*の「[REST API リソースの CORS を有効にする](https://docs.aws.amazon.com/apigateway/latest/developerguide/how-to-cors.html)」を参照してください。  
*タイプ*: 文字列 \$1 [CorsConfiguration](sam-property-api-corsconfiguration.md)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `DefinitionBody`   <a name="sam-api-definitionbody"></a>
API を説明する OpenAPI 仕様です。`DefinitionUri` と `DefinitionBody` のどちらも指定されていない場合、SAM はテンプレート設定に基づいて `DefinitionBody` を生成します。  
API を定義するローカルの OpenAPI ファイルを参照するには、`AWS::Include` 変換を使用してください。詳細については[がローカルファイル AWS SAM をアップロードする方法](deploy-upload-local-files.md)を参照してください。  
*Type*: JSON  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::ApiGateway::RestApi`リソースの `[Body](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-restapi.html#cfn-apigateway-restapi-body)`プロパティに似ています。特定のプロパティが提供されている場合、コンテンツは、CloudFormation に渡される前に DefinitionBody に挿入または変更される可能性があります。プロパティには `Auth`、`BinaryMediaTypes`、`Cors`、`GatewayResponses`、`Models`、および、対応する `AWS::Serverless::Function` 向けの `EventSource` タイプの API が含まれます。

 `DefinitionUri`   <a name="sam-api-definitionuri"></a>
Amazon S3 URI、ローカルファイルパス、または API を定義する OpenAPI ドキュメントのロケーションオブジェクトです。このプロパティが参照する Amazon S3 オブジェクトは、有効な OpenAPI ファイルである必要があります。`DefinitionUri` と `DefinitionBody` のどちらも指定されていない場合、SAM はテンプレート設定に基づいて `DefinitionBody` を生成します。  
ローカルファイルパスを指定する場合は、定義が適切に変換されるようにするために、テンプレートが `sam deploy` または `sam package` コマンドを含むワークフローを実行する必要があります。  
組み込み関数は、`DefinitionUri` で参照される外部 OpenApi ファイルではサポートされていません。その代わりに、[Include Transform](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/create-reusable-transform-function-snippets-and-add-to-your-template-with-aws-include-transform.html) で `DefinitionBody` プロパティを使用して、OpenApi 定義をテンプレートにインポートします。  
*タイプ*: 文字列 \$1 [ApiDefinition](sam-property-api-apidefinition.md)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::ApiGateway::RestApi`リソースの `[BodyS3Location](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-restapi.html#cfn-apigateway-restapi-bodys3location)`プロパティに似ています。ネストされた Amazon S3 プロパティには異なる名前が付けられています。

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

 `DisableExecuteApiEndpoint`   <a name="sam-api-disableexecuteapiendpoint"></a>
クライアントがデフォルトの `execute-api` エンドポイントを使用して API を呼び出すことができるかどうかを指定します。デフォルトでは、クライアントはデフォルトの `https://{api_id}.execute-api.{region}.amazonaws.com` を使用して API を呼び出すことができます。クライアントがカスタムドメイン名を使用して API を呼び出すように要求するには、`True` を指定します。  
型: ブール  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::ApiGateway::RestApi`リソースの `[ DisableExecuteApiEndpoint](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-restapi.html#cfn-apigateway-restapi-disableexecuteapiendpoint)`プロパティに似ています。これは `[ x-amazon-apigateway-endpoint-configuration](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-swagger-extensions-endpoint-configuration.html)` 拡張機能の `disableExecuteApiEndpoint` プロパティに直接渡され、`AWS::ApiGateway::RestApi` リソースの ` [ Body](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-restapi.html#cfn-apigateway-restapi-body)` プロパティに追加されます。

 `Domain`   <a name="sam-api-domain"></a>
この API Gateway API のカスタムドメインを設定します。  
*タイプ*: [DomainConfiguration](sam-property-api-domainconfiguration.md)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `EndpointConfiguration`   <a name="sam-api-endpointconfiguration"></a>
REST API のエンドポイントタイプです。  
*タイプ*: [EndpointConfiguration](sam-property-api-endpointconfiguration.md)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::ApiGateway::RestApi`リソースの `[EndpointConfiguration](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-restapi.html#cfn-apigateway-restapi-endpointconfiguration)`プロパティに似ています。ネストされた設定プロパティには異なる名前が付けられています。

 `FailOnWarnings`   <a name="sam-api-failonwarnings"></a>
警告が発生したときに、API 作成をロールバックするか (`true`)、しないか (`false`) を指定します。デフォルト値は `false` です。  
*タイプ*: ブール  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::ApiGateway::RestApi`リソースの `[FailOnWarnings](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-restapi.html#cfn-apigateway-restapi-failonwarnings)`プロパティに直接渡されます。

 `GatewayResponses`   <a name="sam-api-gatewayresponses"></a>
API のゲートウェイレスポンスを設定します。ゲートウェイレスポンスは、直接、または Lambda オーソライザーを使用して返される API Gateway からのレスポンスです。詳細については、[ゲートウェイレスポンス用の API Gateway OpenApi 拡張機能](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-swagger-extensions-gateway-responses.html)に関するドキュメントを参照してください。  
*タイプ*: マップ  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `MergeDefinitions`   <a name="sam-api-mergedefinitions"></a>
AWS SAM は API イベントソースから OpenAPI 仕様を生成します。`AWS::Serverless::Api` リソースで定義されているインラインOpenAPI仕様にこれを AWS SAM マージ`true`するには、 を指定します。マージしない場合は `false` を指定します。  
`MergeDefinitions` では、`AWS::Serverless::Api` の `DefinitionBody` プロパティを定義する必要があります。`MergeDefinitions` は `AWS::Serverless::Api` の `DefinitionUri` プロパティと互換性がありません。  
*デフォルト値*: `false`  
型: ブール  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `MethodSettings`   <a name="sam-api-methodsettings"></a>
ロギング、メトリクス、CacheTTL、スロットリングなどの API ステージのすべての設定を行います。  
*タイプ*: [MethodSetting](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigateway-stage-methodsetting.html) のリスト  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::ApiGateway::Stage`リソースの `[MethodSettings](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-stage.html#cfn-apigateway-stage-methodsettings)`プロパティに直接渡されます。

 `MinimumCompressionSize`   <a name="sam-api-minimumcompressionsize"></a>
クライアントの Accept-Encoding ヘッダーに基づくレスポンス本文の圧縮を許可します。圧縮は、レスポンス本文のサイズが設定したしきい値以上の場合にトリガーされます。本文サイズの最大しきい値は 10 MB (10,485,760 バイト) です。gzip、deflate、および identity の圧縮タイプがサポートされます。  
*タイプ:* 整数  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::ApiGateway::RestApi`リソースの `[MinimumCompressionSize](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-restapi.html#cfn-apigateway-restapi-minimumcompressionsize)`プロパティに直接渡されます。

 `Mode`   <a name="sam-api-mode"></a>
このプロパティは、OpenAPI を使用して REST API を定義するときにのみ適用されます。`Mode` は、API Gateway がリソース更新を処理する方法を決定します。詳細については、[https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-restapi.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-restapi.html) リソースタイプの[Mode](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-restapi.html#cfn-apigateway-restapi-mode)プロパティを参照してください。  
*有効な値*: `overwrite` または `merge`  
タイプ：文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::ApiGateway::RestApi`リソースの `[Mode](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-restapi.html#cfn-apigateway-restapi-mode)`プロパティに直接渡されます。

 `Models`   <a name="sam-api-models"></a>
API メソッドで使用されるスキーマです。これらのスキーマは、JSON または YAML を使用して記述できます。サンプルモデルについては、このページの下部にある「例」セクションを参照してください。  
*タイプ*: マップ  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `Name`   <a name="sam-api-name"></a>
API Gateway RestApi リソースの名前です。  
タイプ：文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::ApiGateway::RestApi`リソースの `[Name](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-restapi.html#cfn-apigateway-restapi-name)`プロパティに直接渡されます。

 `OpenApiVersion`   <a name="sam-api-openapiversion"></a>
使用する OpenApi のバージョンです。これは、Swagger 仕様の `2.0`、または `3.0.1` のような OpenApi 3.0 バージョンの 1 つにすることができます。OpenAPI の詳細については、「[OpenAPI Specification](https://swagger.io/specification/)」を参照してください。  
 AWS SAM は`Stage`デフォルトで というステージを作成します。このプロパティに有効な値を設定すると、ステージ `Stage` が作成されなくなります。
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

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

`Policy`  <a name="sam-api-policy"></a>
API の許可が含まれるポリシードキュメント。ポリシーの ARN を設定するには、区切り記号および `"execute-api:/"` と `"*"` の値として、`""` と `!Join` 組み込み関数を使用します。  
*Type*: JSON  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::ApiGateway::RestApi`リソースの [ Policy](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-restapi.html#cfn-apigateway-restapi-policy) プロパティに直接渡されます。

 `StageName`   <a name="sam-api-stagename"></a>
API Gateway が invoke Uniform Resource Identifier (URI) の最初のパスセグメントとして使用するステージの名前です。  
ステージリソースを参照するには、`<api-logical-id>.Stage` を使用します。[AWS::Serverless::Api](#sam-resource-api) リソースの指定時に生成されるリソースの参照に関する詳細については、「[CloudFormation AWS::Serverless::Apiが指定されているときに生成される リソース](sam-specification-generated-resources-api.md)」を参照してください。生成された CloudFormation リソースの一般的な情報については、「」を参照してください[の生成済み CloudFormation リソース AWS SAM](sam-specification-generated-resources.md)。  
*タイプ*: 文字列  
*必須*: はい  
*CloudFormation 互換性*: このプロパティは、 `AWS::ApiGateway::Stage`リソースの `[StageName](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-stage.html#cfn-apigateway-stage-stagename)`プロパティに似ています。SAM では必須ですが、API Gateway では必須ではありません。  
*その他の注意点*: 暗黙的な API には「prod」という名前のステージがあります。

 `Tags`   <a name="sam-api-tags"></a>
この API Gateway ステージに追加されるタグを指定するマップ (文字列対文字列) です。タグの有効なキーと値の詳細については、*AWS CloudFormation ユーザーガイド*の[リソースタグ](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html)を参照してください。  
*タイプ*: マップ  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::ApiGateway::Stage`リソースの `[Tags](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-stage.html#cfn-apigateway-stage-tags)`プロパティに似ています。SAM の Tags プロパティは、キーバリューペアで構成されています。CloudFormation では、タグオブジェクトのリストで構成されています。

 `TracingEnabled`   <a name="sam-api-tracingenabled"></a>
このステージに X-Ray を使用したアクティブトレーシングが有効化されているかどうかを示します。X-Ray の詳細については、*API Gateway デベロッパーガイド*の「[X-Ray を使用した REST API へのユーザーリクエストのトレース](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-xray.html)」を参照してください。  
型: ブール  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::ApiGateway::Stage`リソースの `[TracingEnabled](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-stage.html#cfn-apigateway-stage-tracingenabled)`プロパティに直接渡されます。

 `Variables`   <a name="sam-api-variables"></a>
ステージ変数を定義するマップ (文字列対文字列) で、変数名はキー、変数値は値です。変数名に使用できるのは英数字のみです。値は次の正規表現に一致する必要があります: `[A-Za-z0-9._~:/?#&=,-]+`。  
*タイプ*: マップ  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::ApiGateway::Stage`リソースの `[Variables](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-stage.html#cfn-apigateway-stage-variables)`プロパティに直接渡されます。

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

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

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

`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-api-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)」を参照してください。

`RootResourceId`  <a name="RootResourceId-fn::getatt"></a>
`RestApi` リソースのルートソース ID (`a0bc123d4e` など) です。

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

### SimpleApiExample
<a name="sam-resource-api--examples--simpleapiexample"></a>

API エンドポイントを持つ Lambda 関数を含む Hello World AWS SAM テンプレートファイル。これは、動作中のサーバーレスアプリケーションの完全な AWS SAM テンプレートファイルです。

#### YAML
<a name="sam-resource-api--examples--simpleapiexample--yaml"></a>

```
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: AWS SAM template with a simple API definition
Resources:
  ApiGatewayApi:
    Type: AWS::Serverless::Api
    Properties:
      StageName: prod
  ApiFunction: # Adds a GET method at the root resource via an Api event
    Type: AWS::Serverless::Function
    Properties:
      Events:
        ApiEvent:
          Type: Api
          Properties:
            Path: /
            Method: get
            RestApiId:
              Ref: ApiGatewayApi
      Runtime: python3.10
      Handler: index.handler
      InlineCode: |
        def handler(event, context):
            return {'body': 'Hello World!', 'statusCode': 200}
```

### ApiCorsExample
<a name="sam-resource-api--examples--apicorsexample"></a>

Lambda 統合と CORS 設定とともに、外部 Swagger ファイルで定義された API を持つ AWS SAM テンプレートスニペット。これは、[AWS::Serverless::Api](#sam-resource-api)定義を示す AWS SAM テンプレートファイルの一部にすぎません。

#### YAML
<a name="sam-resource-api--examples--apicorsexample--yaml"></a>

```
Resources:
  ApiGatewayApi:
    Type: AWS::Serverless::Api
    Properties:
      StageName: Prod
      # Allows www.example.com to call these APIs
      # SAM will automatically add AllowMethods with a list of methods for this API
      Cors: "'www.example.com'"
      DefinitionBody: # Pull in an OpenApi definition from S3
        'Fn::Transform':
          Name: 'AWS::Include'
          # Replace "bucket" with your bucket name
          Parameters:
            Location: s3://bucket/swagger.yaml
```

### ApiCognitoAuthExample
<a name="sam-resource-api--examples--apicognitoauthexample"></a>

Amazon Cognito を使用して API に対するリクエストを承認する API を含む AWS SAM テンプレートスニペット。これは、[AWS::Serverless::Api](#sam-resource-api)定義を示す AWS SAM テンプレートファイルの一部にすぎません。

#### YAML
<a name="sam-resource-api--examples--apicognitoauthexample--yaml"></a>

```
Resources:
  ApiGatewayApi:
    Type: AWS::Serverless::Api
    Properties:
      StageName: Prod
      Cors: "'*'"
      Auth:
        DefaultAuthorizer: MyCognitoAuthorizer
        Authorizers:
          MyCognitoAuthorizer:
            UserPoolArn:
              Fn::GetAtt: [MyCognitoUserPool, Arn]
```

### ApiModelsExample
<a name="sam-resource-api--examples--apimodelsexample"></a>

Models スキーマを含む API を含む AWS SAM テンプレートスニペット。これは AWS SAM テンプレートファイルの一部にすぎず、2 つのモデルスキーマを持つ[AWS::Serverless::Api](#sam-resource-api)定義を示しています。

#### YAML
<a name="sam-resource-api--examples--apimodelsexample--yaml"></a>

```
Resources:
  ApiGatewayApi:
    Type: AWS::Serverless::Api
    Properties:
      StageName: Prod
      Models:
        User:
          type: object
          required:
            - username
            - employee_id
          properties:
            username:
              type: string
            employee_id:
              type: integer
            department:
              type: string
        Item:
          type: object
          properties:
            count:
              type: integer
            category:
              type: string
            price:
              type: integer
```

### キャッシュの例
<a name="sam-resource-api--examples--caching-example"></a>

API エンドポイントを持つ Lambda 関数を含む Hello World AWS SAM テンプレートファイル。API では、1 つのリソースとメソッドに対してキャッシュが有効になっています。キャッシュの詳細については、「*API Gateway デベロッパーガイド*」の「[API キャッシュを有効にして応答性を強化する](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-caching.html)」を参照してください。

#### YAML
<a name="sam-resource-api--examples--caching-example--yaml"></a>

```
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: AWS SAM template with a simple API definition with caching turned on
Resources:
  ApiGatewayApi:
    Type: AWS::Serverless::Api
    Properties:
      StageName: prod
      CacheClusterEnabled: true
      CacheClusterSize: '0.5'
      MethodSettings:
        - ResourcePath: /
          HttpMethod: GET
          CachingEnabled: true
          CacheTtlInSeconds: 300
      Tags:
        CacheMethods: All 

  ApiFunction: # Adds a GET method at the root resource via an Api event
    Type: AWS::Serverless::Function
    Properties:
      Events:
        ApiEvent:
          Type: Api
          Properties:
            Path: /
            Method: get
            RestApiId:
              Ref: ApiGatewayApi
      Runtime: python3.10
      Handler: index.handler
      InlineCode: |
        def handler(event, context):
            return {'body': 'Hello World!', 'statusCode': 200}
```

### プライベート API を使用したカスタムドメインの例
<a name="sam-resource-api--examples--custom-domain-example"></a>

プライベートドメインにマッピングされた API エンドポイントを持つ Lambda 関数を含む Hello World AWS SAM テンプレートファイル。テンプレートはVPC エンドポイントとプライベートドメインの間にドメイン名アクセスの関連付けを作成します。詳細については、「[API Gateway でのプライベート API のカスタムドメイン名](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-private-custom-domains.html)」を参照してください。

#### YAML
<a name="sam-resource-api--examples--custom-domain-example--yaml"></a>

```
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: AWS SAM template configured with a custom domain using a private API

Parameters:
    DomainName:
      Type: String
      Default: mydomain.example.com
    CertificateArn:
      Type: String
    HostedZoneId:
      Type: String
    VpcEndpointId:
      Type: String
    VpcEndpointDomainName:
      Type: String
    VpcEndpointHostedZoneId:
      Type: String

Resources:
  MyFunction:
    Type: AWS::Serverless::Function
    Properties:
      InlineCode: |
        def handler(event, context):
            return {'body': 'Hello World!', 'statusCode': 200}
      Handler: index.handler
      Runtime: python3.13
      Events:
        Fetch:
          Type: Api
          Properties:
            RestApiId:
              Ref: MyApi
            Method: Get
            Path: /get
  MyApi:
    Type: AWS::Serverless::Api
    Properties:
      StageName: Prod
      EndpointConfiguration:
        Type: PRIVATE
        VPCEndpointIds:
        - !Ref VpcEndpointId
      Policy:
        Version: '2012-10-17		 	 	 '
        Statement:
        - Effect: Allow
          Principal: '*'
          Action: execute-api:Invoke
          Resource: execute-api:/*
        - Effect: Deny
          Principal: '*'
          Action: execute-api:Invoke
          Resource: execute-api:/*
          Condition:
            StringNotEquals:
              aws:SourceVpce: !Ref VpcEndpointId
      Domain:
        DomainName: !Ref DomainName
        CertificateArn: !Ref CertificateArn
        EndpointConfiguration: PRIVATE
        BasePath:
        - /
        Route53:
          HostedZoneId: !Ref HostedZoneId
          VpcEndpointDomainName: !Ref VpcEndpointDomainName
          VpcEndpointHostedZoneId: !Ref VpcEndpointHostedZoneId
        AccessAssociation:
          VpcEndpointId: !Ref VpcEndpointId
        Policy:
          Version: '2012-10-17		 	 	 '
          Statement:
          - Effect: Allow
            Principal: '*'
            Action: execute-api:Invoke
            Resource: execute-api:/*
          - Effect: Deny
            Principal: '*'
            Action: execute-api:Invoke
            Resource: execute-api:/*
            Condition:
              StringNotEquals:
                aws:SourceVpce: !Ref VpcEndpointId
```

# ApiAuth
<a name="sam-property-api-apiauth"></a>

API Gateway API へのアクセスを制御するための認可を設定します。

を使用してアクセスを設定するための詳細と例については、 AWS SAM 「」を参照してください[AWS SAM テンプレートを使用して API アクセスを制御する](serverless-controlling-access-to-apis.md)。

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

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

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

```
  AddApiKeyRequiredToCorsPreflight: Boolean
  [AddDefaultAuthorizerToCorsPreflight](#sam-api-apiauth-adddefaultauthorizertocorspreflight): Boolean
  [ApiKeyRequired](#sam-api-apiauth-apikeyrequired): Boolean
  [Authorizers](#sam-api-apiauth-authorizers): CognitoAuthorizer | LambdaTokenAuthorizer | LambdaRequestAuthorizer | AWS_IAM
  [DefaultAuthorizer](#sam-api-apiauth-defaultauthorizer): String
  [InvokeRole](#sam-api-apiauth-invokerole): String
  [ResourcePolicy](#sam-api-apiauth-resourcepolicy): ResourcePolicyStatement
  [UsagePlan](#sam-api-apiauth-usageplan): ApiUsagePlan
```

**注記**  
`Authorizers` プロパティには `AWS_IAM` が含まれていますが、`AWS_IAM` に追加の設定は必要ありません。例については、[AWS IAM](#sam-property-api-apiauth--examples--aws_iam)を参照してください。

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

 `AddApiKeyRequiredToCorsPreflight`   <a name="sam-api-apiauth-addapikeyrequiredtocorspreflight"></a>
`ApiKeyRequired` プロパティと `Cors` プロパティが設定されている場合に `AddApiKeyRequiredToCorsPreflight` を設定すると、API キーが  `Options` プロパティに追加される場合があります。  
型: ブール  
*必須:* いいえ  
*デフォルト*: `True`  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `AddDefaultAuthorizerToCorsPreflight`   <a name="sam-api-apiauth-adddefaultauthorizertocorspreflight"></a>
`DefaultAuthorizer` プロパティと `Cors` プロパティが設定されている場合に `AddDefaultAuthorizerToCorsPreflight` を設定すると、OpenAPI セクションの `Options` プロパティにデフォルトのオーソライザーが追加されます。  
型: ブール  
*必須:* いいえ  
*デフォルト*: True  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `ApiKeyRequired`   <a name="sam-api-apiauth-apikeyrequired"></a>
true に設定すると、すべての API イベントに API キーが必要になります。API キーの詳細については、*API Gateway デベロッパーガイド*の「[API キーを使用した使用量プランの作成と使用](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-api-usage-plans.html)」を参照してください。  
型: ブール  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `Authorizers`   <a name="sam-api-apiauth-authorizers"></a>
API Gateway API へのアクセスを制御するために使用されるオーソライザーです。  
詳細については、「[AWS SAM テンプレートを使用して API アクセスを制御する](serverless-controlling-access-to-apis.md)」を参照してください。  
*タイプ*: [CognitoAuthorizer](sam-property-api-cognitoauthorizer.md) \$1 [LambdaTokenAuthorizer](sam-property-api-lambdatokenauthorizer.md) \$1 [LambdaRequestAuthorizer](sam-property-api-lambdarequestauthorizer.md) \$1 AWS\$1IAM  
*必須:* いいえ  
*デフォルト*: なし  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のプロパティはありません。  
*その他の注意点*: SAM は、API の OpenApi 定義にオーソライザーを追加します。

 `DefaultAuthorizer`   <a name="sam-api-apiauth-defaultauthorizer"></a>
API Gateway API のデフォルトオーソライザーを指定します。これは、デフォルトで API コールの認証に使用されます。  
この API に関連付けられた関数の Api EventSource が IAM アクセス許可を使用するように設定されている場合、このプロパティは `AWS_IAM` に設定する必要があります。それ以外に設定すると、エラーが発生します。
*タイプ*: 文字列  
*必須:* いいえ  
*デフォルト*: なし  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `InvokeRole`   <a name="sam-api-apiauth-invokerole"></a>
すべてのリソースとメソッドの統合認証情報をこの値に設定します。  
`CALLER_CREDENTIALS` が `arn:aws:iam:::<user>/` にマップされます。これは、発信者の認証情報を使用してエンドポイントを呼び出します。  
有効な値: `CALLER_CREDENTIALS`、`NONE`、`IAMRoleArn`  
*タイプ*: 文字列  
*必須:* いいえ  
*デフォルト*: `CALLER_CREDENTIALS`  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `ResourcePolicy`   <a name="sam-api-apiauth-resourcepolicy"></a>
API 上のすべてのメソッドとパスのリソースポリシーを設定します。  
*タイプ*: [ResourcePolicyStatement](sam-property-api-resourcepolicystatement.md)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。  
*その他の注意点*: この設定は、`AWS::Serverless::Function` を使用して個々の [ApiFunctionAuth](sam-property-function-apifunctionauth.md) で定義することも可能です。これは、`EndpointConfiguration: PRIVATE` を使用した API に必要です。

 `UsagePlan`   <a name="sam-api-apiauth-usageplan"></a>
この API に関連付けられた使用量プランを設定します。使用量プランの詳細については、*API Gateway デベロッパーガイド*の「[API キーを使用した使用量プランの作成と使用](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-api-usage-plans.html)」を参照してください。  
この AWS SAM プロパティが設定されている場合、このプロパティは [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-usageplan.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-usageplan.html)、、 [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-usageplankey.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-usageplankey.html)の 3 つの追加 CloudFormation リソースを生成します[https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-apikey.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-apikey.html)。このシナリオの詳細については、「[UsagePlan プロパティが指定されている](sam-specification-generated-resources-api.md#sam-specification-generated-resources-api-usage-plan)」を参照してください。生成された CloudFormation リソースの一般的な情報については、「」を参照してください[の生成済み CloudFormation リソース AWS SAM](sam-specification-generated-resources.md)。  
*タイプ*: [APIusagePlan](sam-property-api-apiusageplan.md)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

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

### CognitoAuth
<a name="sam-property-api-apiauth--examples--cognitoauth"></a>

Cognito 認証の例

#### YAML
<a name="sam-property-api-apiauth--examples--cognitoauth--yaml"></a>

```
Auth:
  Authorizers:
    MyCognitoAuth:
     UserPoolArn:
       Fn::GetAtt:
         - MyUserPool
         - Arn
     AuthType: "COGNITO_USER_POOLS"
  DefaultAuthorizer: MyCognitoAuth
  InvokeRole: CALLER_CREDENTIALS
  AddDefaultAuthorizerToCorsPreflight: false
  ApiKeyRequired: false
  ResourcePolicy:
    CustomStatements: [{
      "Effect": "Allow",
      "Principal": "*",
      "Action": "execute-api:Invoke",
      "Resource": "execute-api:/Prod/GET/pets",
      "Condition": {
          "IpAddress": {
              "aws:SourceIp": "1.2.3.4"
          }
        }
    }]
    IpRangeDenylist:
      - "10.20.30.40"
```

### AWS IAM
<a name="sam-property-api-apiauth--examples--aws_iam"></a>

AWS IAM の例

#### YAML
<a name="sam-property-api-apiauth--examples--cognitoauth--yaml"></a>

```
Auth:
  Authorizers: AWS_IAM
```

# ApiUsagePlan
<a name="sam-property-api-apiusageplan"></a>

API Gateway API の使用量プランを設定します。使用量プランの詳細については、*API Gateway デベロッパーガイド*の「[API キーを使用した使用量プランの作成と使用](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-api-usage-plans.html)」を参照してください。

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

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

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

```
  [CreateUsagePlan](#sam-api-apiusageplan-createusageplan): String
  [Description](#sam-api-apiusageplan-description): String
  [Quota](#sam-api-apiusageplan-quota): [QuotaSettings](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-usageplan.html#cfn-apigateway-usageplan-quota)
  [Tags](#sam-api-apiusageplan-tags): List
  [Throttle](#sam-api-apiusageplan-throttle): [ThrottleSettings](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-usageplan.html#cfn-apigateway-usageplan-throttle)
  [UsagePlanName](#sam-api-apiusageplan-usageplanname): String
```

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

 `CreateUsagePlan`   <a name="sam-api-apiusageplan-createusageplan"></a>
この使用量プランの設定方法を決定します。有効な値は、`PER_API`、`SHARED`、`NONE` です。  
`PER_API` は、この API に固有の [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-usageplan.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-usageplan.html)、[https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-apikey.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-apikey.html)、および [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-usageplankey.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-usageplankey.html) リソースを作成します。これらのリソースには、それぞれ `<api-logical-id>UsagePlan`、`<api-logical-id>ApiKey`、および `<api-logical-id>UsagePlanKey` の論理 ID があります。  
`SHARED` は[https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-usageplan.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-usageplan.html)、同じ AWS SAM テンプレート`CreateUsagePlan: SHARED`に がある API 間で共有される [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-apikey.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-apikey.html)、、および [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-usageplankey.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-usageplankey.html)リソースを作成します。これらのリソースには、それぞれ `ServerlessUsagePlan`、`ServerlessApiKey`、および `ServerlessUsagePlanKey` の論理 ID があります。このオプションを使用する場合は、競合する定義と不確実な状態を避けるために、この使用量プランの設定を 1 つの API リソースだけに追加することが推奨されます。  
`NONE` は、この API の使用プランの作成または関連付けを無効にします。これは、[AWS SAM テンプレートのグローバルセクション](sam-specification-template-anatomy-globals.md) で `SHARED` または `PER_API` が指定されている場合にのみ必要になります。  
*有効な値*: `PER_API`、`SHARED`、`NONE`  
*タイプ*: 文字列  
*必須*: はい  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `Description`   <a name="sam-api-apiusageplan-description"></a>
使用量プランの説明です。  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::ApiGateway::UsagePlan`リソースの `[Description](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-usageplan.html#cfn-apigateway-usageplan-description)`プロパティに直接渡されます。

 `Quota`   <a name="sam-api-apiusageplan-quota"></a>
指定された間隔内にユーザーが実行できるリクエストの数を設定します。  
*タイプ*: [QuotaSettings](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-usageplan.html#cfn-apigateway-usageplan-quota)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::ApiGateway::UsagePlan`リソースの `[Quota](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-usageplan.html#cfn-apigateway-usageplan-quota)`プロパティに直接渡されます。

 `Tags`   <a name="sam-api-apiusageplan-tags"></a>
使用量プランに関連付ける任意のタグの配列 (キーバリューペア) です。  
このプロパティは、[CloudFormation のタグタイプ](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html)を使用します。  
*タイプ*: リスト  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::ApiGateway::UsagePlan`リソースの `[Tags](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-usageplan.html#cfn-apigateway-usageplan-tags)`プロパティに直接渡されます。

 `Throttle`   <a name="sam-api-apiusageplan-throttle"></a>
全体的なリクエスト率 (1 秒あたりの平均リクエスト数) とバーストキャパシティを設定します。  
*タイプ*: [ThrottleSettings](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-usageplan.html#cfn-apigateway-usageplan-throttle)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::ApiGateway::UsagePlan`リソースの `[Throttle](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-usageplan.html#cfn-apigateway-usageplan-throttle)`プロパティに直接渡されます。

 `UsagePlanName`   <a name="sam-api-apiusageplan-usageplanname"></a>
使用量プランの名前です。  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::ApiGateway::UsagePlan`リソースの `[UsagePlanName](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-usageplan.html#cfn-apigateway-usageplan-usageplanname)`プロパティに直接渡されます。

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

### UsagePlan
<a name="sam-property-api-apiusageplan--examples--usageplan"></a>

以下は、使用量プランの例です。

#### YAML
<a name="sam-property-api-apiusageplan--examples--usageplan--yaml"></a>

```
Auth:
  UsagePlan:
    CreateUsagePlan: PER_API
    Description: Usage plan for this API
    Quota:
      Limit: 500
      Period: MONTH
    Throttle:
      BurstLimit: 100
      RateLimit: 50
    Tags:
      - Key: TagName
        Value: TagValue
```

# CognitoAuthorizer
<a name="sam-property-api-cognitoauthorizer"></a>

Amazon Cognito ユーザープールオーソライザーを定義します。

詳細情報と例については、「[AWS SAM テンプレートを使用して API アクセスを制御する](serverless-controlling-access-to-apis.md)」を参照してください。

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

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

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

```
  [AuthorizationScopes](#sam-api-cognitoauthorizer-authorizationscopes): List
  [Identity](#sam-api-cognitoauthorizer-identity): CognitoAuthorizationIdentity
  [UserPoolArn](#sam-api-cognitoauthorizer-userpoolarn): String
```

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

 `AuthorizationScopes`   <a name="sam-api-cognitoauthorizer-authorizationscopes"></a>
このオーソライザーの認可スコープのリストです。  
*タイプ*: リスト  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `Identity`   <a name="sam-api-cognitoauthorizer-identity"></a>
このプロパティは、オーソライザーの受信リクエストに `IdentitySource` を指定するために使用できます。  
*タイプ*: [CognitoAuthorizationIdentity](sam-property-api-cognitoauthorizationidentity.md)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `UserPoolArn`   <a name="sam-api-cognitoauthorizer-userpoolarn"></a>
この Cognito オーソライザーを追加するユーザープールを参照する、またはユーザープール arn を指定することができます  
*タイプ*: 文字列  
*必須*: はい  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

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

### CognitoAuth
<a name="sam-property-api-cognitoauthorizer--examples--cognitoauth"></a>

Cognito 認証の例です。

#### YAML
<a name="sam-property-api-cognitoauthorizer--examples--cognitoauth--yaml"></a>

```
Auth:
  Authorizers:
    MyCognitoAuth:
      AuthorizationScopes:
        - scope1
        - scope2
      UserPoolArn:
        Fn::GetAtt:
          - MyCognitoUserPool
          - Arn
      Identity:
        Header: MyAuthorizationHeader
        ValidationExpression: myauthvalidationexpression
```

# CognitoAuthorizationIdentity
<a name="sam-property-api-cognitoauthorizationidentity"></a>

このプロパティは、オーソライザーの受信リクエストに IdentitySource を指定するために使用できます。IdentitySource の詳細については、「[ApiGateway オーソライザーの OpenApi 拡張機能](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-swagger-extensions-authorizer.html)」を参照してください。

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

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

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

```
  [Header](#sam-api-cognitoauthorizationidentity-header): String
  [ReauthorizeEvery](#sam-api-cognitoauthorizationidentity-reauthorizeevery): Integer
  [ValidationExpression](#sam-api-cognitoauthorizationidentity-validationexpression): String
```

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

 `Header`   <a name="sam-api-cognitoauthorizationidentity-header"></a>
OpenApi 定義で認可用のヘッダー名を指定します。  
*タイプ*: 文字列  
*必須:* いいえ  
*デフォルト*: Authorization  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `ReauthorizeEvery`   <a name="sam-api-cognitoauthorizationidentity-reauthorizeevery"></a>
API Gateway がオーソライザー結果をキャッシュする時間を指定する有効期限 (TTL) (秒) です。0 より大きい値を指定する場合、API Gateway が認証レスポンスをキャッシュします。デフォルトで、API Gateway はこのプロパティを 300 に設定します。最大値は 3600、つまり 1 時間です。  
*タイプ*: 整数  
*必須:* いいえ  
*デフォルト*: 300  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `ValidationExpression`   <a name="sam-api-cognitoauthorizationidentity-validationexpression"></a>
受信アイデンティティを検証するための検証式を指定します。  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

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

### CognitoAuthIdentity
<a name="sam-property-api-cognitoauthorizationidentity--examples--cognitoauthidentity"></a>

#### YAML
<a name="sam-property-api-cognitoauthorizationidentity--examples--cognitoauthidentity--yaml"></a>

```
Identity:
  Header: MyCustomAuthHeader
  ValidationExpression: Bearer.*
  ReauthorizeEvery: 30
```

# LambdaRequestAuthorizer
<a name="sam-property-api-lambdarequestauthorizer"></a>

Lambda 関数を使用して、API へのアクセスを制御するように Lambda オーソライザーを設定します。

詳細な説明と例については、[AWS SAM テンプレートを使用して API アクセスを制御する](serverless-controlling-access-to-apis.md) を参照してください。

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

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

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

```
DisableFunctionDefaultPermissions: Boolean
[FunctionArn](#sam-api-lambdarequestauthorizer-functionarn): String
[FunctionInvokeRole](#sam-api-lambdarequestauthorizer-functioninvokerole): String
[FunctionPayloadType](#sam-api-lambdarequestauthorizer-functionpayloadtype): String
[Identity](#sam-api-lambdarequestauthorizer-identity): LambdaRequestAuthorizationIdentity
```

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

 `DisableFunctionDefaultPermissions`   <a name="sam-api-lambdarequestauthorizer-disablefunctiondefaultpermissions"></a>
`true` リソースとオーソライザー Lambda 関数間のアクセス許可をプロビジョニング`AWS::Lambda::Permissions`する `AWS::Serverless::Api`リソースが によって自動的に作成 AWS SAM されないように を指定します。  
*デフォルト値*: `false`  
型: ブール  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `FunctionArn`   <a name="sam-api-lambdarequestauthorizer-functionarn"></a>
API に対する認可を提供する Lambda 関数の関数 ARN を指定します。  
AWS SAM が に指定されていると、 `FunctionArn`は自動的に `AWS::Lambda::Permissions`リソースを作成します`AWS::Serverless::Api`。`AWS::Lambda::Permissions` リソースは、API とオーソライザー Lambda 関数の間の許可をプロビジョニングします。
*タイプ*: 文字列  
*必須*: はい  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `FunctionInvokeRole`   <a name="sam-api-lambdarequestauthorizer-functioninvokerole"></a>
オーソライザーの認証情報を Lambda オーソライザーの OpenApi 定義に追加します。  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `FunctionPayloadType`   <a name="sam-api-lambdarequestauthorizer-functionpayloadtype"></a>
このプロパティは、API の Lambda オーソライザーのタイプを定義するために使用できます。  
*有効な値*: `TOKEN` または `REQUEST`  
タイプ：文字列  
*必須:* いいえ  
*デフォルト*: `TOKEN`  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `Identity`   <a name="sam-api-lambdarequestauthorizer-identity"></a>
このプロパティは、オーソライザーの受信リクエストに `IdentitySource` を指定するために使用できます。このプロパティが必要になるのは、`FunctionPayloadType` プロパティが `REQUEST` に設定されている場合のみです。  
*タイプ*: [LambdaRequestAuthorizationIdentity](sam-property-api-lambdarequestauthorizationidentity.md)  
*必須*: 条件に応じて異なります  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

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

### LambdaRequestAuth
<a name="sam-property-api-lambdarequestauthorizer--examples--lambdarequestauth"></a>

#### YAML
<a name="sam-property-api-lambdarequestauthorizer--examples--lambdarequestauth--yaml"></a>

```
Authorizers:
  MyLambdaRequestAuth:
    FunctionPayloadType: REQUEST
    FunctionArn:
      Fn::GetAtt:
        - MyAuthFunction
        - Arn
    FunctionInvokeRole:
      Fn::GetAtt:
        - LambdaAuthInvokeRole
        - Arn
    Identity:
      Headers:
        - Authorization1
```

# LambdaRequestAuthorizationIdentity
<a name="sam-property-api-lambdarequestauthorizationidentity"></a>

このプロパティは、オーソライザーの受信リクエストに IdentitySource を指定するために使用できます。IdentitySource の詳細については、「[ApiGateway オーソライザーの OpenApi 拡張機能](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-swagger-extensions-authorizer.html)」を参照してください。

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

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

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

```
  [Context](#sam-api-lambdarequestauthorizationidentity-context): List
  [Headers](#sam-api-lambdarequestauthorizationidentity-headers): List
  [QueryStrings](#sam-api-lambdarequestauthorizationidentity-querystrings): List
  [ReauthorizeEvery](#sam-api-lambdarequestauthorizationidentity-reauthorizeevery): Integer
  [StageVariables](#sam-api-lambdarequestauthorizationidentity-stagevariables): List
```

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

 `Context`   <a name="sam-api-lambdarequestauthorizationidentity-context"></a>
所定のコンテキスト文字列を `context.contextString` 形式のマッピング式に変換します。  
*タイプ*: リスト  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `Headers`   <a name="sam-api-lambdarequestauthorizationidentity-headers"></a>
ヘッダーを、`method.request.header.name` 形式のマッピング式のカンマ区切り文字列に変換します。  
*タイプ*: リスト  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `QueryStrings`   <a name="sam-api-lambdarequestauthorizationidentity-querystrings"></a>
所定のクエリ文字列を、`method.request.querystring.queryString` 形式のマッピング式のカンマ区切り文字列に変換します。  
*タイプ*: リスト  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `ReauthorizeEvery`   <a name="sam-api-lambdarequestauthorizationidentity-reauthorizeevery"></a>
API Gateway がオーソライザー結果をキャッシュする時間を指定する有効期限 (TTL) (秒) です。0 より大きい値を指定する場合、API Gateway が認証レスポンスをキャッシュします。デフォルトで、API Gateway はこのプロパティを 300 に設定します。最大値は 3600、つまり 1 時間です。  
*タイプ*: 整数  
*必須:* いいえ  
*デフォルト*: 300  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `StageVariables`   <a name="sam-api-lambdarequestauthorizationidentity-stagevariables"></a>
所定のステージ変数を、`stageVariables.stageVariable` 形式のマッピング式のカンマ区切り文字列に変換します。  
*タイプ*: リスト  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

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

### LambdaRequestIdentity
<a name="sam-property-api-lambdarequestauthorizationidentity--examples--lambdarequestidentity"></a>

#### YAML
<a name="sam-property-api-lambdarequestauthorizationidentity--examples--lambdarequestidentity--yaml"></a>

```
Identity:
  QueryStrings:
    - auth
  Headers:
    - Authorization
  StageVariables:
    - VARIABLE
  Context:
    - authcontext
  ReauthorizeEvery: 100
```

# LambdaTokenAuthorizer
<a name="sam-property-api-lambdatokenauthorizer"></a>

Lambda 関数を使用して、API へのアクセスを制御するように Lambda オーソライザーを設定します。

詳細な説明と例については、[AWS SAM テンプレートを使用して API アクセスを制御する](serverless-controlling-access-to-apis.md) を参照してください。

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

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

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

```
DisableFunctionDefaultPermissions: Boolean
[FunctionArn](#sam-api-lambdatokenauthorizer-functionarn): String
[FunctionInvokeRole](#sam-api-lambdatokenauthorizer-functioninvokerole): String
[FunctionPayloadType](#sam-api-lambdatokenauthorizer-functionpayloadtype): String
[Identity](#sam-api-lambdatokenauthorizer-identity): LambdaTokenAuthorizationIdentity
```

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

 `DisableFunctionDefaultPermissions`   <a name="sam-api-lambdatokenauthorizer-disablefunctiondefaultpermissions"></a>
`true` リソースとオーソライザー Lambda 関数間のアクセス許可をプロビジョニング`AWS::Lambda::Permissions`する `AWS::Serverless::Api`リソースが によって自動的に作成 AWS SAM されないように を指定します。  
*デフォルト値*: `false`  
型: ブール  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `FunctionArn`   <a name="sam-api-lambdatokenauthorizer-functionarn"></a>
API に対する認可を提供する Lambda 関数の関数 ARN を指定します。  
AWS SAM が に指定されていると、 `FunctionArn`は自動的に `AWS::Lambda::Permissions`リソースを作成します`AWS::Serverless::Api`。`AWS::Lambda::Permissions` リソースは、API とオーソライザー Lambda 関数の間の許可をプロビジョニングします。
*タイプ*: 文字列  
*必須*: はい  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `FunctionInvokeRole`   <a name="sam-api-lambdatokenauthorizer-functioninvokerole"></a>
オーソライザーの認証情報を Lambda オーソライザーの OpenApi 定義に追加します。  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `FunctionPayloadType`   <a name="sam-api-lambdatokenauthorizer-functionpayloadtype"></a>
このプロパティは、API の Lambda オーソライザーのタイプを定義するために使用できます。  
*有効な値*: `TOKEN` または `REQUEST`  
タイプ：文字列  
*必須:* いいえ  
*デフォルト*: `TOKEN`  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `Identity`   <a name="sam-api-lambdatokenauthorizer-identity"></a>
このプロパティは、オーソライザーの受信リクエストに `IdentitySource` を指定するために使用できます。このプロパティが必要になるのは、`FunctionPayloadType` プロパティが `REQUEST` に設定されている場合のみです。  
*タイプ*: [LambdaTokenAuthorizationIdentity](sam-property-api-lambdatokenauthorizationidentity.md)  
*必須*: 条件に応じて異なります  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

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

### LambdaTokenAuth
<a name="sam-property-api-lambdatokenauthorizer--examples--lambdatokenauth"></a>

#### YAML
<a name="sam-property-api-lambdatokenauthorizer--examples--lambdatokenauth--yaml"></a>

```
Authorizers:
  MyLambdaTokenAuth:
    FunctionArn:
      Fn::GetAtt:
        - MyAuthFunction
        - Arn
    Identity:
      Header: MyCustomAuthHeader # OPTIONAL; Default: 'Authorization'
      ValidationExpression: mycustomauthexpression # OPTIONAL
      ReauthorizeEvery: 20 # OPTIONAL; Service Default: 300
```

### BasicLambdaTokenAuth
<a name="sam-property-api-lambdatokenauthorizer--examples--basiclambdatokenauth"></a>

#### YAML
<a name="sam-property-api-lambdatokenauthorizer--examples--basiclambdatokenauth--yaml"></a>

```
Authorizers:
  MyLambdaTokenAuth:
    FunctionArn:
      Fn::GetAtt:
        - MyAuthFunction
        - Arn
```

# LambdaTokenAuthorizationIdentity
<a name="sam-property-api-lambdatokenauthorizationidentity"></a>

このプロパティは、オーソライザーの受信リクエストに IdentitySource を指定するために使用できます。IdentitySource の詳細については、「[ApiGateway オーソライザーの OpenApi 拡張機能](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-swagger-extensions-authorizer.html)」を参照してください。

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

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

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

```
  [Header](#sam-api-lambdatokenauthorizationidentity-header): String
  [ReauthorizeEvery](#sam-api-lambdatokenauthorizationidentity-reauthorizeevery): Integer
  [ValidationExpression](#sam-api-lambdatokenauthorizationidentity-validationexpression): String
```

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

 `Header`   <a name="sam-api-lambdatokenauthorizationidentity-header"></a>
OpenApi 定義で認可用のヘッダー名を指定します。  
*タイプ*: 文字列  
*必須:* いいえ  
*デフォルト*: Authorization  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `ReauthorizeEvery`   <a name="sam-api-lambdatokenauthorizationidentity-reauthorizeevery"></a>
API Gateway がオーソライザー結果をキャッシュする時間を指定する有効期限 (TTL) (秒) です。0 より大きい値を指定する場合、API Gateway が認証レスポンスをキャッシュします。デフォルトで、API Gateway はこのプロパティを 300 に設定します。最大値は 3600、つまり 1 時間です。  
*タイプ*: 整数  
*必須:* いいえ  
*デフォルト*: 300  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `ValidationExpression`   <a name="sam-api-lambdatokenauthorizationidentity-validationexpression"></a>
受信アイデンティティを検証するための検証式を指定します。  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

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

### LambdaTokenIdentity
<a name="sam-property-api-lambdatokenauthorizationidentity--examples--lambdatokenidentity"></a>

#### YAML
<a name="sam-property-api-lambdatokenauthorizationidentity--examples--lambdatokenidentity--yaml"></a>

```
Identity:
  Header: MyCustomAuthHeader
  ValidationExpression: Bearer.*
  ReauthorizeEvery: 30
```

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

#### YAML
<a name="sam-property-api-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
```

# ApiDefinition
<a name="sam-property-api-apidefinition"></a>

API を定義する OpenAPI ドキュメントです。

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

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

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

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

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

 `Bucket`   <a name="sam-api-apidefinition-bucket"></a>
OpenAPI ファイルが保存されている Amazon S3 バケットの名前です。  
*タイプ*: 文字列  
*必須*: はい  
*CloudFormation 互換性*: このプロパティは、 `AWS::ApiGateway::RestApi` `S3Location` データ型の `[Bucket](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigateway-restapi-s3location.html#cfn-apigateway-restapi-s3location-bucket)`プロパティに直接渡されます。

 `Key`   <a name="sam-api-apidefinition-key"></a>
OpenAPI ファイルの Amazon S3 キーです。  
*タイプ*: 文字列  
*必須*: はい  
*CloudFormation 互換性*: このプロパティは、 `AWS::ApiGateway::RestApi` `S3Location` データ型の `[Key](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigateway-restapi-s3location.html#cfn-apigateway-restapi-s3location-key)`プロパティに直接渡されます。

 `Version`   <a name="sam-api-apidefinition-version"></a>
バージョン管理されたオブジェクトの場合は、OpenAPI ファイルのバージョンです。  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::ApiGateway::RestApi` `S3Location` データ型の `[Version](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigateway-restapi-s3location.html#cfn-apigateway-restapi-s3location-version)`プロパティに直接渡されます。

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

### 定義 URI の例
<a name="sam-property-api-apidefinition--examples--definition-uri-example"></a>

API 定義の例

#### YAML
<a name="sam-property-api-apidefinition--examples--definition-uri-example--yaml"></a>

```
DefinitionUri:
  Bucket: amzn-s3-demo-bucket-name
  Key: mykey-name
  Version: 121212
```

# CorsConfiguration
<a name="sam-property-api-corsconfiguration"></a>

API Gateway API のクロスオリジンリソース共有 (CORS) を管理します。許可するドメインを文字列として指定するか、追加の CORS 設定でディクショナリを指定します。

**注記**  
CORS では AWS SAM 、OpenAPI 定義を変更する必要があります。CORS を有効にするには、`DefinitionBody` の中でインライン OpenAPI 定義を作成します。`CorsConfiguration` が OpenAPI 定義とプロパティレベルで設定されている場合、 はそれらを AWS SAM マージします。プロパティレベルは OpenAPI 定義よりも優先されます。

CORS の詳細については、*Amazon API Gateway デベロッパーガイド*の「[REST API リソースの CORS を有効にする](https://docs.aws.amazon.com/apigateway/latest/developerguide/how-to-cors.html)」を参照してください。

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

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

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

```
  [AllowCredentials](#sam-api-corsconfiguration-allowcredentials): Boolean
  [AllowHeaders](#sam-api-corsconfiguration-allowheaders): String
  [AllowMethods](#sam-api-corsconfiguration-allowmethods): String
  [AllowOrigin](#sam-api-corsconfiguration-alloworigin): String
  [MaxAge](#sam-api-corsconfiguration-maxage): String
```

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

 `AllowCredentials`   <a name="sam-api-corsconfiguration-allowcredentials"></a>
リクエストに認証情報を含めることができるかどうかを示すブール値です。  
型: ブール  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `AllowHeaders`   <a name="sam-api-corsconfiguration-allowheaders"></a>
許可するヘッダーの文字列です。  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `AllowMethods`   <a name="sam-api-corsconfiguration-allowmethods"></a>
許可する HTTP メソッドが含まれる文字列です。  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `AllowOrigin`   <a name="sam-api-corsconfiguration-alloworigin"></a>
許可するオリジンの文字列です。これは、文字列形式のカンマ区切りリストになります。  
*タイプ*: 文字列  
*必須*: はい  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `MaxAge`   <a name="sam-api-corsconfiguration-maxage"></a>
CORS プリフライトリクエストをキャッシュする秒数が含まれる文字列です。  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

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

### CorsConfiguration
<a name="sam-property-api-corsconfiguration--examples--corsconfiguration"></a>

CORS 設定の例です。これは、CORS が設定された[AWS::Serverless::Api](sam-resource-api.md)定義と を示す AWS SAM テンプレートファイルの一部にすぎません[AWS::Serverless::Function](sam-resource-function.md)。Lambda プロキシ統合または HTTP プロキシ統合を使用する場合、バックエンドが `Access-Control-Allow-Origin`、`Access-Control-Allow-Methods`、および `Access-Control-Allow-Headers`ヘッダーを返す必要があります。

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

```
Resources:
  ApiGatewayApi:
    Type: AWS::Serverless::Api
    Properties:
      StageName: Prod
      Cors:
        AllowMethods: "'POST, GET'"
        AllowHeaders: "'X-Forwarded-For'"
        AllowOrigin: "'https://example.com'"
        MaxAge: "'600'"
        AllowCredentials: true
  ApiFunction: # Adds a GET method at the root resource via an Api event
    Type: AWS::Serverless::Function
    Properties:
      Events:
        ApiEvent:
          Type: Api
          Properties:
            Path: /
            Method: get
            RestApiId:
              Ref: ApiGatewayApi
      Runtime: python3.10
      Handler: index.handler
      InlineCode: |
        import json
        def handler(event, context):
          return {
          'statusCode': 200,
          'headers': {
            'Access-Control-Allow-Headers': 'Content-Type',
            'Access-Control-Allow-Origin': 'https://example.com',
            'Access-Control-Allow-Methods': 'POST, GET'
            },
          'body': json.dumps('Hello from Lambda!')
          }
```

# DomainConfiguration
<a name="sam-property-api-domainconfiguration"></a>

API のカスタムドメインを設定します。

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

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

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

```
  [AccessAssociation](#sam-api-domainconfiguration-domainaccessassociation): DomainAccessAssociation
  [BasePath](#sam-api-domainconfiguration-basepath): List
  [CertificateArn](#sam-api-domainconfiguration-certificatearn): String
  [DomainName](#sam-api-domainconfiguration-domainname): String
  [EndpointConfiguration](#sam-api-domainconfiguration-endpointconfiguration): String
  [MutualTlsAuthentication](#sam-api-domainconfiguration-mutualtlsauthentication): [MutualTlsAuthentication](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-domainname.html#cfn-apigateway-domainname-mutualtlsauthentication)
  [NormalizeBasePath](#sam-api-domainconfiguration-normalizebasepath): Boolean
  [OwnershipVerificationCertificateArn](#sam-api-domainconfiguration-ownershipverificationcertificatearn): String
  [Policy: ](#sam-api-domainconfiguration-policy)Json
  [Route53](#sam-api-domainconfiguration-route53): Route53Configuration
  [SecurityPolicy](#sam-api-domainconfiguration-securitypolicy): String
```

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

 `AccessAssociation`   <a name="sam-api-domainconfiguration-domainaccessassociation"></a>
` AWS::ApiGateway::DomainNameAccessAssociation` リソースの生成に必要な設定。  
AWS SAM このプロパティが設定されると、 は [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-domainnameaccessassociation.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-domainnameaccessassociation.html)リソースを生成します。生成された CloudFormation リソースの詳細については、「」を参照してください[の生成済み CloudFormation リソース AWS SAM](sam-specification-generated-resources.md)。  
*タイプ*: [DomainAccessAssociation](sam-property-api-domainaccessassociation.md)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `BasePath`   <a name="sam-api-domainconfiguration-basepath"></a>
Amazon API Gateway ドメイン名で設定する basepaths のリストです。  
*タイプ*: リスト  
*必須:* いいえ  
*デフォルト*: /  
*CloudFormation 互換性*: このプロパティは、 `AWS::ApiGateway::BasePathMapping` resource. AWS SAM creates の `[BasePath](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-basepathmapping.html#cfn-apigateway-basepathmapping-basepath)` プロパティに似ています。このプロパティで`BasePath`指定された ごとに 1 つずつ、複数の`AWS::ApiGateway::BasePathMapping`リソースを作成します。

 `CertificateArn`   <a name="sam-api-domainconfiguration-certificatearn"></a>
このドメイン名のエンドポイントの AWS マネージド証明書の Amazon リソースネーム (ARN)。 は、サポートされている唯一のソース AWS Certificate Manager です。  
*タイプ*: 文字列  
*必須*: はい  
*CloudFormation 互換性*: このプロパティは、 `AWS::ApiGateway::DomainName`リソースの `[CertificateArn](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-domainname.html#cfn-apigateway-domainname-certificatearn)`プロパティに似ています。`EndpointConfiguration` が `REGIONAL` (デフォルト値) に設定されている場合、`CertificateArn` は `AWS::ApiGateway::DomainName` の [RegionalCertificateArn](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-domainname.html#cfn-apigateway-domainname-regionalcertificatearn) にマップされます。`EndpointConfiguration` が `EDGE` に設定されている場合、`CertificateArn` は `AWS::ApiGateway::DomainName` の [CertificateArn](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-domainname.html#cfn-apigateway-domainname-certificatearn) にマップされます。`EndpointConfiguration` が `PRIVATE` に設定されている場合、このプロパティは [AWS::ApiGateway::DomainNameV2](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-domainnamev2) リソースに渡されます。  
*その他の注意*: `EDGE`エンドポイントの場合は、 `us-east-1` AWS リージョンで証明書を作成する必要があります。

 `DomainName`   <a name="sam-api-domainconfiguration-domainname"></a>
API Gateway API のカスタムドメイン名です。大文字はサポートされていません。  
AWS SAM このプロパティが設定されると、 は [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-domainname.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-domainname.html)リソースを生成します。このシナリオの詳細については、「[DomainName プロパティが指定されている](sam-specification-generated-resources-api.md#sam-specification-generated-resources-api-domain-name)」を参照してください。生成された CloudFormation リソースの詳細については、「」を参照してください[の生成済み CloudFormation リソース AWS SAM](sam-specification-generated-resources.md)。  
*タイプ*: 文字列  
*必須*: はい  
*CloudFormation 互換性*: このプロパティは、 `AWS::ApiGateway::DomainName`リソースの `[DomainName](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-domainname.html#cfn-apigateway-domainname-domainname)`プロパティに直接渡されるか、EndpointConfiguration が に設定されている[https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-domainnamev2](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-domainnamev2)ときに に渡されます`PRIVATE`。

 `EndpointConfiguration`   <a name="sam-api-domainconfiguration-endpointconfiguration"></a>
カスタムドメインにマップする API Gateway エンドポイントのタイプを定義します。このプロパティの値は、`CertificateArn`プロパティのマッピング方法を決定します CloudFormation。  
*有効な値*: `EDGE`、`REGIONAL`、または `PRIVATE`  
*タイプ*: 文字列  
*必須:* いいえ  
*デフォルト*: `REGIONAL`  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `MutualTlsAuthentication`   <a name="sam-api-domainconfiguration-mutualtlsauthentication"></a>
カスタムドメイン名の相互 Transport Layer Security (TLS) 認証設定です。  
*タイプ*: [MutualTlsAuthentication](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-domainname.html#cfn-apigateway-domainname-mutualtlsauthentication)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::ApiGateway::DomainName`リソースの `[MutualTlsAuthentication](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-domainname.html#cfn-apigateway-domainname-mutualtlsauthentication)`プロパティに直接渡されます。

 `NormalizeBasePath`   <a name="sam-api-domainconfiguration-normalizebasepath"></a>
`BasePath` プロパティで定義されたベースパスに英数字以外の文字を使用できるかどうかを示します。`True` に設定すると、英数字以外の文字がベースパスから削除されます。  
`NormalizeBasePath` を `BasePath` プロパティと一緒に使用します。  
型: ブール  
*必須:* いいえ  
*デフォルト*: True  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `OwnershipVerificationCertificateArn`   <a name="sam-api-domainconfiguration-ownershipverificationcertificatearn"></a>
カスタムドメインの所有権を検証するために ACM によって発行されたパブリック証明書の ARN。相互 TLS を設定し、ACM にインポートされた、またはプライベート CA 証明書の ARN を `CertificateArn` に指定する場合のみ必須です。  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::ApiGateway::DomainName`リソースの `[OwnershipVerificationCertificateArn](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-domainname.html#cfn-apigateway-domainname-ownershipverificationcertificatearn)`プロパティに直接渡されます。

 `Policy`   <a name="sam-api-domainconfiguration-policy"></a>
API Gateway ドメイン名にアタッチする IAM ポリシー。`EndpointConfiguration` を `PRIVATE` に設定した場合にのみ該当します。  
型: Json  
*必須:* いいえ  
*CloudFormation 互換性*: `EndpointConfiguration`が に設定されている場合、このプロパティは `AWS::ApiGateway::DomainNameV2`リソースの `Policy`プロパティに直接渡されます`PRIVATE`。有効なポリシードキュメントの例については、「[AWS::ApiGateway::DomainNameV2](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-domainnamev2)」を参照してください。

 `Route53`   <a name="sam-api-domainconfiguration-route53"></a>
Amazon Route 53 設定を定義します。  
*タイプ*: [Route53Configuration](sam-property-api-route53configuration.md)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `SecurityPolicy`   <a name="sam-api-domainconfiguration-securitypolicy"></a>
このドメイン名の TLS バージョンと暗号スイートです。  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::ApiGateway::DomainName`リソースの `[SecurityPolicy](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-domainname.html#cfn-apigateway-domainname-securitypolicy)`プロパティに直接渡されるか、 [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-domainnamev2](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-domainnamev2)`EndpointConfiguration`が に設定されている場合に に渡されます`PRIVATE`。`PRIVATE` エンドポイントでは、TLS\$11\$12 のみがサポートされています。

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

### DomainName
<a name="sam-property-api-domainconfiguration--examples--domainname"></a>

DomainName の例

#### YAML
<a name="sam-property-api-domainconfiguration--examples--domainname--yaml"></a>

```
Domain:
  DomainName: www.example.com
  CertificateArn: arn-example
  EndpointConfiguration: EDGE
  Route53:
    HostedZoneId: Z1PA6795UKMFR9
  BasePath:
    - foo
    - bar
```

# DomainAccessAssociation
<a name="sam-property-api-domainaccessassociation"></a>

アクセス関連付けソースとプライベートカスタムドメイン名との間でドメインアクセスアソシエーションを設定します。サポートされているアクセス関連付けソースは VPC エンドポイント ID のみです。詳細については、「[API Gateway でのプライベート API のカスタムドメイン名](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-private-custom-domains.html)」を参照してください。

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

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

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

```
 VpcEndpointId: String
```

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

 `VpcEndpointId`   <a name="sam-api-domainaccessassociation-vpcendpointid"></a>
API Gateway VPC サービスに関連付けられた VPC インターフェイスエンドポイントのエンドポイント ID。  
*タイプ*: 文字列  
*必須*: はい  
*CloudFormation 互換性*: このプロパティは、 `AWS::ApiGateway::DomainNameAccessAssociation`リソースの `[ AccessAssociationSource](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-domainnameaccessassociation.html#cfn-apigateway-domainnameaccessassociation-accessassociationsource)`プロパティに直接渡されます。

# Route53Configuration
<a name="sam-property-api-route53configuration"></a>

API の Route53 レコードセットを設定します。

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

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

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

```
  [DistributionDomainName](#sam-api-route53configuration-distributiondomainname): String
  [EvaluateTargetHealth](#sam-api-route53configuration-evaluatetargethealth): Boolean
  [HostedZoneId](#sam-api-route53configuration-hostedzoneid): String
  [HostedZoneName](#sam-api-route53configuration-hostedzonename): String
  [IpV6](#sam-api-route53configuration-ipv6): Boolean
  Region: String
  SetIdentifier: String
  VpcEndpointDomainName: String
  VpcEndpointHostedZoneId: String
```

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

 `DistributionDomainName`   <a name="sam-api-route53configuration-distributiondomainname"></a>
API カスタムドメイン名のカスタムディストリビューションを設定します。  
*タイプ*: 文字列  
*必須:* いいえ  
*デフォルト*: API Gateway ディストリビューションを使用します。  
*CloudFormation 互換性*: このプロパティは、 `AWS::Route53::RecordSetGroup AliasTarget`リソースの `[DNSName](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53-aliastarget-1.html#cfn-route53-aliastarget-dnshostname)`プロパティに直接渡されます。  
*その他の注意点*: [CloudFront ディストリビューション](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudfront-distribution.html)のドメイン名です。

 `EvaluateTargetHealth`   <a name="sam-api-route53configuration-evaluatetargethealth"></a>
EvaluateTargetHealth が true の場合、エイリアスレコードは、Elastic Load Balancing ロードバランサーやホストゾーン内の別のレコードなど、参照される AWS リソースの正常性を継承します。  
型: ブール  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Route53::RecordSetGroup AliasTarget`リソースの `[EvaluateTargetHealth](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53-aliastarget.html#cfn-route53-aliastarget-evaluatetargethealth)`プロパティに直接渡されます。  
*その他の注意点*: エイリアスターゲットが CloudFront ディストリビューションの場合は EvaluateTargetHealth を true に設定できません。

 `HostedZoneId`   <a name="sam-api-route53configuration-hostedzoneid"></a>
レコードを作成するホストゾーンの ID です。  
`HostedZoneName` または `HostedZoneId` を指定します。両方を指定することはできません。同じドメイン名のホストゾーンが複数ある場合は、`HostedZoneId` を使用してホストゾーンを指定する必要があります。  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Route53::RecordSetGroup RecordSet`リソースの `[HostedZoneId](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53-recordset-1.html#cfn-route53-recordset-hostedzoneid)`プロパティに直接渡されます。

 `HostedZoneName`   <a name="sam-api-route53configuration-hostedzonename"></a>
レコードを作成するホストゾーンの名前です。  
`HostedZoneName` または `HostedZoneId` を指定します。両方を指定することはできません。同じドメイン名のホストゾーンが複数ある場合は、`HostedZoneId` を使用してホストゾーンを指定する必要があります。  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Route53::RecordSetGroup RecordSet`リソースの `[HostedZoneName](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53-recordset-1.html#cfn-route53-recordset-hostedzonename)`プロパティに直接渡されます。

 `IpV6`   <a name="sam-api-route53configuration-ipv6"></a>
このプロパティが設定されると、 は`AWS::Route53::RecordSet`リソース AWS SAM を作成し、指定された HostedZone [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53-recordset.html#cfn-route53-recordset-type](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53-recordset.html#cfn-route53-recordset-type) `AAAA` のタイプを に設定します。  
型: ブール  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のプロパティはありません。

`Region`  <a name="sam-api-route53configuration-region"></a>
*レイテンシーベースのリソースレコードセットのみ:* このリソースレコードセットが参照するリソースを作成した Amazon EC2 リージョン。リソースは通常、EC2 インスタンスや ELB ロードバランサーなどの AWS リソースであり、レコードタイプに応じて IP アドレスまたは DNS ドメイン名によって参照されます。  
レイテンシーリソースレコードセットが作成されているドメインの名前や種類を要求する DNS クエリを受け取ると、Amazon Route 53 は、エンドユーザーとそのユーザーに関連付けられている Amazon EC2 リージョンとの間でレイテンシーが最も小さいレイテンシーリソースレコードセットを選択します。その後、Route 53 は、選択したリソースレコードセットに関連付けられている値を返します。  
次の点に注意してください。  
+ レイテンシーリソースレコードセットごとに 1 つの `ResourceRecord` のみ指定できます。
+ 作成できるレイテンシーリソースレコードセットは、各 Amazon EC2 リージョンにつき 1 つだけです。
+ すべての Amazon EC2 リージョンに対してレイテンシーリソースレコードセットを作成する必要はありません。レイテンシーリソースレコードセットを作成したリージョンの中から、レイテンシーの最も小さいリージョンが Route 53 によって選択されます。
+ レイテンシーリソースレコードセットリソースと `Name` および `Type` 要素の値が同じである非レイテンシーリソースレコードセットを作成することはできません。
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Route53::RecordSetGroup` `RecordSet` データ型の `[ Region](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53-recordset-1.html#cfn-route53-recordset-region)`プロパティに直接渡されます。

`SetIdentifier`  <a name="sam-api-route53configuration-setidentifier"></a>
*シンプル以外のルーティングポリシーを持つリソースレコードセット:* タイプが A である acme.example.com という名前の複数の加重リソースレコードセットなど、名前とタイプの組み合わせが同じである複数のリソースレコードセットを区別する識別子。名前とタイプが同じであるリソースレコードセットのグループでは、リソースレコードセットごとに `SetIdentifier` の値が一意である必要があります。  
ルーティングポリシーの詳細については、「Amazon Route 53 デベロッパーガイド」の「[ルーティングポリシーの選択](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/routing-policy.html)」を参照してください。  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Route53::RecordSetGroup` `RecordSet` データ型の `[ SetIdentifier](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53-recordset-1.html#cfn-route53-recordset-setidentifier)`プロパティに直接渡されます。

`VpcEndpointDomainName`  <a name="sam-api-route53configuration-vpcendpointdomainname"></a>
API Gateway VPC サービスに関連付けられた VPC インターフェイスエンドポイントの DNS 名。このプロパティは、プライベートドメインにのみ必要です。  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Route53::RecordSet``AliasTarget`フィールドの `[DNSName](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53-recordset-aliastarget.html)`プロパティに直接渡されます。

`VpcEndpointHostedZoneId`  <a name="sam-api-route53configuration-vpcendpointhostedzoneid"></a>
API Gateway VPC サービスに関連付けられた VPC インターフェイスエンドポイントのホストゾーン ID。このプロパティは、プライベートドメインにのみ必要です。  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Route53::RecordSet``AliasTarget`フィールドの `[HostedZoneId](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53-recordset-aliastarget.html)`プロパティに直接渡されます。

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

### 基本的な の例
<a name="sam-property-api-route53configuration--examples--route-53-configuration-example"></a>

この例では、API 用にカスタムドメインと Route 53 のレコードセットを設定します。

#### YAML
<a name="sam-property-api-route53configuration--examples--route-53-configuration-example--yaml"></a>

```
Resources:
  MyApi:
    Type: AWS::Serverless::Api
    Properties:
      StageName: Prod
      Domain:
        DomainName: www.example.com
        CertificateArn: arn:aws:acm:us-east-1:123456789012:certificate/abcdef12-3456-7890-abcd-ef1234567890
        EndpointConfiguration: REGIONAL
        Route53:
          HostedZoneId: ABCDEFGHIJKLMNOP
```

# EndpointConfiguration
<a name="sam-property-api-endpointconfiguration"></a>

REST API のエンドポイントタイプです。

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

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

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

```
  [IpAddressType](#sam-api-endpointconfiguration-ipaddresstype): String
  [Type](#sam-api-endpointconfiguration-type): String
  [VPCEndpointIds](#sam-api-endpointconfiguration-vpcendpointids): List
```

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

 `IpAddressType`   <a name="sam-api-endpointconfiguration-ipaddresstype"></a>
API (RestApi) を呼び出すことができる IP アドレスタイプ。  
*有効な値*: `ipv4` または `dualstack`  
タイプ：文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::ApiGateway::RestApi` `EndpointConfiguration` データ型の `[IpAddressType](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigateway-restapi-endpointconfiguration.html#cfn-apigateway-restapi-endpointconfiguration-ipaddresstype)`プロパティに直接渡されます。

 `Type`   <a name="sam-api-endpointconfiguration-type"></a>
REST API のエンドポイントタイプです。  
*有効な値*: `EDGE`、`REGIONAL`、または `PRIVATE`  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::ApiGateway::RestApi` `EndpointConfiguration` データ型の `[Types](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigateway-restapi-endpointconfiguration.html#cfn-apigateway-restapi-endpointconfiguration-types)`プロパティに直接渡されます。

 `VPCEndpointIds`   <a name="sam-api-endpointconfiguration-vpcendpointids"></a>
Route53 エイリアスを作成する REST API の VPC エンドポイント ID のリストです。  
*タイプ*: リスト  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::ApiGateway::RestApi` `EndpointConfiguration` データ型の `[VpcEndpointIds](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigateway-restapi-endpointconfiguration.html#cfn-apigateway-restapi-endpointconfiguration-vpcendpointids)`プロパティに直接渡されます。

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

### EndpointConfiguration
<a name="sam-property-api-endpointconfiguration--examples--endpointconfiguration"></a>

エンドポイント設定の例

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

```
EndpointConfiguration:
  Type: PRIVATE
  VPCEndpointIds:
    - vpce-123a123a
    - vpce-321a321a
```

# AWS::Serverless::Application
<a name="sam-resource-application"></a>

[AWS Serverless Application Repository](https://serverlessrepo.aws.amazon.com/applications) から、または Amazon S3 バケットからのサーバーレスアプリケーションを、ネストされたアプリケーションとして埋め込みます。ネストされたアプリケーションは、ネストされた [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-stack.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-stack.html) リソースとしてデプロイされます。このリソースには、他の [AWS::Serverless::Application](#sam-resource-application) リソースを含めたその他のリソースを複数含めることができます。

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

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

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

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

```
Type: AWS::Serverless::Application
Properties:
  [Location](#sam-application-location): String | ApplicationLocationObject
  [NotificationARNs](#sam-application-notificationarns): List
  [Parameters](#sam-application-parameters): Map
  [Tags](#sam-application-tags): Map
  [TimeoutInMinutes](#sam-application-timeoutinminutes): Integer
```

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

 `Location`   <a name="sam-application-location"></a>
ネストされたアプリケーションのテンプレート URL、ファイルパス、またはロケーションオブジェクトです。  
テンプレート URL が指定されている場合は、[CloudFormation TemplateUrl ドキュメント](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-stack.html#cfn-cloudformation-stack-templateurl)に指定されている形式に従い、有効な CloudFormation または SAM テンプレートが含まれている必要があります。[AWS Serverless Application Repository](https://docs.aws.amazon.com/serverlessrepo/latest/devguide/what-is-serverlessrepo.html) に公開されたアプリケーションを指定するには、[ApplicationLocationObject](sam-property-application-applicationlocationobject.md) を使用することができます。  
ローカルファイルパスを指定する場合は、定義が適切に変換されるようにするために、テンプレートが `sam deploy` または `sam package` コマンドを含むワークフローを実行する必要があります。  
*タイプ*: 文字列 \$1 [ApplicationLocationObject](sam-property-application-applicationlocationobject.md)  
*必須:* はい  
*CloudFormation 互換性*: このプロパティは、 `AWS::CloudFormation::Stack`リソースの `[TemplateURL](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-stack.html#cfn-cloudformation-stack-templateurl)`プロパティに似ています。CloudFormation バージョンでは、 AWS Serverless Application Repositoryからアプリケーションを取得するために [ApplicationLocationObject](sam-property-application-applicationlocationobject.md) を使用しません。

 `NotificationARNs`   <a name="sam-application-notificationarns"></a>
スタックイベントに関する通知が送信される既存の Amazon SNS トピックのリストです。  
*タイプ*: リスト  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::CloudFormation::Stack`リソースの `[NotificationARNs](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-stack.html#cfn-cloudformation-stack-notificationarns)`プロパティに直接渡されます。

 `Parameters`   <a name="sam-application-parameters"></a>
アプリケーションパラメータ値です。  
*タイプ*: マップ  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::CloudFormation::Stack`リソースの `[Parameters](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-stack.html#cfn-cloudformation-stack-parameters)`プロパティに直接渡されます。

 `Tags`   <a name="sam-application-tags"></a>
このアプリケーションに追加されるタグを指定するマップ (文字列対文字列) です。キーと値に使用できるのは英数字のみです。キーの長さは 1～127 文字の Unicode 文字で、「aws:」をプレフィックスとして使用することはできません。値の長さは 1～255 文字の Unicode 文字にすることができます。  
*タイプ*: マップ  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::CloudFormation::Stack`リソースの `[Tags](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-stack.html#cfn-cloudformation-stack-tags)`プロパティに似ています。SAM の Tags プロパティは、キーバリューペアで構成されています。CloudFormation では、タグオブジェクトのリストで構成されています。スタックが作成されると、SAM がこのアプリケーションに `lambda:createdBy:SAM` タグを自動的に追加します。さらに、このアプリケーションが からのものである場合 AWS Serverless Application Repository、SAM は 2 つの追加タグ `serverlessrepo:applicationId:ApplicationId`と も自動的に追加します`serverlessrepo:semanticVersion:SemanticVersion`。

 `TimeoutInMinutes`   <a name="sam-application-timeoutinminutes"></a>
ネストされたスタックが `CREATE_COMPLETE`状態になるまで CloudFormation 待機する分単位の時間の長さ。デフォルトではタイムアウトが設定されていません。は、ネストされたスタックが `CREATE_COMPLETE`状態になったことを CloudFormation 検出し、ネストされたスタックリソースを親スタック`CREATE_COMPLETE`の としてマークし、親スタックの作成を再開します。ネストされたスタックが に達する前にタイムアウト期間が終了すると`CREATE_COMPLETE`、 はネストされたスタックを失敗として CloudFormation マークし、ネストされたスタックと親スタックの両方をロールバックします。  
*タイプ:* 整数  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::CloudFormation::Stack`リソースの `[TimeoutInMinutes](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-stack.html#cfn-cloudformation-stack-timeoutinminutes)`プロパティに直接渡されます。

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

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

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

`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-application-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)」を参照してください。

`Outputs.ApplicationOutputName`  <a name="Outputs.ApplicationOutputName-fn::getatt"></a>
`ApplicationOutputName` という前のスタック出力の値です。

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

### SAR アプリケーション
<a name="sam-resource-application--examples--sar-application"></a>

Serverless Application Repository からのテンプレートを使用するアプリケーションです。

#### YAML
<a name="sam-resource-application--examples--sar-application--yaml"></a>

```
Type: AWS::Serverless::Application
Properties:
  Location:
    ApplicationId: 'arn:aws:serverlessrepo:us-east-1:012345678901:applications/my-application'
    SemanticVersion: 1.0.0
  Parameters:
    StringParameter: parameter-value
    IntegerParameter: 2
```

### 通常のアプリケーション
<a name="sam-resource-application--examples--normal-application"></a>

S3 url からのアプリケーションです。

#### YAML
<a name="sam-resource-application--examples--normal-application--yaml"></a>

```
Type: AWS::Serverless::Application
Properties:
  Location: https://s3.amazonaws.com/sam-s3-demo-bucket/template.yaml
```

# ApplicationLocationObject
<a name="sam-property-application-applicationlocationobject"></a>

[AWS Serverless Application Repository](https://docs.aws.amazon.com/serverlessrepo/latest/devguide/what-is-serverlessrepo.html) に公開されたアプリケーションです。

## 構文
<a name="sam-property-application-applicationlocationobject-syntax"></a>

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

### YAML
<a name="sam-property-application-applicationlocationobject-syntax.yaml"></a>

```
  [ApplicationId](#sam-application-applicationlocationobject-applicationid): String
  [SemanticVersion](#sam-application-applicationlocationobject-semanticversion): String
```

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

 `ApplicationId`   <a name="sam-application-applicationlocationobject-applicationid"></a>
アプリケーションの Amazon リソースネーム (ARN) です。  
*タイプ*: 文字列  
*必須*: はい  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `SemanticVersion`   <a name="sam-application-applicationlocationobject-semanticversion"></a>
アプリケーションのセマンティックバージョンです。  
*タイプ*: 文字列  
*必須*: はい  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

## 例
<a name="sam-property-application-applicationlocationobject--examples"></a>

### my-application
<a name="sam-property-application-applicationlocationobject--examples--my-application"></a>

サンプルアプリケーションのロケーションオブジェクトです。

#### YAML
<a name="sam-property-application-applicationlocationobject--examples--my-application--yaml"></a>

```
Location:
  ApplicationId: 'arn:aws:serverlessrepo:us-east-1:012345678901:applications/my-application'
  SemanticVersion: 1.0.0
```

# AWS::Serverless::CapacityProvider
<a name="sam-resource-capacityprovider"></a>

 顧客所有の Amazon Elastic Compute Cloud インスタンスで Lambda マネージドインスタンスを実行できるようにする AWS Lambda 関数のキャパシティープロバイダーを作成します。このリソースは Lambda マネージドインスタンス機能の一部であり、Amazon EC2 料金モデルを利用して大規模な Lambda ワークロードのコストを最適化します。

 キャパシティープロバイダーは Amazon EC2 インスタンスのライフサイクルを管理し、Lambda 関数がサーバーレスプログラミングモデルを維持しながら、顧客所有のコンピューティングリソースで実行するために必要なインフラストラクチャを提供します。

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

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

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

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

```
Type: AWS::Serverless::CapacityProvider
Properties:
  [CapacityProviderName](#sam-capacityprovider-capacityprovidername): String
  [VpcConfig](#sam-capacityprovider-vpcconfig): VpcConfig
  [OperatorRole](#sam-capacityprovider-operatorrole): String
  [Tags](#sam-capacityprovider-tags): Map
  [PropagateTags](#sam-capacityprovider-propagatetags): Boolean
  [InstanceRequirements](#sam-capacityprovider-instancerequirements): InstanceRequirements
  [ScalingConfig](#sam-capacityprovider-scalingconfig): ScalingConfig
  [KmsKeyArn](#sam-capacityprovider-kmskeyarn): String
```

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

 `CapacityProviderName`   <a name="sam-capacityprovider-capacityprovidername"></a>
容量プロバイダーの名前。この名前は、 AWS アカウントとリージョン内で一意である必要があります。  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::CapacityProvider`リソースの `[CapacityProviderName](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-capacityprovider.html#cfn-lambda-capacityprovider-capacityprovidername)`プロパティに直接渡されます。

 `VpcConfig`   <a name="sam-capacityprovider-vpcconfig"></a>
キャパシティープロバイダーの VPC 設定。Amazon EC2 インスタンスを起動する VPC サブネットとセキュリティグループを指定します。  
*タイプ*: [VpcConfig](sam-property-capacityprovider-vpcconfig.md)  
*必須:* はい  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::CapacityProvider`リソースの `[VpcConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-capacityprovider.html#cfn-lambda-capacityprovider-vpcconfig)`プロパティに直接渡されます。

 `OperatorRole`   <a name="sam-capacityprovider-operatorrole"></a>
 カスタマーアカウントで Amazon EC2 インスタンスおよび関連リソースを作成および管理するためのアクセス許可を持つ Lambda のオペレーターロールの ARN。指定しない場合、 は必要なアクセス許可を持つロール AWS SAM を自動的に生成します。  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::CapacityProvider`リソース`[PermissionsConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-capacityprovider.html#cfn-lambda-capacityprovider-permissionsconfig)`の `[CapacityProviderOperatorRoleArn](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-capacityprovider-capacityproviderpermissionsconfig.html#cfn-lambda-capacityprovider-capacityproviderpermissionsconfig-capacityprovideroperatorrolearn)`プロパティに直接渡されます。

 `Tags`   <a name="sam-capacityprovider-tags"></a>
キャパシティープロバイダーとその関連リソースに適用するキーと値のペアのマップ。  
*タイプ*: マップ  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::CapacityProvider`リソースの `[Tags](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-capacityprovider.html#cfn-lambda-capacityprovider-tags)`プロパティに直接渡されます。の `Tags`プロパティ AWS SAM はキーと値のペアで構成されます ( CloudFormation このプロパティは Tag オブジェクトのリストで構成されます）。また、 は、この Lambda 関数と、この関数用に生成されたデフォルトのロールに`lambda:createdBy:SAM`タグ AWS SAM を自動的に追加します。

 `PropagateTags`   <a name="sam-capacityprovider-propagatetags"></a>
 タグプロパティから`AWS::Serverless::CapacityProvider`生成されたリソースにタグを渡すかどうかを示します。これを に設定すると`True`、生成されたリソースにタグが伝播されます。  
型: ブール  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `InstanceRequirements`   <a name="sam-capacityprovider-instancerequirements"></a>
 キャパシティープロバイダーが使用できるコンピューティングインスタンスのタイプに関する仕様。これには、アーキテクチャ要件や`allowed``excluded`インスタンスタイプが含まれます。  
タイプ: [InstanceRequirements](sam-property-capacityprovider-instancerequirements.md)**  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::CapacityProvider`リソースの `[InstanceRequirements](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-capacityprovider.html#cfn-lambda-capacityprovider-instancerequirements)`プロパティに直接渡されます。

 `ScalingConfig`   <a name="sam-capacityprovider-scalingconfig"></a>
 キャパシティープロバイダーのスケーリング設定。キャパシティプロバイダーが需要に基づいて Amazon EC2 インスタンスをスケーリングする方法を定義します。  
*Type*: [ScalingConfig](sam-property-capacityprovider-scalingconfig.md)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::CapacityProvider`リソースの `[CapacityProviderScalingConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-capacityprovider.html#cfn-lambda-capacityprovider-capacityproviderscalingconfig)`プロパティに直接渡されます。

 `KmsKeyArn`   <a name="sam-capacityprovider-kmskeyarn"></a>
キャパシティープロバイダーの保管中および転送中のデータの暗号化に使用される AWS KMS キーの ARN。  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::CapacityProvider`リソースの `[KmsKeyArn](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-capacityprovider.html#cfn-lambda-capacityprovider-kmskeyarn)`プロパティに直接渡されます。

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

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

このリソースの論理 ID が`Ref`組み込み 関数に提供されると、キャパシティープロバイダーの名前が返されます。

`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-capacityprovider-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>
キャパシティープロバイダーの ARN。

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

### 基本的なキャパシティープロバイダー
<a name="sam-resource-capacityprovider-examples-basic"></a>

次の例では、VPC 設定を使用して基本的なキャパシティープロバイダーを作成します。

```
MyCapacityProvider:
  Type: AWS::Serverless::CapacityProvider
  Properties:
    CapacityProviderName: my-capacity-provider
    VpcConfig:
      SubnetIds:
        - subnet-12345678
        - subnet-87654321
      SecurityGroupIds:
        - sg-12345678
    Tags:
      Environment: Production
      Team: ServerlessTeam
```

### スケーリングを備えた高度なキャパシティープロバイダー
<a name="sam-resource-capacityprovider-examples-advanced"></a>

次の例では、カスタムインスタンス要件とスケーリング設定を使用してキャパシティープロバイダーを作成します。

```
AdvancedCapacityProvider:
  Type: AWS::Serverless::CapacityProvider
  Properties:
    CapacityProviderName: advanced-capacity-provider
    VpcConfig:
      SubnetIds:
        - subnet-12345678
        - subnet-87654321
      SecurityGroupIds:
        - sg-12345678
    OperatorRole: arn:aws:iam::123456789012:role/MyCapacityProviderRole
    PropagateTags: true
    InstanceRequirements:
      Architectures:
        - x86_64
      ExcludedTypes:
        - t2.micro
    ScalingConfig:
      MaxInstanceCount: 10
      ManualScalingPolicies:
        AverageCPUUtilization: 70.0
    KmsKeyArn: arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012
    Tags:
      Environment: Production
      CostCenter: Engineering
```

# VpcConfig
<a name="sam-property-capacityprovider-vpcconfig"></a>

EC2 インスタンスを起動するサブネットやセキュリティグループなど、キャパシティープロバイダーの VPC 設定を構成します。

## 構文
<a name="sam-property-capacityprovider-vpcconfig-syntax"></a>

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

### YAML
<a name="sam-property-capacityprovider-vpcconfig-syntax.yaml"></a>

```
[SubnetIds](#sam-capacityprovider-vpcconfig-subnetids): List
[SecurityGroupIds](#sam-capacityprovider-vpcconfig-securitygroupids): List
```

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

 `SubnetIds`   <a name="sam-capacityprovider-vpcconfig-subnetids"></a>
EC2 インスタンスが起動されるサブネット IDs のリスト。少なくとも 1 つのサブネットを指定する必要があります。  
*タイプ*: リスト  
*必須:* はい  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::CapacityProvider`リソース`[VpcConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-capacityprovider.html#cfn-lambda-capacityprovider-vpcconfig) `の `[SubnetIds](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-capacityprovider-capacityprovidervpcconfig.html#cfn-lambda-capacityprovider-capacityprovidervpcconfig-subnetids)`プロパティに直接渡されます。

 `SecurityGroupIds`   <a name="sam-capacityprovider-vpcconfig-securitygroupids"></a>
EC2 インスタンスに関連付けるセキュリティグループ IDs のリスト。指定しない場合、VPC のデフォルトのセキュリティグループが使用されます。  
*タイプ*: リスト  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::CapacityProvider`リソースの `[SecurityGroupIds](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-capacityprovider-capacityprovidervpcconfig.html#cfn-lambda-capacityprovider-capacityprovidervpcconfig-securitygroupids)` `[VpcConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-capacityprovider.html#cfn-lambda-capacityprovider-vpcconfig)`プロパティに直接渡されます。

## 例
<a name="sam-property-capacityprovider-vpcconfig-examples"></a>

### VPC の構成
<a name="sam-property-capacityprovider-vpcconfig-examples-basic"></a>

次の例は、複数のサブネットとセキュリティグループを持つ VPC 設定を示しています。

```
VpcConfig:
  SubnetIds:
    - subnet-12345678
    - subnet-87654321
  SecurityGroupIds:
    - sg-12345678
    - sg-87654321
```

# InstanceRequirements
<a name="sam-property-capacityprovider-instancerequirements"></a>

アーキテクチャやインスタンスタイプの制約など、キャパシティープロバイダーによって起動される EC2 インスタンスの要件を指定します。

## 構文
<a name="sam-property-capacityprovider-instancerequirements-syntax"></a>

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

### YAML
<a name="sam-property-capacityprovider-instancerequirements-syntax.yaml"></a>

```
[Architectures](#sam-capacityprovider-instancerequirements-architectures): List
[AllowedTypes](#sam-capacityprovider-instancerequirements-allowedtypes): List
[ExcludedTypes](#sam-capacityprovider-instancerequirements-excludedtypes): List
```

**注記**  
キャパシティープロバイダーのインスタンス要件を定義する`ExcludedTypes`ときに、 `AllowedTypes`または のいずれかを指定できますが、両方を指定することはできません。

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

 `Architectures`   <a name="sam-capacityprovider-instancerequirements-architectures"></a>
キャパシティープロバイダーインスタンスの命令セットアーキテクチャ。  
*有効な値*: `x86_64` または `arm64`  
*タイプ*: リスト  
*必須:* いいえ  
*デフォルト*: `x86_64`  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::CapacityProvider`リソース`[InstanceRequirements](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-capacityprovider.html#cfn-lambda-capacityprovider-instancerequirements)`の `[Architectures](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-capacityprovider-instancerequirements.html#cfn-lambda-capacityprovider-instancerequirements-architectures)`プロパティに直接渡されます。

 `AllowedTypes`   <a name="sam-capacityprovider-instancerequirements-allowedtypes"></a>
キャパシティープロバイダーインスタンスで許可される EC2 インスタンスタイプのリスト。  
*タイプ*: リスト  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::CapacityProvider`リソース`[InstanceRequirements](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-capacityprovider.html#cfn-lambda-capacityprovider-instancerequirements)`の `[AllowedInstanceTypes](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-capacityprovider-instancerequirements.html#cfn-lambda-capacityprovider-instancerequirements-allowedinstancetypes)`プロパティに直接渡されます。

 `ExcludedTypes`   <a name="sam-capacityprovider-instancerequirements-excludedtypes"></a>
キャパシティープロバイダーから除外する EC2 インスタンスタイプのリスト。  
*タイプ*: リスト  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::CapacityProvider`リソース`[InstanceRequirements](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-capacityprovider.html#cfn-lambda-capacityprovider-instancerequirements)`の `[ExcludedInstanceTypes](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-capacityprovider-instancerequirements.html#cfn-lambda-capacityprovider-instancerequirements-excludedinstancetypes)`プロパティに直接渡されます。

## 例
<a name="sam-property-capacityprovider-instancerequirements-examples"></a>

### インスタンス要件の設定
<a name="sam-property-capacityprovider-instancerequirements-examples-basic"></a>

次の例は、特定のアーキテクチャとインスタンスタイプの制約を持つインスタンス要件を示しています。

```
InstanceRequirements:
  Architectures:
    - x86_64
  ExcludedTypes:
    - t2.micro
```

# ScalingConfig
<a name="sam-property-capacityprovider-scalingconfig"></a>

最大インスタンス制限やスケーリングポリシーなど、キャパシティプロバイダーが需要に基づいて EC2 インスタンスをスケーリングする方法を設定します。

## 構文
<a name="sam-property-capacityprovider-scalingconfig-syntax"></a>

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

### YAML
<a name="sam-property-capacityprovider-scalingconfig-syntax.yaml"></a>

```
[MaxVCpuCount](#sam-capacityprovider-scalingconfig-maxvcpucount): Integer
[AverageCPUUtilization](#sam-capacityprovider-scalingconfig-averagecpuutilization): Double
```

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

 `MaxVCpuCount`   <a name="sam-capacityprovider-scalingconfig-maxvcpucount"></a>
キャパシティープロバイダーがすべてのコンピューティングインスタンスにプロビジョニングできる vCPUs の最大数。  
*タイプ:* 整数  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::CapacityProvider`リソース`[CapacityProviderScalingConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-capacityprovider.html#cfn-lambda-capacityprovider-capacityproviderscalingconfig)`の `[MaxVCpuCount](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-capacityprovider-capacityproviderscalingconfig.html#cfn-lambda-capacityprovider-capacityproviderscalingconfig-maxvcpucount)`プロパティに直接渡されます。

 `AverageCPUUtilization`   <a name="sam-capacityprovider-scalingconfig-averagecpuutilization"></a>
スケーリング決定のターゲット平均 CPU 使用率 (0～100)。平均 CPU 使用率がこのしきい値を超えると、キャパシティープロバイダーは Amazon EC2 インスタンスをスケールアップします。指定した場合、 `[CapacityProviderScalingConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-capacityprovider.html#cfn-lambda-capacityprovider-capacityproviderscalingconfig)` が `[ScalingMode](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-capacityprovider-capacityproviderscalingconfig.html#cfn-lambda-capacityprovider-capacityproviderscalingconfig-scalingmode)`に設定`'Manual'`され、 が `[ScalingPolicies](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-capacityprovider-capacityproviderscalingconfig.html#cfn-lambda-capacityprovider-capacityproviderscalingconfig-scalingpolicies)`に設定されている `AWS::Lambda::CapacityProvider`リソース AWS SAM を構築します`[{PredefinedMetricType: 'LambdaCapacityProviderAverageCPUUtilization', TargetValue: <this value>}]`。  
型: 倍精度  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のプロパティはありません。

## 例
<a name="sam-property-capacityprovider-scalingconfig-examples"></a>

### スケーリング設定
<a name="sam-property-capacityprovider-scalingconfig-examples-basic"></a>

次の例は、最大 VCpu 数と平均 CPU 使用率のスケーリング設定を示しています。

```
ScalingConfig:
  MaxVCpuCount: 10
  AverageCPUUtilization: 70.0
```

# AWS::Serverless::Connector
<a name="sam-resource-connector"></a>

2 つのリソース間のアクセス許可を設定します。コネクタの概要については、「[AWS SAM コネクタを使用したリソースアクセス許可の管理](managing-permissions-connectors.md)」を参照してください。

生成された AWS CloudFormation リソースの詳細については、「」を参照してください[CloudFormation を指定したときに生成される リソース AWS::Serverless::Connector](sam-specification-generated-resources-connector.md)。

コネクタに関するフィードバックを提供するには、*serverless-application-model AWS GitHubリポジトリ*で[新しい問題を送信します](https://github.com/aws/serverless-application-model/issues/new?assignees=&labels=area%2Fconnectors,stage%2Fneeds-triage&template=other.md&title=%28Feature%20Request%29)。

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

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

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

**注記**  
ほとんどのユースケースでは、埋め込みコネクタ構文を使用することをお勧めします。ソースリソースに埋め込まれているため、読み取りと長期にわたる維持がより容易になっています。ネストされたスタックのリソースや共有リソースなど、同じ AWS SAM テンプレート内にないソースリソースを参照する必要がある場合は、 `AWS::Serverless::Connector`構文を使用します。

### 埋め込みコネクタ
<a name="sam-resource-connector-syntax-embedded"></a>

```
<source-resource-logical-id>:
  Connectors:
    <connector-logical-id:
      Properties:
        [Destination](#sam-connector-destination): ResourceReference | List of ResourceReference
        [Permissions](#sam-connector-permissions): List
        [SourceReference](#sam-connector-sourcereference): SourceReference
```

### AWS::Serverless::Connector
<a name="sam-resource-connector-syntax-connector"></a>

```
Type: AWS::Serverless::Connector
Properties:
  [Destination](#sam-connector-destination): ResourceReference | List of ResourceReference
  [Permissions](#sam-connector-permissions): List
  [Source](#sam-connector-source): ResourceReference
```

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

 `Destination`   <a name="sam-connector-destination"></a>
送信先リソースです。  
タイプ: [ ResourceReference](sam-property-connector-resourcereference.md) \$1 [ResourceReference](sam-property-connector-resourcereference.md) のリスト  
*必須:* はい  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `Permissions`   <a name="sam-connector-permissions"></a>
送信元リソースが送信先リソースで実行できるアクセス許可タイプです。  
`Read` には、リソースからのデータの読み取りを許可する AWS Identity and Access Management (IAM) アクションが含まれています。  
`Write` には、リソースへのデータの開始と書き込みが可能な IAM アクションが含まれます。  
*有効な値*: `Read` または `Write`  
*タイプ*: リスト  
*必須:* はい  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `Source`   <a name="sam-connector-source"></a>
送信元リソースです。`AWS::Serverless::Connector` 構文を使用する場合に必要です。  
*タイプ*: [ResourceReference](sam-property-connector-resourcereference.md)  
*必須*: 条件に応じて異なります  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `SourceReference`   <a name="sam-connector-sourcereference"></a>
送信元リソースです。  
ソースリソース用に追加のプロパティを定義するときに、埋め込みコネクタ構文とともに使用します。
*タイプ*: [SourceReference](sam-property-connector-sourcereference.md)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

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

### 埋め込みコネクタ
<a name="sam-resource-connector-examples-embedded"></a>

次の例では、埋め込みコネクタを使用して、 AWS Lambda 関数と Amazon DynamoDB テーブルの間の `Write` データ接続を定義しています。

```
Transform: AWS::Serverless-2016-10-31
...
Resources:
  MyTable:
    Type: AWS::Serverless::SimpleTable
  MyFunction:
    Type: AWS::Serverless::Function
    Connectors:
      MyConn:
        Properties:
          Destination:
            Id: MyTable
          Permissions:
            - Write
    ...
```

次の例では、埋め込みコネクタを使用して `Read` および `Write` 許可を定義しています。

```
Transform: AWS::Serverless-2016-10-31
...
Resources:
  MyFunction:
    Type: AWS::Serverless::Function
    Connectors:
      MyConn:
        Properties:
          Destination:
            Id: MyTable
          Permissions:
            - Read
            - Write
  MyTable:
    Type: AWS::DynamoDB::Table
    ...
```

次の例では、埋め込みコネクタを使用して、`Id` 以外のプロパティを持つソースリソースを定義しています。

```
Transform: AWS::Serverless-2016-10-31
Transform: AWS::Serverless-2016-10-31
...
Resources:
  MyApi:
    Type: AWS::Serverless::Api
    Connectors:
      ApitoLambdaConn:
        Properties:
          SourceReference:
            Qualifier: Prod/GET/foobar
          Destination:
            Id: MyTable
          Permissions:
            - Read
            - Write
  MyTable:
    Type: AWS::DynamoDB::Table
    ...
```

### AWS::Serverless::Connector
<a name="sam-resource-connector--examples-connector"></a>

次の例では、 [AWS::Serverless::Connector](#sam-resource-connector)リソースを使用して、 AWS Lambda 関数の読み取りと Amazon DynamoDB テーブルへの書き込みを行います。

```
MyConnector:
  Type: AWS::Serverless::Connector
  Properties:
    Source:
      Id: MyFunction
    Destination:
      Id: MyTable
    Permissions:
      - Read
      - Write
```

次の例では、[AWS::Serverless::Connector](#sam-resource-connector) リソースを使用して Lambda 関数に Amazon SNS トピックへの書き込みをさせ、両方のリソースを同じテンプレートに配置します。

```
MyConnector:
  Type: AWS::Serverless::Connector
  Properties:
    Source:
      Id: MyLambda
    Destination:
      Id: MySNSTopic
    Permissions:
      - Write
```

次の例では、[AWS::Serverless::Connector](#sam-resource-connector) リソースを使用して Amazon SNS トピックに Lambda 関数への書き込みをさせ、次に Amazon DynamoDB テーブルへの書き込みをさせ、すべてのリソースを同じテンプレートに配置します。

```
Transform: AWS::Serverless-2016-10-31
Resources:
  Topic:
    Type: AWS::SNS::Topic
    Properties:
      Subscription:
        - Endpoint: !GetAtt Function.Arn
          Protocol: lambda

  Function:
    Type: AWS::Serverless::Function
    Properties:
      Runtime: nodejs16.x
      Handler: index.handler
      InlineCode: |
        const AWS = require('aws-sdk');
        exports.handler = async (event, context) => {
          const docClient = new AWS.DynamoDB.DocumentClient();
          await docClient.put({ 
            TableName: process.env.TABLE_NAME, 
            Item: {
              id: context.awsRequestId,
              event: JSON.stringify(event)
            }
          }).promise();
        };
      Environment:
        Variables:
          TABLE_NAME: !Ref Table

  Table:
    Type: AWS::Serverless::SimpleTable

  TopicToFunctionConnector:
    Type: AWS::Serverless::Connector
    Properties:
      Source: 
        Id: Topic
      Destination: 
        Id: Function
      Permissions:
        - Write

  FunctionToTableConnector:
    Type: AWS::Serverless::Connector
    Properties:
      Source: 
        Id: Function
      Destination: 
        Id: Table
      Permissions:
        - Write
```

以下は、上記の例の変換された AWS CloudFormation テンプレートです。

```
"FunctionToTableConnectorPolicy": {
  "Type": "AWS::IAM::ManagedPolicy",
  "Metadata": {
    "aws:sam:connectors": {
      "FunctionToTableConnector": {
        "Source": {
          "Type": "AWS::Lambda::Function"
        },
        "Destination": {
          "Type": "AWS::DynamoDB::Table"
        }
      }
    }
  },
  "Properties": {
    "PolicyDocument": {
      "Version": "2012-10-17",		 	 	 
      "Statement": [
        {
          "Effect": "Allow",
          "Action": [
            "dynamodb:PutItem",
            "dynamodb:UpdateItem",
            "dynamodb:DeleteItem",
            "dynamodb:BatchWriteItem",
            "dynamodb:PartiQLDelete",
            "dynamodb:PartiQLInsert",
            "dynamodb:PartiQLUpdate"
          ],
          "Resource": [
            {
              "Fn::GetAtt": [
                "MyTable",
                "Arn"
              ]
            },
            {
              "Fn::Sub": [
                "${DestinationArn}/index/*",
                {
                  "DestinationArn": {
                    "Fn::GetAtt": [
                      "MyTable",
                      "Arn"
                    ]
                  }
                }
              ]
            }
          ]
        }
      ]
    },
    "Roles": [
      {
        "Ref": "MyFunctionRole"
      }
    ]
  }
}
```

# ResourceReference
<a name="sam-property-connector-resourcereference"></a>

[AWS::Serverless::Connector](sam-resource-connector.md) リソースタイプが使用するリソースへの参照。

**注記**  
同じテンプレート内のリソースには、`Id` を指定します。同じテンプレートにないリソースには、他のプロパティを組み合わせて使用します。詳細については、「[AWS SAM コネクタリファレンス](reference-sam-connector.md)」を参照してください。

## 構文
<a name="sam-property-connector-resourcereference-syntax"></a>

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

### YAML
<a name="sam-property-connector-resourcereference-syntax.yaml"></a>

```
  [Arn](#sam-connector-resourcereference-arn): String
  [Id](#sam-connector-resourcereference-id): String
  [Name](#sam-connector-resourcereference-name): String
  [Qualifier](#sam-connector-resourcereference-qualifier): String
  [QueueUrl](#sam-connector-resourcereference-queueurl): String
  [ResourceId](#sam-connector-resourcereference-resourceid): String
  [RoleName](#sam-connector-resourcereference-rolename): String
  [Type](#sam-connector-resourcereference-type): String
```

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

 `Arn`   <a name="sam-connector-resourcereference-arn"></a>
リソースの ARN です。  
*タイプ*: 文字列  
*必須*: 条件に応じて異なります  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `Id`   <a name="sam-connector-resourcereference-id"></a>
同じテンプレート内のリソースの[論理 ID](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/resources-section-structure.html) です。  
`Id` が指定されている場合、コネクタが AWS Identity and Access Management (IAM) ポリシーを生成すると、それらのポリシーに関連付けられた IAM ロールはリソース から推測されます`Id`。`Id` が指定されていない場合は、コネクタ用にリソースの `RoleName` を指定して、生成された IAM ポリシーを IAM ロールにアタッチします。
*タイプ*: 文字列  
*必須*: 条件に応じて異なります  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `Name`   <a name="sam-connector-resourcereference-name"></a>
リソースの名前です。  
*タイプ*: 文字列  
*必須*: 条件に応じて異なります  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `Qualifier`   <a name="sam-connector-resourcereference-qualifier"></a>
範囲を狭めるリソースの修飾子。`Qualifier` はリソース制限の ARN の末尾にある `*` 値を置き換えます。例については、[Lambda 関数を呼び出す API Gateway](#sam-property-connector-resourcereference--examples--api-gateway-invoking-a-lambda-function)を参照してください。  
修飾子の定義はリソースタイプによって異なります。サポートされている送信元リソースタイプおよび送信先リソースタイプの一覧については、「[AWS SAM コネクタリファレンス](reference-sam-connector.md)」を参照してください。
*タイプ*: 文字列  
*必須*: 条件に応じて異なります  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `QueueUrl`   <a name="sam-connector-resourcereference-queueurl"></a>
Amazon SQS キューの URL です。このプロパティは Amazon SQS リソースにのみ適用されます。  
*タイプ*: 文字列  
*必須*: 条件に応じて異なります  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `ResourceId`   <a name="sam-connector-resourcereference-resourceid"></a>
リソースの ID です。例: API Gateway API ID。  
*タイプ*: 文字列  
*必須*: 条件に応じて異なります  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `RoleName`   <a name="sam-connector-resourcereference-rolename"></a>
リソースに関連付けられたロール名です。  
`Id` が指定されている場合、コネクタが IAM ポリシーを生成すると、それらのポリシーに関連付けられた IAM ロールがリソース `Id` から推測されます。`Id` が指定されていない場合は、コネクタ用にリソースの `RoleName` を指定して、生成された IAM ポリシーを IAM ロールにアタッチします。
*タイプ*: 文字列  
*必須*: 条件に応じて異なります  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `Type`   <a name="sam-connector-resourcereference-type"></a>
リソース CloudFormation のタイプ。詳細については、「[AWS リソースおよびプロパティタイプのリファレンス](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html)」を参照してください。  
*タイプ*: 文字列  
*必須*: 条件に応じて異なります  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

## 例
<a name="sam-property-connector-resourcereference--examples"></a>

### Lambda 関数を呼び出す API Gateway
<a name="sam-property-connector-resourcereference--examples--api-gateway-invoking-a-lambda-function"></a>

次の例では、 [AWS::Serverless::Connector](sam-resource-connector.md)リソースを使用して、Amazon API Gateway が AWS Lambda 関数を呼び出すことを許可します。

#### YAML
<a name="sam-property-connector-resourcereference--examples--api-gateway-invoking-a-lambda-function--yaml"></a>

```
Transform: AWS::Serverless-2016-10-31
Resources:
  MyRole:
    Type: AWS::IAM::Role
    Properties:
      AssumeRolePolicyDocument:
        Statement:
          - Effect: Allow
            Action: sts:AssumeRole
            Principal:
              Service: lambda.amazonaws.com
      ManagedPolicyArns:
        - !Sub arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole

  MyFunction:
    Type: AWS::Lambda::Function
    Properties:
      Role: !GetAtt MyRole.Arn
      Runtime: nodejs16.x
      Handler: index.handler
      Code:
        ZipFile: |
          exports.handler = async (event) => {
            return {
              statusCode: 200,
              body: JSON.stringify({
                "message": "It works!"
              }),
            };
          };

  MyApi:
    Type: AWS::ApiGatewayV2::Api
    Properties:
      Name: MyApi
      ProtocolType: HTTP

  MyStage:
    Type: AWS::ApiGatewayV2::Stage
    Properties:
      ApiId: !Ref MyApi
      StageName: prod
      AutoDeploy: True

  MyIntegration:
    Type: AWS::ApiGatewayV2::Integration
    Properties:
      ApiId: !Ref MyApi
      IntegrationType: AWS_PROXY
      IntegrationUri: !Sub arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${MyFunction.Arn}/invocations
      IntegrationMethod: POST
      PayloadFormatVersion: "2.0"

  MyRoute:
    Type: AWS::ApiGatewayV2::Route
    Properties:
      ApiId: !Ref MyApi
      RouteKey: GET /hello
      Target: !Sub integrations/${MyIntegration}

  MyConnector:
    Type: AWS::Serverless::Connector
    Properties:
      Source: # Use 'Id' when resource is in the same template
        Type: AWS::ApiGatewayV2::Api
        ResourceId: !Ref MyApi
        Qualifier: prod/GET/hello # Or "*" to allow all routes
      Destination: # Use 'Id' when resource is in the same template
        Type: AWS::Lambda::Function
        Arn: !GetAtt MyFunction.Arn
      Permissions:
        - Write

Outputs:
  Endpoint:
    Value: !Sub https://${MyApi}.execute-api.${AWS::Region}.${AWS::URLSuffix}/prod/hello
```

# SourceReference
<a name="sam-property-connector-sourcereference"></a>

[AWS::Serverless::Connector](sam-resource-connector.md) リソースタイプが使用するソースリソースへの参照。

## 構文
<a name="sam-property-connector-sourcereference-syntax"></a>

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

### YAML
<a name="sam-property-connector-sourcereference-syntax.yaml"></a>

```
[Qualifier](#sam-connector-sourcereference-qualifier): String
```

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

 `Qualifier`   <a name="sam-connector-sourcereference-qualifier"></a>
範囲を狭めるリソースの修飾子。`Qualifier` はリソース制限の ARN の末尾にある `*` 値を置き換えます。  
修飾子の定義はリソースタイプによって異なります。サポートされている送信元リソースタイプおよび送信先リソースタイプの一覧については、「[AWS SAM コネクタリファレンス](reference-sam-connector.md)」を参照してください。
*タイプ*: 文字列  
*必須*: 条件に応じて異なります  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、同等の CloudFormation ものはありません。

## 例
<a name="sam-property-connector-sourcereference--examples"></a>

**次の例では、埋め込みコネクタを使用して、`Id` 以外のプロパティを持つソースリソースを定義しています。**

```
Transform: AWS::Serverless-2016-10-31
...
Resources:
  MyApi:
    Type: AWS::Serverless::Api
    Connectors:
      ApitoLambdaConn:
        Properties:
          SourceReference:
            Qualifier: Prod/GET/foobar
          Destination:
            Id: MyTable
          Permissions:
            - Read
            - Write
  MyTable:
    Type: AWS::DynamoDB::Table
    ...
```

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

# AWS::Serverless::GraphQLApi
<a name="sam-resource-graphqlapi"></a>

 AWS Serverless Application Model (AWS SAM) `AWS::Serverless::GraphQLApi`リソースタイプを使用して、サーバーレスアプリケーションの API AWS AppSync GraphQLを作成および設定します。

詳細については AWS AppSync、「 *AWS AppSync デベロッパーガイド*」の[「What is AWS AppSync?](https://docs.aws.amazon.com/appsync/latest/devguide/what-is-appsync.html)」を参照してください。

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

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

```
LogicalId:
  Type: AWS::Serverless::GraphQLApi
  Properties:
    ApiKeys: ApiKeys
    Auth: Auth
    Cache: [AWS::AppSync::ApiCache](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appsync-apicache.html)
    DataSources: DataSource
    DomainName: [AWS::AppSync::DomainName](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appsync-domainname.html)
    Functions: Function
    Logging: [LogConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-graphqlapi-logconfig.html)
    Name: String
    Resolvers: Resolver
    SchemaInline: String
    SchemaUri: String
    Tags:
    - [Tag](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html)
    XrayEnabled: Boolean
```

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

`ApiKeys`  <a name="sam-graphqlapi-apikeys"></a>
API キーを必要とする GraphQL オペレーションを実行するために使用できる一意のキーを作成します。  
タイプ: [ApiKeys](sam-property-graphqlapi-apikeys.md)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

`Auth`  <a name="sam-graphqlapi-auth"></a>
GraphQL API の認証を設定します。  
タイプ: [Auth](sam-property-graphqlapi-auth.md)  
*必須:* はい  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のプロパティはありません。

`Cache`  <a name="sam-graphqlapi-cache"></a>
`CreateApiCache` 操作の入力です。  
タイプ: [AWS::AppSync::ApiCache](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appsync-apicache.html)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは [AWS::AppSync::ApiCache](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appsync-apicache.html) リソースに直接渡されます。

`DataSources`  <a name="sam-graphqlapi-datasources"></a>
関数が に接続 AWS AppSync するためのデータソースを作成します。 は Amazon DynamoDB と AWS Lambda データソース AWS SAM をサポートしています。  
*タイプ*: [DataSource](sam-property-graphqlapi-datasource.md)  
*必須:* はい  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のプロパティはありません。

`DomainName`  <a name="sam-graphqlapi-domainname"></a>
GraphQL API のカスタムドメイン名です。  
*タイプ*: [AWS::AppSync::DomainName](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appsync-domainname.html)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは [AWS::AppSync::DomainName](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appsync-domainname.html) resource. AWS SAM automatically generate the [AWS::AppSync::DomainNameApiAssociation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appsync-domainnameapiassociation.html) resource に直接渡されます。

`Functions`  <a name="sam-graphqlapi-functions"></a>
特定のオペレーションを実行するように GraphQL API の関数を設定します。  
タイプ: [Function](sam-property-graphqlapi-function.md)  
*必須:* はい  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のプロパティはありません。

`Logging`  <a name="sam-graphqlapi-logging"></a>
GraphQL API の Amazon CloudWatch ロギングを設定します。  
このプロパティを指定しない場合、 AWS SAM は次の値を生成`CloudWatchLogsRoleArn`して設定します。  
+ `ExcludeVerboseContent: true`
+ `FieldLogLevel: ALL`
ロギングをオプトアウトするには、以下を指定します。  

```
Logging: false
```
タイプ: [LogConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-graphqlapi-logconfig.html)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::AppSync::GraphQLApi`リソースの `[LogConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appsync-graphqlapi.html#cfn-appsync-graphqlapi-logconfig)`プロパティに直接渡されます。

`LogicalId`  <a name="sam-graphqlapi-logicalid"></a>
GraphQL API の一意の名前です。  
*タイプ*: 文字列  
*必須*: はい  
*CloudFormation 互換性*: このプロパティは、 `AWS::AppSync::GraphQLApi`リソースの `[Name](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appsync-graphqlapi.html#cfn-appsync-graphqlapi-name)`プロパティに直接渡されます。

`Name`  <a name="sam-graphqlapi-name"></a>
GraphQL API の名前です。このプロパティを指定して、`LogicalId` 値を上書きします。  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::AppSync::GraphQLApi`リソースの `[Name](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appsync-graphqlapi.html#cfn-appsync-graphqlapi-name)`プロパティに直接渡されます。

`Resolvers`  <a name="sam-graphqlapi-resolvers"></a>
GraphQL API のフィールドのリゾルバーを設定します。 AWS SAM は、[JavaScript パイプラインリゾルバー](https://docs.aws.amazon.com/appsync/latest/devguide/resolver-reference-overview-js.html#anatomy-of-a-pipeline-resolver-js)をサポートします。  
タイプ: [Resolver](sam-property-graphqlapi-resolver.md)  
*必須:* はい  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

`SchemaInline`  <a name="sam-graphqlapi-schemainline"></a>
SDL 形式の GraphQL スキーマをテキストで表記したものです。  
*タイプ*: 文字列  
*必須:* 条件的。`SchemaInline` または `SchemaUri` を指定する必要があります。  
*CloudFormation 互換性*: このプロパティは、 `AWS::AppSync::GraphQLSchema`リソースの `[Definition](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appsync-graphqlschema.html#cfn-appsync-graphqlschema-definition)`プロパティに直接渡されます。

`SchemaUri`  <a name="sam-graphqlapi-schemauri"></a>
スキーマの Amazon Simple Storage Service (Amazon S3) バケット URI、またはローカルフォルダへのパスです。  
ローカルフォルダへのパスを指定する場合、 はデプロイ前にファイルを最初に Amazon S3 にアップロード CloudFormation する必要があります。 AWS SAM CLI を使用することで、この処理を円滑化することができます。詳細については、「[がデプロイ時にローカルファイル AWS SAM をアップロードする方法](deploy-upload-local-files.md)」を参照してください。  
*タイプ*: 文字列  
*必須:* 条件的。`SchemaInline` または `SchemaUri` を指定する必要があります。  
*CloudFormation 互換性*: このプロパティは、 `AWS::AppSync::GraphQLSchema`リソースの `[DefinitionS3Location](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appsync-graphqlschema.html#cfn-appsync-graphqlschema-definitions3location)`プロパティに直接渡されます。

`Tags`  <a name="sam-graphqlapi-tags"></a>
この GraphQL API のタグ (キーと値のペア)。タグを使用して、リソースを識別し、カテゴリー分類します。  
タイプ: [Tag](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html) のリスト  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::AppSync::GraphQLApi`リソースの `[Tag](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appsync-graphqlapi.html#cfn-appsync-graphqlapi-tags)`プロパティに直接渡されます。

`XrayEnabled`  <a name="sam-graphqlapi-xrayenabled"></a>
このリソースに [AWS X-Ray トレーシング](https://docs.aws.amazon.com/xray/latest/devguide/aws-xray.html)を使用するかどうかを指定します。  
型: ブール  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::AppSync::GraphQLApi`リソースの `[XrayEnabled](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appsync-graphqlapi.html#cfn-appsync-graphqlapi-xrayenabled)`プロパティに直接渡されます。

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

戻り値のリストについては、「[CloudFormation ユーザーガイド](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/Welcome.html)」の「[https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appsync-graphqlapi.html#aws-resource-appsync-graphqlapi-return-values.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appsync-graphqlapi.html#aws-resource-appsync-graphqlapi-return-values.html)」を参照してください。

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

### DynamoDB データソースを使用する GraphQL API
<a name="sam-resource-graphqlapi-examples-example1"></a>

この例では、DynamoDB テーブルをデータソースとして使用する GraphQL API を作成します。

**schema.graphql**

```
schema {
  query: Query
  mutation: Mutation
}

type Query {
  getPost(id: String!): Post
}

type Mutation {
  addPost(author: String!, title: String!, content: String!): Post!
}

type Post {
  id: String!
  author: String
  title: String
  content: String
  ups: Int!
  downs: Int!
  version: Int!
}
```

**template.yaml**

```
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
...
Resources:
  DynamoDBPostsTable:
    Type: AWS::Serverless::SimpleTable

  MyGraphQLAPI:
    Type: AWS::Serverless::GraphQLApi
    Properties:
      SchemaUri: ./sam_graphql_api/schema.graphql
      Auth:
        Type: AWS_IAM
      DataSources:
        DynamoDb:
          PostsDataSource:
            TableName: !Ref DynamoDBPostsTable
            TableArn: !GetAtt DynamoDBPostsTable.Arn
      Functions:
        preprocessPostItem:
          Runtime:
            Name: APPSYNC_JS
            Version: 1.0.0
          DataSource: NONE
          CodeUri: ./sam_graphql_api/preprocessPostItem.js
        createPostItem:
          Runtime:
            Name: APPSYNC_JS
            Version: "1.0.0"
          DataSource: PostsDataSource
          CodeUri: ./sam_graphql_api/createPostItem.js
        getPostFromTable:
          Runtime:
            Name: APPSYNC_JS
            Version: "1.0.0"
          DataSource: PostsDataSource
          CodeUri: ./sam_graphql_api/getPostFromTable.js
      Resolvers:
        Mutation:
          addPost:
            Runtime:
              Name: APPSYNC_JS
              Version: "1.0.0"
            Pipeline:
            - preprocessPostItem
            - createPostItem
        Query:
          getPost:
            CodeUri: ./sam_graphql_api/getPost.js
            Runtime:
              Name: APPSYNC_JS
              Version: "1.0.0"
            Pipeline:
            - getPostFromTable
```

**createPostItem.js**

```
import { util } from "@aws-appsync/utils";

export function request(ctx) {
  const { key, values } = ctx.prev.result;
  return {
    operation: "PutItem",
    key: util.dynamodb.toMapValues(key),
    attributeValues: util.dynamodb.toMapValues(values),
  };
}

export function response(ctx) {
  return ctx.result;
}
```

**getPostFromTable.js**

```
import { util } from "@aws-appsync/utils";

export function request(ctx) {
  return dynamoDBGetItemRequest({ id: ctx.args.id });
}

export function response(ctx) {
  return ctx.result;
}

/**
 * A helper function to get a DynamoDB item
 */
function dynamoDBGetItemRequest(key) {
  return {
    operation: "GetItem",
    key: util.dynamodb.toMapValues(key),
  };
}
```

**preprocessPostItem.js**

```
import { util } from "@aws-appsync/utils";

export function request(ctx) {
  const id = util.autoId();
  const { ...values } = ctx.args;
  values.ups = 1;
  values.downs = 0;
  values.version = 1;
  return { payload: { key: { id }, values: values } };
}

export function response(ctx) {
  return ctx.result;
}
```

リゾルバーコードは以下のとおりです。

**getPost.js**

```
export function request(ctx) {
  return {};
}

export function response(ctx) {
  return ctx.prev.result;
}
```

### データソースとして Lambda 関数を使用する GraphQL API
<a name="sam-resource-graphqlapi-examples-example2"></a>

この例では、Lambda 関数をデータソースとして使用する GraphQL API を作成します。

**template.yaml**

```
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
...
Resources:
  MyLambdaFunction:
    Type: AWS::Serverless::Function
    Properties:
      Handler: index.handler
      Runtime: nodejs20.x
      CodeUri: ./lambda

  MyGraphQLAPI:
    Type: AWS::Serverless::GraphQLApi
    Properties:
      Name: MyApi
      SchemaUri: ./gql/schema.gql
      Auth:
        Type: API_KEY
      ApiKeys:
        MyApiKey:
          Description: my api key
      DataSources:
        Lambda:
          MyLambdaDataSource:
            FunctionArn: !GetAtt MyLambdaFunction.Arn
      Functions:
        lambdaInvoker:
          Runtime:
            Name: APPSYNC_JS
            Version: 1.0.0
          DataSource: MyLambdaDataSource
          CodeUri: ./gql/invoker.js
      Resolvers:
        Mutation:
          addPost:
            Runtime:
              Name: APPSYNC_JS
              Version: 1.0.0
            Pipeline:
            - lambdaInvoker
        Query:
          getPost:
            Runtime:
              Name: APPSYNC_JS
              Version: 1.0.0
            Pipeline:
            - lambdaInvoker

Outputs:
  MyGraphQLAPI:
    Description: AppSync API
    Value: !GetAtt MyGraphQLAPI.GraphQLUrl
  MyGraphQLAPIMyApiKey:
    Description: API Key for authentication
    Value: !GetAtt MyGraphQLAPIMyApiKey.ApiKey
```

**schema.graphql**

```
schema {
  query: Query
  mutation: Mutation
}
type Query {
  getPost(id: ID!): Post
}
type Mutation {
  addPost(id: ID!, author: String!, title: String, content: String): Post!
}
type Post {
  id: ID!
  author: String!
  title: String
  content: String
  ups: Int
  downs: Int
}
```

関数は次のとおりです。

**lambda/index.js**

```
exports.handler = async (event) => {
  console.log("Received event {}", JSON.stringify(event, 3));

  const posts = {
    1: {
      id: "1",
      title: "First book",
      author: "Author1",
      content: "Book 1 has this content",
      ups: "100",
      downs: "10",
    },
  };

  console.log("Got an Invoke Request.");
  let result;
  switch (event.field) {
    case "getPost":
      return posts[event.arguments.id];
    case "addPost":
      // return the arguments back
      return event.arguments;
    default:
      throw new Error("Unknown field, unable to resolve " + event.field);
  }
};
```

**invoker.js**

```
import { util } from "@aws-appsync/utils";

export function request(ctx) {
  const { source, args } = ctx;
  return {
    operation: "Invoke",
    payload: { field: ctx.info.fieldName, arguments: args, source },
  };
}

export function response(ctx) {
  return ctx.result;
}
```

# ApiKeys
<a name="sam-property-graphqlapi-apikeys"></a>

API キーを必要とする GraphQL オペレーションを実行するために使用できる一意のキーを作成します。

## 構文
<a name="sam-property-graphqlapi-apikeys-syntax"></a>

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

### YAML
<a name="sam-property-graphqlapi-apikeys-syntax-yaml"></a>

```
LogicalId:
  ApiKeyId: String
  Description: String
  ExpiresOn: Double
```

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

`ApiKeyId`  <a name="sam-graphqlapi-apikeys-apikeyid"></a>
API キーの一意の名前です。`LogicalId` 値を上書きするように指定します。  
*タイプ*: 文字列  
*必須*: はい  
*CloudFormation 互換性*: このプロパティは、 `AWS::AppSync::ApiKey`リソースの `[ApiKeyId](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appsync-apikey.html#cfn-appsync-apikey-apikeyid)`プロパティに直接渡されます。

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

`ExpiresOn`  <a name="sam-graphqlapi-apikeys-expireson"></a>
API キーが失効してからの時間。日付は、エポックからの秒数で表され、最も近い時間に丸められます。  
型: 倍精度  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::AppSync::ApiKey`リソースの `[Expires](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appsync-apikey.html#cfn-appsync-apikey-expires)`プロパティに直接渡されます。

`LogicalId`  <a name="sam-graphqlapi-apikeys-logicalid"></a>
API キーの一意の名前です。  
*タイプ*: 文字列  
*必須*: はい  
*CloudFormation 互換性*: このプロパティは、 `AWS::AppSync::ApiKey`リソースの `[ApiKeyId](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appsync-apikey.html#cfn-appsync-apikey-apikeyid)`プロパティに直接渡されます。

# Auth
<a name="sam-property-graphqlapi-auth"></a>

GraphQL API 用の認可を設定します。

## 構文
<a name="sam-property-graphqlapi-auth-syntax"></a>

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

### YAML
<a name="sam-property-graphqlapi-auth-syntax-yaml"></a>

```
Additional:
- AuthProvider
LambdaAuthorizer: [LambdaAuthorizerConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-graphqlapi-lambdaauthorizerconfig.html)
OpenIDConnect: [OpenIDConnectConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-graphqlapi-openidconnectconfig.html)
Type: String
UserPool: [UserPoolConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-graphqlapi-userpoolconfig.html)
```

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

`Additional`  <a name="sam-graphqlapi-auth-additional"></a>
GraphQL API 向けの、追加の認可タイプのリストです。  
タイプ: [AuthProvider](sam-property-graphqlapi-auth-authprovider.md) のリスト  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、同等の CloudFormation プロパティはありません。

`LambdaAuthorizer`  <a name="sam-graphqlapi-auth-lambdaauthorizer"></a>
Lambda 関数オーソライザーのオプションの認可設定を指定します。このオプションプロパティは、`Type` を `AWS_LAMBDA` として指定する場合に設定できます。  
*タイプ*: [LambdaAuthorizerConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appsync-graphqlapi.html#cfn-appsync-graphqlapi-lambdaauthorizerconfig)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::AppSync::GraphQLApi`リソースの `[ LambdaAuthorizerConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-graphqlapi-lambdaauthorizerconfig.html)`プロパティに直接渡されます。

`OpenIDConnect`  <a name="sam-graphqlapi-auth-openidconnect"></a>
OpenID Connect 準拠サービスのオプションの認可設定を指定します。このオプションプロパティは、`Type` を `OPENID_CONNECT` として指定する場合に設定できます。  
*タイプ*: [OpenIDConnectConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appsync-graphqlapi.html#cfn-appsync-graphqlapi-openidconnectconfig)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::AppSync::GraphQLApi`リソースの `[ OpenIDConnectConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-graphqlapi-openidconnectconfig.html)`プロパティに直接渡されます。

`Type`  <a name="sam-graphqlapi-auth-type"></a>
アプリケーションと AWS AppSync GraphQL API 間のデフォルトの認可タイプ。  
許可される値のリストと説明については、「*AWS AppSync Developer Guide*」の「[Authorization and authentication](https://docs.aws.amazon.com/appsync/latest/devguide/security-authz.html)」を参照してください。  
Lambda オーソライザー () を指定すると`AWS_LAMBDA`、 は GraphQL API と Lambda 関数間のアクセス許可をプロビジョニングする AWS Identity and Access Management (IAM) ポリシー AWS SAM を作成します。  
*タイプ*: 文字列  
*必須*: はい  
*CloudFormation 互換性*: このプロパティは、 `AWS::AppSync::GraphQLApi`リソースの `[AuthenticationType](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appsync-graphqlapi.html#cfn-appsync-graphqlapi-authenticationtype)`プロパティに直接渡されます。

`UserPool`  <a name="sam-graphqlapi-auth-userpool"></a>
Amazon Cognito ユーザープールを使用するためのオプションの認可設定を指定します。このオプションプロパティは、`Type` を `AMAZON_COGNITO_USER_POOLS` として指定する場合に設定できます。  
*タイプ*: [UserPoolConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appsync-graphqlapi.html#cfn-appsync-graphqlapi-userpoolconfig)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::AppSync::GraphQLApi`リソースの `[ UserPoolConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-graphqlapi-userpoolconfig.html)`プロパティに直接渡されます。

## 例
<a name="sam-property-graphqlapi-auth-examples"></a>

### デフォルトとその他の認可タイプの設定
<a name="sam-property-graphqlapi-auth-examples-example1"></a>

この例では、まず Lambda オーソライザーを GraphQL API のデフォルトの認可タイプとして設定します。

```
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
...
Resources:
  MyGraphQLAPI:
    Type: AWS::Serverless::GraphQLApi
    Properties:
      Auth:
        Type: AWS_LAMBDA
        LambdaAuthorizer:
          AuthorizerUri: !GetAtt Authorizer1.Arn
          AuthorizerResultTtlInSeconds: 10
          IdentityValidationExpression: hello
```

次に、 AWS SAM テンプレートに以下を追加して、GraphQL API のその他の認可タイプを設定します。

```
        Additional:
        - Type: AWS_IAM
        - Type: API_KEY
        - Type: OPENID_CONNECT
          OpenIDConnect:
            AuthTTL: 10
            ClientId: myId
            IatTTL: 10
            Issuer: prod
```

これにより、次の AWS SAM テンプレートが生成されます。

```
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
...
Resources:
  MyGraphQLAPI:
    Type: AWS::Serverless::GraphQLApi
    Properties:
      Auth:
        Type: AWS_LAMBDA
        LambdaAuthorizer:
          AuthorizerUri: !GetAtt Authorizer1.Arn
          AuthorizerResultTtlInSeconds: 10
          IdentityValidationExpression: hello
        Additional:
        - Type: AWS_IAM
        - Type: API_KEY
        - Type: OPENID_CONNECT
          OpenIDConnect:
            AuthTTL: 10
            ClientId: myId
            IatTTL: 10
            Issuer: prod
```

# AuthProvider
<a name="sam-property-graphqlapi-auth-authprovider"></a>

追加の GraphQL API 認可タイプ用のオプションの認可設定。

## 構文
<a name="sam-property-graphqlapi-auth-authprovider-syntax"></a>

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

### YAML
<a name="sam-property-graphqlapi-auth-authprovider-syntax-yaml"></a>

```
LambdaAuthorizer: [LambdaAuthorizerConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-graphqlapi-lambdaauthorizerconfig.html)
OpenIDConnect: [OpenIDConnectConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-graphqlapi-openidconnectconfig.html)
Type: String
UserPool: [UserPoolConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-graphqlapi-userpoolconfig.html)
```

## プロパティ
<a name="sam-property-graphqlapi-auth-authprovider-properties"></a>

`LambdaAuthorizer`  <a name="sam-graphqlapi-auth-authprovider-lambdaauthorizer"></a>
 AWS Lambda 関数オーソライザーのオプションの認可設定を指定します。このオプションプロパティは、`Type` を `AWS_LAMBDA` として指定する場合に設定できます。  
*タイプ*: [LambdaAuthorizerConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appsync-graphqlapi.html#cfn-appsync-graphqlapi-lambdaauthorizerconfig)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::AppSync::GraphQLApi` `[ AdditionalAuthenticationProvider](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-graphqlapi-additionalauthenticationprovider.html)` オブジェクトの `[ LambdaAuthorizerConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-graphqlapi-lambdaauthorizerconfig.html)`プロパティに直接渡されます。

`OpenIDConnect`  <a name="sam-graphqlapi-auth-authprovider-openidconnect"></a>
OpenID Connect 準拠サービスのオプションの認可設定を指定します。このオプションプロパティは、`Type` を `OPENID_CONNECT` として指定する場合に設定できます。  
*タイプ*: [OpenIDConnectConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appsync-graphqlapi.html#cfn-appsync-graphqlapi-openidconnectconfig)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::AppSync::GraphQLApi` `[ AdditionalAuthenticationProvider](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-graphqlapi-additionalauthenticationprovider.html)` オブジェクトの `[ OpenIDConnectConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-graphqlapi-openidconnectconfig.html)`プロパティに直接渡されます。

`Type`  <a name="sam-graphqlapi-auth-authprovider-type"></a>
アプリケーションと AWS AppSync GraphQL API 間のデフォルトの認可タイプ。  
許可される値のリストと説明については、「*AWS AppSync Developer Guide*」の「[Authorization and authentication](https://docs.aws.amazon.com/appsync/latest/devguide/security-authz.html)」を参照してください。  
Lambda オーソライザー () を指定すると`AWS_LAMBDA`、 は GraphQL API と Lambda 関数間のアクセス許可をプロビジョニングする AWS Identity and Access Management (IAM) ポリシー AWS SAM を作成します。  
*タイプ*: 文字列  
*必須*: はい  
*CloudFormation 互換性*: このプロパティは、 `AWS::AppSync::GraphQLApi` `[ AdditionalAuthenticationProvider](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-graphqlapi-additionalauthenticationprovider.html)` オブジェクトの `[ AuthenticationType](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-graphqlapi-additionalauthenticationprovider.html#cfn-appsync-graphqlapi-additionalauthenticationprovider-authenticationtype)`プロパティに直接渡されます。

`UserPool`  <a name="sam-graphqlapi-auth-authprovider-userpool"></a>
Amazon Cognito ユーザープールを使用するためのオプションの認可設定を指定します。このオプションプロパティは、`Type` を `AMAZON_COGNITO_USER_POOLS` として指定する場合に設定できます。  
*タイプ*: [UserPoolConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appsync-graphqlapi.html#cfn-appsync-graphqlapi-userpoolconfig)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::AppSync::GraphQLApi` `[ AdditionalAuthenticationProvider](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-graphqlapi-additionalauthenticationprovider.html)` オブジェクトの `[ UserPoolConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-graphqlapi-userpoolconfig.html)`プロパティに直接渡されます。

# DataSource
<a name="sam-property-graphqlapi-datasource"></a>

GraphQL API リゾルバーが接続できるデータソースを設定します。 AWS Serverless Application Model (AWS SAM) テンプレートを使用して、次のデータソースへの接続を設定できます。
+ Amazon DynamoDB
+ AWS Lambda

データソースの詳細については、「AWS AppSync デベロッパーガイド」の「[データソースのアタッチ](https://docs.aws.amazon.com/appsync/latest/devguide/attaching-a-data-source.html)」を参照してください。

## 構文
<a name="sam-property-graphqlapi-datasource-syntax"></a>

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

### YAML
<a name="sam-property-graphqlapi-datasource-syntax-yaml"></a>

```
DynamoDb: DynamoDb
Lambda: Lambda
```

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

`DynamoDb`  <a name="sam-graphqlapi-datasource-dynamodb"></a>
GraphQL API リゾルバーのデータソースとして DynamoDB テーブルを設定します。  
タイプ: [DynamoDB](sam-property-graphqlapi-datasource-dynamodb.md)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

`Lambda`  <a name="sam-graphqlapi-datasource-lambda"></a>
GraphQL API リゾルバーのデータソースとして Lambda 関数を設定します。  
タイプ: [Lambda](sam-property-graphqlapi-datasource-lambda.md)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

# DynamoDb
<a name="sam-property-graphqlapi-datasource-dynamodb"></a>

GraphQL API リゾルバーのデータソースとして Amazon DynamoDB テーブルを設定します。

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

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

### YAML
<a name="sam-property-graphqlapi-datasource-dynamodb-syntax-yaml"></a>

```
LogicalId:
  DeltaSync: [DeltaSyncConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-datasource-deltasyncconfig.html)
  Description: String
  Name: String
  Permissions: List
  Region: String
  ServiceRoleArn: String
  TableArn: String
  TableName: String
  UseCallerCredentials: Boolean
  Versioned: Boolean
```

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

`DeltaSync`  <a name="sam-graphqlapi-datasource-dynamodb-deltasync"></a>
デルタ同期の構成について説明します。  
*Type*: [DeltaSyncConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-datasource-deltasyncconfig.html)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::AppSync::DataSource DynamoDBConfig` オブジェクトの `[DeltaSyncConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-datasource-dynamodbconfig.html#cfn-appsync-datasource-dynamodbconfig-deltasyncconfig)`プロパティに直接渡されます。

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

`LogicalId`  <a name="sam-graphqlapi-datasource-dynamodb-logicalid"></a>
データソースの一意の名前です。  
*タイプ*: 文字列  
*必須*: はい  
*CloudFormation 互換性*: このプロパティは、 `AWS::AppSync::DataSource`リソースの `[Name](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appsync-datasource.html#cfn-appsync-datasource-name)`プロパティに直接渡されます。

`Name`  <a name="sam-graphqlapi-datasource-dynamodb-name"></a>
データソースの名前です。このプロパティを指定して、`LogicalId` 値を上書きします。  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::AppSync::DataSource`リソースの `[Name](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appsync-datasource.html#cfn-appsync-datasource-name)`プロパティに直接渡されます。

`Permissions`  <a name="sam-graphqlapi-datasource-dynamodb-permissions"></a>
[AWS SAM コネクタ](managing-permissions-connectors.md) を使用して、データソースに許可をプロビジョニングします。リストには、以下の値のいずれかを指定できます。  
+ `Read` – データソースの読み取りをリゾルバーに許可します。
+ `Write` – データソースの書き込みをリゾルバーに許可します。
AWS SAM は、デプロイ時に変換される `AWS::Serverless::Connector`リソースを使用してアクセス許可をプロビジョニングします。生成されたリソースについては、「[CloudFormation を指定したときに生成される リソース AWS::Serverless::Connector](sam-specification-generated-resources-connector.md)」を参照してください。  
`Permissions` または `ServiceRoleArn` を指定できます。両方を指定することはできません。どちらも指定しない場合、 AWS SAM は `Read`と のデフォルト値を生成します`Write`。データソースへのアクセスを取り消すには、 AWS SAM テンプレートから DynamoDB オブジェクトを削除します。
*タイプ*: リスト  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。これは、`AWS::Serverless::Connector` リソースの `Permissions` プロパティに似ています。

`Region`  <a name="sam-graphqlapi-datasource-dynamodb-region"></a>
DynamoDB テーブル AWS リージョン の 。指定しない場合、 は AWS SAM を使用します`[AWS::Region](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/pseudo-parameter-reference.html#cfn-pseudo-param-region)`。  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::AppSync::DataSource DynamoDBConfig` オブジェクトの `[AwsRegion](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-datasource-dynamodbconfig.html#cfn-appsync-datasource-dynamodbconfig-awsregion)`プロパティに直接渡されます。

`ServiceRoleArn`  <a name="sam-graphqlapi-datasource-dynamodb-servicerolearn"></a>
データソースの AWS Identity and Access Management (IAM) サービスロール ARN。システムは、データソースにアクセスするときにこのロールを引き受けます。  
`Permissions` または `ServiceRoleArn` を指定できます。両方を指定することはできません。  
*タイプ*: 文字列  
*必須*: いいえ。指定しない場合、 は のデフォルト値 AWS SAM を適用します`Permissions`。  
*CloudFormation 互換性*: このプロパティは、 `AWS::AppSync::DataSource`リソースの `[ServiceRoleArn](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appsync-datasource.html#cfn-appsync-datasource-servicerolearn)`プロパティに直接渡されます。

`TableArn`  <a name="sam-graphqlapi-datasource-dynamodb-tablearn"></a>
DynamoDB テーブルの ARN です。  
*タイプ*: 文字列  
*必須:* 条件的。`ServiceRoleArn` を指定しない場合は、`TableArn` が必要になります。  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のプロパティはありません。

`TableName`  <a name="sam-graphqlapi-datasource-dynamodb-tablename"></a>
テーブル名。  
*タイプ*: 文字列  
*必須*: はい  
*CloudFormation 互換性*: このプロパティは、 `AWS::AppSync::DataSource DynamoDBConfig` オブジェクトの `[TableName](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-datasource-dynamodbconfig.html#cfn-appsync-datasource-dynamodbconfig-tablename)`プロパティに直接渡されます。

`UseCallerCredentials`  <a name="sam-graphqlapi-datasource-dynamodb-usecallercredentials"></a>
`true` に設定して、このデータソースで IAM を使用します。  
型: ブール  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::AppSync::DataSource DynamoDBConfig` オブジェクトの `[UseCallerCredentials](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-datasource-dynamodbconfig.html#cfn-appsync-datasource-dynamodbconfig-usecallercredentials)`プロパティに直接渡されます。

`Versioned`  <a name="sam-graphqlapi-datasource-dynamodb-versioned"></a>
`true` に設定して、このデータソースで [Conflict Detection、Conflict Resolution、および Sync](https://docs.aws.amazon.com/appsync/latest/devguide/conflict-detection-and-sync.html) を使用します。  
タイプ: ブール  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::AppSync::DataSource DynamoDBConfig` オブジェクトの `[Versioned](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-datasource-dynamodbconfig.html#cfn-appsync-datasource-dynamodbconfig-versioned)`プロパティに直接渡されます。

# Lambda
<a name="sam-property-graphqlapi-datasource-lambda"></a>

GraphQL API リゾルバーのデータソースとして AWS Lambda 関数を設定します。

## 構文
<a name="sam-property-graphqlapi-datasource-lambda-syntax"></a>

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

### YAML
<a name="sam-property-graphqlapi-datasource-lambda-syntax-yaml"></a>

```
LogicalId:
  Description: String
  FunctionArn: String
  Name: String
  ServiceRoleArn: String
```

## プロパティ
<a name="sam-property-graphqlapi-datasource-lambda-properties"></a>

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

`FunctionArn`  <a name="sam-graphqlapi-datasource-lambda-functionarn"></a>
Lambda 関数の ARN。  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::AppSync::DataSource LambdaConfig` オブジェクトの `[LambdaFunctionArn](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-datasource-lambdaconfig.html#cfn-appsync-datasource-lambdaconfig-lambdafunctionarn)`プロパティに直接渡されます。

`LogicalId`  <a name="sam-graphqlapi-datasource-lambda-logicalid"></a>
データソースの一意の名前です。  
*タイプ*: 文字列  
*必須*: はい  
*CloudFormation 互換性*: このプロパティは、 `AWS::AppSync::DataSource`リソースの `[Name](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appsync-datasource.html#cfn-appsync-datasource-name)`プロパティに直接渡されます。

`Name`  <a name="sam-graphqlapi-datasource-lambda-name"></a>
データソースの名前です。このプロパティを指定して、`LogicalId` 値を上書きします。  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::AppSync::DataSource`リソースの `[Name](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appsync-datasource.html#cfn-appsync-datasource-name)`プロパティに直接渡されます。

`ServiceRoleArn`  <a name="sam-graphqlapi-datasource-lambda-servicerolearn"></a>
データソースの AWS Identity and Access Management (IAM) サービスロール ARN。システムは、データソースにアクセスするときにこのロールを引き受けます。  
データソースへのアクセスを取り消すには、 AWS SAM テンプレートから Lambda オブジェクトを削除します。
*タイプ*: 文字列  
*必須*: いいえ。指定しない場合、 を使用して`Write`アクセス許可をプロビジョニング AWS SAM します[AWS SAM コネクタ](managing-permissions-connectors.md)。  
*CloudFormation 互換性*: このプロパティは、 `AWS::AppSync::DataSource`リソースの `[ServiceRoleArn](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appsync-datasource.html#cfn-appsync-datasource-servicerolearn)`プロパティに直接渡されます。

# 関数
<a name="sam-property-graphqlapi-function"></a>

特定のオペレーションを実行するように GraphQL API の関数を設定します。

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

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

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

```
LogicalId:
  CodeUri: String
  DataSource: String
  Description: String
  Id: String
  InlineCode: String
  MaxBatchSize: Integer
  Name: String
  Runtime: Runtime
  Sync: [SyncConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-functionconfiguration-syncconfig.html)
```

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

`CodeUri`  <a name="sam-graphqlapi-function-codeuri"></a>
関数コードの Amazon Simple Storage Service (Amazon S3) URI、またはローカルフォルダへのパスです。  
ローカルフォルダへのパスを指定する場合、 CloudFormation はデプロイ前にファイルを最初に Amazon S3 にアップロードする必要があります。 AWS SAM CLI を使用することで、この処理を円滑化することができます。詳細については、「[がデプロイ時にローカルファイル AWS SAM をアップロードする方法](deploy-upload-local-files.md)」を参照してください。  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::AppSync::FunctionConfiguration`リソースの `[CodeS3Location](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appsync-functionconfiguration.html#cfn-appsync-functionconfiguration-codes3location)`プロパティに直接渡されます。

`DataSource`  <a name="sam-graphqlapi-function-datasource"></a>
この関数がアタッチされるデータソースの名前です。  
+ `AWS::Serverless::GraphQLApi` リソース内のデータソースを参照するには、その論理 ID を指定します。
+ `AWS::Serverless::GraphQLApi` リソース外のデータソースを参照するには、`Fn::GetAtt` 組み込み関数を使用して、その `Name` 属性を指定します。例えば、`!GetAtt MyLambdaDataSource.Name`。
+ 別のスタックからのデータソースを参照するには、`[Fn::ImportValue](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-importvalue.html)` を使用します。
のバリエーション`[NONE | None | none]`が指定されている場合、 AWS SAM は `AWS::AppSync::DataSource` `[Type](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appsync-datasource.html#cfn-appsync-datasource-type)` オブジェクト`None`の値を生成します。  
*タイプ*: 文字列  
*必須*: はい  
*CloudFormation 互換性*: このプロパティは、 `AWS::AppSync::FunctionConfiguration`リソースの `[DataSourceName](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appsync-functionconfiguration.html#cfn-appsync-functionconfiguration-datasourcename)`プロパティに直接渡されます。

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

`Id`  <a name="sam-graphqlapi-function-id"></a>
`AWS::Serverless::GraphQLApi` リソース外にある関数の関数 ID です。  
+ 同じ AWS SAM テンプレート内の関数を参照するには、`Fn::GetAtt`組み込み関数を使用します。例: `Id: !GetAtt createPostItemFunc.FunctionId`。
+ 別のスタックからの関数を参照するには、`[Fn::ImportValue](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-importvalue.html)` を使用します。
を使用する場合`Id`、他のすべてのプロパティは許可されません。 AWS SAM は参照される関数の関数 ID を自動的に渡します。  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

`InlineCode`  <a name="sam-graphqlapi-function-inlinecode"></a>
リクエスト関数とレスポンス関数が含まれる関数コードです。  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::AppSync::FunctionConfiguration`リソースの `[Code](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appsync-functionconfiguration.html#cfn-appsync-functionconfiguration-code)`プロパティに直接渡されます。

`LogicalId`  <a name="sam-graphqlapi-function-logicalid"></a>
関数の一意の名前です。  
*タイプ*: 文字列  
*必須*: はい  
*CloudFormation 互換性*: このプロパティは、 `AWS::AppSync::FunctionConfiguration`リソースの `[Name](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appsync-functionconfiguration.html#cfn-appsync-functionconfiguration-name)`プロパティに直接渡されます。

`MaxBatchSize`  <a name="sam-graphqlapi-function-maxbatchsize"></a>
`BatchInvoke` オペレーションの単一の AWS Lambda 機能に送信されるリゾルバーリクエスト入力の最大数を指定します。  
*タイプ:* 整数  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::AppSync::FunctionConfiguration`リソースの [MaxBatchSize](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appsync-functionconfiguration.html#cfn-appsync-functionconfiguration-maxbatchsize) プロパティに直接渡されます。

`Name`  <a name="sam-graphqlapi-function-name"></a>
関数の名前 `LogicalId` 値を上書きするように指定します。  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::AppSync::FunctionConfiguration`リソースの `[Name](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appsync-functionconfiguration.html#cfn-appsync-functionconfiguration-name)`プロパティに直接渡されます。

`Runtime`  <a name="sam-graphqlapi-function-runtime"></a>
 AWS AppSync パイプラインリゾルバーまたは AWS AppSync 関数で使用されるランタイムについて説明します。使用するランタイムの名前とバージョンを指定します。  
タイプ: [Runtime](sam-property-graphqlapi-function-runtime.md)  
*必須:* はい  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のプロパティはありません。これは、`AWS::AppSync::FunctionConfiguration` リソースの `[Runtime](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appsync-functionconfiguration.html#cfn-appsync-functionconfiguration-runtime)` プロパティに似ています。

`Sync`  <a name="sam-graphqlapi-function-sync"></a>
関数の Sync 構成について説明します。  
関数が呼び出されたときに、どの競合検出戦略および解決戦略を使用するかを指定します。  
タイプ: [SyncConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-functionconfiguration-syncconfig.html)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::AppSync::FunctionConfiguration`リソースの `[SyncConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appsync-functionconfiguration.html#cfn-appsync-functionconfiguration-syncconfig)`プロパティに直接渡されます。

# 実行時間
<a name="sam-property-graphqlapi-function-runtime"></a>

パイプラインリゾルバーまたは関数のランタイムです。使用する名前とバージョンを指定します。

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

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

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

```
Name: String
Version: String
```

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

`Name`  <a name="sam-graphqlapi-function-runtime-name"></a>
使用するランタイムの名前です。現在許容されている値は、`APPSYNC_JS` のみです。  
*タイプ*: 文字列  
*必須*: はい  
*CloudFormation 互換性*: このプロパティは、 `AWS::AppSync::FunctionConfiguration AppSyncRuntime` オブジェクトの `[Name](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-functionconfiguration-appsyncruntime.html#cfn-appsync-functionconfiguration-appsyncruntime-name)`プロパティに直接渡されます。

`Version`  <a name="sam-graphqlapi-function-runtime-version"></a>
使用するランタイムのバージョンです。現在許容されているバージョンは、`1.0.0` のみです。  
*タイプ*: 文字列  
*必須*: はい  
*CloudFormation 互換性*: このプロパティは、 `AWS::AppSync::FunctionConfiguration AppSyncRuntime` オブジェクトの `[RuntimeVersion](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-functionconfiguration-appsyncruntime.html#cfn-appsync-functionconfiguration-appsyncruntime-runtimeversion)`プロパティに直接渡されます。

# [リゾルバ]
<a name="sam-property-graphqlapi-resolver"></a>

GraphQL API のフィールドにリゾルバーを設定します。 AWS Serverless Application Model (AWS SAM) は [JavaScript パイプラインリゾルバー](https://docs.aws.amazon.com/appsync/latest/devguide/resolver-reference-overview-js.html)をサポートします。

## 構文
<a name="sam-property-graphqlapi-resolver-syntax"></a>

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

### YAML
<a name="sam-property-graphqlapi-resolver-syntax-yaml"></a>

```
OperationType:
  LogicalId:
    Caching: [CachingConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-resolver-cachingconfig.html)
    CodeUri: String
    FieldName: String
    InlineCode: String 
    MaxBatchSize: Integer
    Pipeline: List
    Runtime: Runtime
    Sync: [SyncConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-resolver-syncconfig.html)
```

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

`Caching`  <a name="sam-graphqlapi-resolver-caching"></a>
キャッシュが有効になっているリゾルバーのキャッシュ構成です。  
タイプ: [CachingConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-resolver-cachingconfig.html)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::AppSync::Resolver`リソースの `[CachingConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appsync-resolver.html#cfn-appsync-resolver-cachingconfig)`プロパティに直接渡されます。

`CodeUri`  <a name="sam-graphqlapi-resolver-codeuri"></a>
リゾルバー関数コードの Amazon Simple Storage Service (Amazon S3) URI、またはローカルフォルダへのパスです。  
ローカルフォルダへのパスを指定する場合、 CloudFormation はデプロイ前にファイルを最初に Amazon S3 にアップロードする必要があります。 AWS SAM CLI を使用することで、この処理を円滑化することができます。詳細については、「[がデプロイ時にローカルファイル AWS SAM をアップロードする方法](deploy-upload-local-files.md)」を参照してください。  
`CodeUri` または が指定されていない場合、 AWS SAM `InlineCode`はリクエストを最初のパイプライン関数に`InlineCode`リダイレクトし、最後のパイプライン関数からレスポンスを受け取る を生成します。  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::AppSync::Resolver`リソースの `[CodeS3Location](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appsync-resolver.html#cfn-appsync-resolver-codes3location)`プロパティに直接渡されます。

`FieldName`  <a name="sam-graphqlapi-resolver-fieldname"></a>
リゾルバーの名前です。このプロパティを指定して、`LogicalId` 値を上書きします。  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::AppSync::Resolver`リソースの `[FieldName](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appsync-resolver.html#cfn-appsync-resolver-fieldname)`プロパティに直接渡されます。

`InlineCode`  <a name="sam-graphqlapi-resolver-inlinecode"></a>
リクエスト関数とレスポンス関数が含まれるリゾルバーコードです。  
`CodeUri` または が指定されていない場合、 AWS SAM `InlineCode`はリクエストを最初のパイプライン関数に`InlineCode`リダイレクトし、最後のパイプライン関数からレスポンスを受け取る を生成します。  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::AppSync::Resolver`リソースの `[Code](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appsync-resolver.html#cfn-appsync-resolver-code)`プロパティに直接渡されます。

`LogicalId`  <a name="sam-graphqlapi-resolver-logicalid"></a>
リゾルバーの一意の名前です。GraphQL スキーマでは、リゾルバーが使用されるフィールド名が、リゾルバー名と一致する必要があります。`LogicalId` にも、それと同じフィールド名を使用してください。  
*タイプ*: 文字列  
*必須*: はい  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

`MaxBatchSize`  <a name="sam-graphqlapi-resolver-maxbatchsize"></a>
`BatchInvoke` オペレーションの単一の AWS Lambda 機能に送信されるリゾルバーリクエスト入力の最大数を指定します。  
*タイプ:* 整数  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::AppSync::Resolver`リソースの `[MaxBatchSize](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appsync-resolver.html#cfn-appsync-resolver-maxbatchsize)`プロパティに直接渡されます。

`OperationType`  <a name="sam-graphqlapi-resolver-operationtype"></a>
リゾルバーに関連付けられている GraphQL オペレーションタイプです。例えば、`Query`、`Mutation`、または `Subscription` などです。単一の `OperationType` 内にある `LogicalId` で、複数のリゾルバーをネストすることができます。  
*タイプ*: 文字列  
*必須*: はい  
*CloudFormation 互換性*: このプロパティは、 `AWS::AppSync::Resolver`リソースの `[TypeName](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appsync-resolver.html#cfn-appsync-resolver-typename)`プロパティに直接渡されます。

`Pipeline`  <a name="sam-graphqlapi-resolver-pipeline"></a>
パイプランリゾルバーにリンクされている関数。リスト内の論理 ID で関数を指定します。  
*タイプ*: リスト  
*必須:* はい  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のプロパティはありません。これは、`AWS::AppSync::Resolver` リソースの `[PipelineConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appsync-resolver.html#cfn-appsync-resolver-pipelineconfig)` プロパティに似ています。

`Runtime`  <a name="sam-graphqlapi-resolver-runtime"></a>
パイプラインリゾルバーまたは関数のランタイムです。使用する名前とバージョンを指定します。  
タイプ: [Runtime](sam-property-graphqlapi-resolver-runtime.md)  
*必須:* はい  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のプロパティはありません。これは、`AWS::AppSync::Resolver` リソースの `[Runtime](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appsync-resolver.html#cfn-appsync-resolver-runtime)` プロパティに似ています。

`Sync`  <a name="sam-graphqlapi-resolver-sync"></a>
リゾルバーの同期構成について説明します。  
リゾルバーが呼び出されたときに、どの競合検出戦略および解決戦略を使用するかを指定します。  
タイプ: [SyncConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-resolver-syncconfig.html)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::AppSync::Resolver`リソースの `[SyncConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appsync-resolver.html#cfn-appsync-resolver-syncconfig)`プロパティに直接渡されます。

## 例
<a name="sam-property-graphqlapi-resolver-examples"></a>

### AWS SAM 生成されたリゾルバー関数コードを使用し、フィールドを変数として保存する
<a name="sam-property-graphqlapi-resolver-examples-example1"></a>

以下は、この例の GraphQL スキーマです。

```
schema {
  query: Query
  mutation: Mutation
}

type Query {
  getPost(id: ID!): Post
}

type Mutation {
  addPost(author: String!, title: String!, content: String!): Post!
}

type Post {
  id: ID!
  author: String
  title: String
  content: String
}
```

 AWS SAM テンプレートのスニペットを次に示します。

```
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
...
Resources:
  MyGraphQLApi:
    Type: AWS::Serverless::GraphQLApi
    Properties:
      ...
      Functions:
        preprocessPostItem:
          ...
        createPostItem:
          ...
      Resolvers:
        Mutation:
          addPost:
            Runtime:
              Name: APPSYNC_JS
              Version: 1.0.0
            Pipeline:
            - preprocessPostItem
            - createPostItem
```

 AWS SAM テンプレートでは、 `CodeUri`または を指定しません`InlineCode`。デプロイ時に、 はリゾルバーの次のインラインコード AWS SAM を自動的に生成します。

```
export function request(ctx) {
  return {};
}

export function response(ctx) {
  return ctx.prev.result;
}
```

このデフォルトリゾルバーコードは、リクエストを最初のパイプライン関数にリダイレクトし、最後のパイプライン関数からレスポンスを受け取ります。

最初のパイプライン関数では、提供された `args` フィールドを使用してリクエストオブジェクトを解析し、変数を作成することができます。作成後、関数内でこれらの変数を使用できます。以下は、`preprocessPostItem` 関数の例です。

```
import { util } from "@aws-appsync/utils";

export function request(ctx) {
  const author = ctx.args.author;
  const title = ctx.args.title;
  const content = ctx.args.content;
  
  // Use variables to process data
  
}

export function response(ctx) {
  return ctx.result;
}
```

# 実行時間
<a name="sam-property-graphqlapi-resolver-runtime"></a>

パイプラインリゾルバーまたは関数のランタイムです。使用する名前とバージョンを指定します。

## 構文
<a name="sam-property-graphqlapi-resolver-runtime-syntax"></a>

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

### YAML
<a name="sam-property-graphqlapi-resolver-runtime-syntax-yaml"></a>

```
Name: String
Version: String
```

## プロパティ
<a name="sam-property-graphqlapi-resolver-runtime-properties"></a>

`Name`  <a name="sam-graphqlapi-resolver-runtime-name"></a>
使用するランタイムの名前です。現在許容されている値は、`APPSYNC_JS` のみです。  
*タイプ*: 文字列  
*必須*: はい  
*CloudFormation 互換性*: このプロパティは、 `AWS::AppSync::Resolver AppSyncRuntime` オブジェクトの `[Name](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-resolver-appsyncruntime.html#cfn-appsync-resolver-appsyncruntime-name)`プロパティに直接渡されます。

`Version`  <a name="sam-graphqlapi-resolver-runtime-version"></a>
使用するランタイムのバージョンです。現在許容されているバージョンは、`1.0.0` のみです。  
*タイプ*: 文字列  
*必須*: はい  
*CloudFormation 互換性*: このプロパティは、 `AWS::AppSync::Resolver AppSyncRuntime` オブジェクトの `[RuntimeVersion](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-resolver-appsyncruntime.html#cfn-appsync-resolver-appsyncruntime-runtimeversion)`プロパティに直接渡されます。

# AWS::Serverless::HttpApi
<a name="sam-resource-httpapi"></a>

REST API よりもレイテンシーとコストが低い RESTful API を作成できる Amazon API Gateway HTTP API を作成します。詳細については、*API Gateway デベロッパーガイド*の「[HTTP API の操作](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api.html)」を参照してください。

 CloudFormation フックまたは IAM ポリシーを使用して、API Gateway リソースにアクセスを制御するオーソライザーがアタッチされていることを確認することをお勧めします。

 CloudFormation フックの使用の詳細については、*CloudFormation CLI ユーザーガイド*の[「フックの登録](https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/registering-hook-python.html)」および[apigw-enforce-authorizer](https://github.com/aws-cloudformation/aws-cloudformation-samples/tree/main/hooks/python-hooks/apigw-enforce-authorizer/) GitHub リポジトリ」を参照してください。

IAM ポリシーの使用の詳細については、「*API ゲートウェイデベロッパーガイド*」の「[API ルートに認可を要求する](https://docs.aws.amazon.com/apigateway/latest/developerguide/security_iam_id-based-policy-examples.html#security_iam_id-based-policy-examples-require-authorization)」を参照してください。

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

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

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

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

```
Type: AWS::Serverless::HttpApi
Properties:
  [AccessLogSettings](#sam-httpapi-accesslogsettings): [AccessLogSettings](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigatewayv2-stage.html#cfn-apigatewayv2-stage-accesslogsettings)
  [Auth](#sam-httpapi-auth): HttpApiAuth
  [CorsConfiguration](#sam-httpapi-corsconfiguration): String | HttpApiCorsConfiguration
  [DefaultRouteSettings](#sam-httpapi-defaultroutesettings): [RouteSettings](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigatewayv2-stage.html#cfn-apigatewayv2-stage-routesettings)
  [DefinitionBody](#sam-httpapi-definitionbody): JSON
  [DefinitionUri](#sam-httpapi-definitionuri): String | HttpApiDefinition
  [Description](#sam-httpapi-description): String
  [DisableExecuteApiEndpoint](#sam-httpapi-disableexecuteapiendpoint): Boolean
  [Domain](#sam-httpapi-domain): HttpApiDomainConfiguration
  [FailOnWarnings](#sam-httpapi-failonwarnings): Boolean
  Name: String
  PropagateTags: Boolean
  [RouteSettings](#sam-httpapi-routesettings): [RouteSettings](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigatewayv2-stage.html#cfn-apigatewayv2-stage-routesettings)
  [StageName](#sam-httpapi-stagename): String
  [StageVariables](#sam-httpapi-stagevariables): [Json](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigatewayv2-stage.html#cfn-apigatewayv2-stage-stagevariables)
  [Tags](#sam-httpapi-tags): Map
```

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

 `AccessLogSettings`   <a name="sam-httpapi-accesslogsettings"></a>
ステージのアクセスロギングのための設定です。  
*タイプ*: [AccessLogSettings](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigatewayv2-stage.html#cfn-apigatewayv2-stage-accesslogsettings)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::ApiGatewayV2::Stage`リソースの `[AccessLogSettings](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigatewayv2-stage.html#cfn-apigatewayv2-stage-accesslogsettings)`プロパティに直接渡されます。

 `Auth`   <a name="sam-httpapi-auth"></a>
API Gateway HTTP API へのアクセスを制御するための認可を設定します。  
詳細については、*API Gateway デベロッパーガイド*の「[JWT オーソライザーを使用した HTTP API へのアクセスの制御](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-jwt-authorizer.html)」を参照してください。  
*タイプ*: [HttpApiAuth](sam-property-httpapi-httpapiauth.md)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `CorsConfiguration`   <a name="sam-httpapi-corsconfiguration"></a>
すべての API Gateway HTTP API のクロスオリジンリソース共有 (CORS) を管理します。文字列として許可するドメインを指定、または `HttpApiCorsConfiguration` オブジェクトを指定します。CORS では OpenAPI 定義を変更 AWS SAM する必要があるため、CORS は `DefinitionBody`プロパティが指定されている場合にのみ機能することに注意してください。  
詳細については、*API Gateway デベロッパーガイド*の「[HTTP API の CORS の設定](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-cors.html)」を参照してください。  
`CorsConfiguration` が OpenAPI 定義とプロパティレベルの両方で設定されている場合、 は両方の設定ソースをプロパティを優先して AWS SAM マージします。このプロパティが `true` に設定されている場合、すべてのオリジンが許可されます。
*タイプ*: 文字列 \$1 [HttpApiCorsConfiguration](sam-property-httpapi-httpapicorsconfiguration.md)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `DefaultRouteSettings`   <a name="sam-httpapi-defaultroutesettings"></a>
この HTTP API のデフォルトルート設定です。これらの設定は、特定のルートの `RouteSettings` プロパティによって上書きされる場合を除き、すべてのルートに適用されます。  
*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)`プロパティに直接渡されます。

 `DefinitionBody`   <a name="sam-httpapi-definitionbody"></a>
HTTP API を説明する OpenAPI 定義です。`DefinitionUri` または を指定しない場合`DefinitionBody`、 はテンプレート設定に基づいて `DefinitionBody` AWS SAM を生成します。  
*Type*: JSON  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::ApiGatewayV2::Api`リソースの `[Body](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigatewayv2-api.html#cfn-apigatewayv2-api-body)`プロパティに似ています。特定のプロパティが指定されている場合、渡される`DefinitionBody`前に にコンテンツを挿入したり、 を変更 AWS SAM したりできます CloudFormation。プロパティには `Auth`、および対応する `AWS::Serverless::Function` のための HttpApi タイプの `EventSource` が含まれます。

 `DefinitionUri`   <a name="sam-httpapi-definitionuri"></a>
HTTP API を定義する OpenAPI 定義の Amazon Simple Storage Service (Amazon S3) URI、ローカルファイルパス、またはロケーションオブジェクトです。このプロパティが参照する Amazon S3 オブジェクトは、有効な OpenAPI 定義ファイルである必要があります。を指定しない場合、`DefinitionUri`または が指定されている場合、 `DefinitionBody`はテンプレート設定に基づいて `DefinitionBody` AWS SAM を生成します。  
ローカルファイルパスを指定する場合は、定義が適切に変換されるようにするために、テンプレートが `sam deploy` または `sam package` コマンドを含むワークフローを実行する必要があります。  
`DefinitionUri` を使用して参照する外部 OpenApi 定義ファイルでは、組み込み関数はサポートされていません。OpenApi 定義をテンプレートにインポートするには、[Include transform](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/create-reusable-transform-function-snippets-and-add-to-your-template-with-aws-include-transform.html) が含まれる `DefinitionBody` プロパティを使用します。  
*タイプ*: 文字列 \$1 [HttpApiDefinition](sam-property-httpapi-httpapidefinition.md)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::ApiGatewayV2::Api`リソースの `[BodyS3Location](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigatewayv2-api.html#cfn-apigatewayv2-api-bodys3location)`プロパティに似ています。ネストされた Amazon S3 プロパティには異なる名前が付けられています。

 `Description`   <a name="sam-httpapi-description"></a>
HTTP API リソースの説明です。  
を指定すると`Description`、 AWS SAM は `description`フィールドを設定して HTTP API リソースの OpenApi 定義を変更します。次のシナリオではエラーが発生します。  
+ `DefinitionBody` プロパティは、Open API 定義で設定された `description` フィールドで指定されます。これにより、解決 AWS SAM されない `description`フィールドの競合が発生します。
+ `DefinitionUri` プロパティが指定されています。Amazon AWS SAM S3 から取得される Open API 定義は変更されません。 Amazon S3
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `DisableExecuteApiEndpoint`   <a name="sam-httpapi-disableexecuteapiendpoint"></a>
クライアントがデフォルトの `execute-api` エンドポイント `https://{api_id}.execute-api.{region}.amazonaws.com` を使用して HTTP API を呼び出すことができるかどうかを指定します。デフォルトで、クライアントはデフォルトのエンドポイントを使用して API を呼び出すことができます。クライアントが API の呼び出しにカスタムドメイン名以外を使用しないようにするには、デフォルトのエンドポイントを無効にします。  
このプロパティを使用するには、 `DefinitionBody` プロパティではなく `DefinitionUri`プロパティを指定するか、OpenAPI 定義の `x-amazon-apigateway-endpoint-configuration` を `disableExecuteApiEndpoint` に定義する必要があります。  
型: ブール  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::ApiGatewayV2::Api`リソースの `[ DisableExecuteApiEndpoint](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigatewayv2-api.html#cfn-apigatewayv2-api-disableexecuteapiendpoint)`プロパティに似ています。これは `[ x-amazon-apigateway-endpoint-configuration](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-swagger-extensions-endpoint-configuration.html)` 拡張機能の `disableExecuteApiEndpoint` プロパティに直接渡され、`AWS::ApiGatewayV2::Api` リソースの ` [ Body](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigatewayv2-api.html#cfn-apigatewayv2-api-body)` プロパティに追加されます。

 `Domain`   <a name="sam-httpapi-domain"></a>
この API Gateway HTTP API のカスタムドメインを設定します。  
*タイプ*: [HttpApiDomainConfiguration](sam-property-httpapi-httpapidomainconfiguration.md)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `FailOnWarnings`   <a name="sam-httpapi-failonwarnings"></a>
警告が発生したときに HTTP API の作成をロールバックするか (`true`) しないか (`false`) を指定します。デフォルト値は `false` です。  
*タイプ*: ブール  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::ApiGatewayV2::Api`リソースの `[FailOnWarnings](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigatewayv2-api.html#cfn-apigatewayv2-api-failonwarnings)`プロパティに直接渡されます。

`Name`  <a name="sam-httpapi-name"></a>
HTTP API リソースの名前。  
を指定すると`Name`、 AWS SAM は `title`フィールドを設定して HTTP API リソースの OpenAPI 定義を変更します。次のシナリオではエラーが発生します。  
+ `DefinitionBody` プロパティは、Open API 定義で設定された `title` フィールドで指定されます。これにより、解決 AWS SAM されない `title`フィールドの競合が発生します。
+ `DefinitionUri` プロパティが指定されています。Amazon AWS SAM S3 から取得される Open API 定義は変更されません。 Amazon S3
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のプロパティはありません。

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

 `RouteSettings`   <a name="sam-httpapi-routesettings"></a>
この HTTP API に対するルートごとのルート設定です。詳細については、*API Gateway デベロッパーガイド*の「[HTTP API のルートの使用](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-routes.html)」を参照してください。  
*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)`プロパティに直接渡されます。

 `StageName`   <a name="sam-httpapi-stagename"></a>
API ステージの名前です。名前が指定されていない場合、 は API Gateway の `$default`ステージ AWS SAM を使用します。  
*タイプ*: 文字列  
*必須:* いいえ  
*デフォルト*: \$1default  
*CloudFormation 互換性*: このプロパティは、 `AWS::ApiGatewayV2::Stage`リソースの `[StageName](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigatewayv2-stage.html#cfn-apigatewayv2-stage-stagename)`プロパティに直接渡されます。

 `StageVariables`   <a name="sam-httpapi-stagevariables"></a>
ステージ変数を定義するマップです。変数名には、英数字とアンダースコアを使用できます。値は [A-Za-z0-9-.\$1\$1:/?\$1&=,]\$1 に一致する必要があります。  
*タイプ*: [Json](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigatewayv2-stage.html#cfn-apigatewayv2-stage-stagevariables)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::ApiGatewayV2::Stage`リソースの `[StageVariables](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigatewayv2-stage.html#cfn-apigatewayv2-stage-stagevariables)`プロパティに直接渡されます。

 `Tags`   <a name="sam-httpapi-tags"></a>
この API Gateway ステージに追加するタグを指定するマップ (文字列対文字列) です。キーの長さは 1～128 文字の Unicode 文字で、プレフィックス `aws:` を含めることはできません。以下の文字を使用できます。一連の Unicode 文字、数字、空白、`_`、`.`、`/`、`=`、`+`、`-`。値は 1～256 文字の Unicode 文字にすることができます。  
*タイプ*: マップ  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のプロパティはありません。  
*追加の注意*: `Tags`プロパティは OpenAPI 定義を変更する必要がある AWS SAM ため、タグは `DefinitionBody`プロパティが指定されている場合のみ追加されます。 `DefinitionUri` プロパティが指定されている場合、タグは追加されません。 は`httpapi:createdBy:SAM`タグ AWS SAM を自動的に追加します。タグは、`AWS::ApiGatewayV2::Stage` リソースと `AWS::ApiGatewayV2::DomainName` リソース (`DomainName` が指定されている場合) にも追加されます。

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

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

このリソースの論理 ID を `Ref` 組み込み関数に渡すと、`Ref` は基盤となる `AWS::ApiGatewayV2::Api` リソースの API ID (`a1bcdef2gh` など) を返します。

`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)」を参照してください。

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

### シンプルな HttpApi
<a name="sam-resource-httpapi--examples--simple-httpapi"></a>

以下の例は、Lambda 関数によってサポートされる HTTP API エンドポイントをセットアップするために必要な最小限の内容を示しています。この例では、 が AWS SAM 作成するデフォルトの HTTP API を使用します。

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

```
AWSTemplateFormatVersion: '2010-09-09'
Description: AWS SAM template with a simple API definition
Resources:
  ApiFunction:
    Type: AWS::Serverless::Function
    Properties:
      Events:
        ApiEvent:
          Type: HttpApi
      Handler: index.handler
      InlineCode: |
        def handler(event, context):
            return {'body': 'Hello World!', 'statusCode': 200}
      Runtime: python3.7
Transform: AWS::Serverless-2016-10-31
```

### Auth を使用した HTTP API
<a name="sam-resource-httpapi--examples--httpapi-with-auth"></a>

以下の例は、API エンドポイントで認可をセットアップする方法を示しています。

#### YAML
<a name="sam-resource-httpapi--examples--httpapi-with-auth--yaml"></a>

```
Properties:
  FailOnWarnings: true
  Auth:
    DefaultAuthorizer: OAuth2
    Authorizers:
      OAuth2:
        AuthorizationScopes:
          - scope4
        JwtConfiguration:
          issuer: "https://www.example.com/v1/connect/oauth2"
          audience:
            - MyApi
        IdentitySource: "$request.querystring.param"
```

### OpenAPI 定義を使用した HttpAPI
<a name="sam-resource-httpapi--examples--httpapi-with-openapi-definition"></a>

以下の例は、テンプレートに OpenAPI 定義を追加する方法を示しています。

は、この HTTP API を参照する HttpApi イベントの欠落している Lambda 統合 AWS SAM をすべて埋めることに注意してください。 は、HttpApi イベントが参照する欠落しているパス AWS SAM も追加します。

#### YAML
<a name="sam-resource-httpapi--examples--httpapi-with-openapi-definition--yaml"></a>

```
Properties:
  FailOnWarnings: true
  DefinitionBody:
    info:
      version: '1.0'
      title:
        Ref: AWS::StackName
    paths:
      "/":
        get:
          security:
          - OpenIdAuth:
            - scope1
            - scope2
          responses: {}
    openapi: 3.0.1
    securitySchemes:
      OpenIdAuth:
        type: openIdConnect
        x-amazon-apigateway-authorizer:
          identitySource: "$request.querystring.param"
          type: jwt
          jwtConfiguration:
            audience:
            - MyApi
            issuer: https://www.example.com/v1/connect/oidc
          openIdConnectUrl: https://www.example.com/v1/connect/oidc/.well-known/openid-configuration
```

### 構成設定を使用した HttpApi
<a name="sam-resource-httpapi--examples--httpapi-with-configuration-settings"></a>

以下の例は、テンプレートに HTTP API とステージ構成を追加する方法を示しています。

#### YAML
<a name="sam-resource-httpapi--examples--httpapi-with-configuration-settings--yaml"></a>

```
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Parameters:
  StageName:
    Type: String
    Default: Prod
    
Resources:
  HttpApiFunction:
    Type: AWS::Serverless::Function
    Properties:
      InlineCode: |
          def handler(event, context):
              import json
              return {
                  "statusCode": 200,
                  "body": json.dumps(event),
              }
      Handler: index.handler
      Runtime: python3.7
      Events:
        ExplicitApi: # warning: creates a public endpoint
          Type: HttpApi
          Properties:
            ApiId: !Ref HttpApi
            Method: GET
            Path: /path
            TimeoutInMillis: 15000
            PayloadFormatVersion: "2.0"
            RouteSettings:
              ThrottlingBurstLimit: 600

  HttpApi:
    Type: AWS::Serverless::HttpApi
    Properties:
      StageName: !Ref StageName
      Tags:
        Tag: Value
      AccessLogSettings:
        DestinationArn: !GetAtt AccessLogs.Arn
        Format: $context.requestId
      DefaultRouteSettings:
        ThrottlingBurstLimit: 200
      RouteSettings:
        "GET /path":
          ThrottlingBurstLimit: 500 # overridden in HttpApi Event
      StageVariables:
        StageVar: Value
      FailOnWarnings: true

  AccessLogs:
    Type: AWS::Logs::LogGroup

Outputs:
  HttpApiUrl:
    Description: URL of your API endpoint
    Value:
      Fn::Sub: 'https://${HttpApi}.execute-api.${AWS::Region}.${AWS::URLSuffix}/${StageName}/'
  HttpApiId:
    Description: Api id of HttpApi
    Value:
      Ref: HttpApi
```

# HttpApiAuth
<a name="sam-property-httpapi-httpapiauth"></a>

Amazon API Gateway HTTP API へのアクセスを制御するための認可を設定します。

HTTP API へのアクセス権の設定に関する詳細については、*API Gateway デベロッパーガイド*の「[API Gateway での HTTP API へのアクセスの制御と管理](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-access-control.html)」を参照してください。

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

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

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

```
  [Authorizers](#sam-httpapi-httpapiauth-authorizers): OAuth2Authorizer | LambdaAuthorizer
  [DefaultAuthorizer](#sam-httpapi-httpapiauth-defaultauthorizer): String
  [EnableIamAuthorizer](#sam-httpapi-httpapiauth-enableiamauthorizer): Boolean
```

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

 `Authorizers`   <a name="sam-httpapi-httpapiauth-authorizers"></a>
API Gateway API へのアクセスを制御するために使用されるオーソライザーです。  
*タイプ*: [OAuth2Authorizer](sam-property-httpapi-oauth2authorizer.md) \$1 [LambdaAuthorizer](sam-property-httpapi-lambdaauthorizer.md)  
*必須:* いいえ  
*デフォルト*: なし  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。  
*その他の注意事項*: OpenAPI 定義にオーソライザー AWS SAM を追加します。

 `DefaultAuthorizer`   <a name="sam-httpapi-httpapiauth-defaultauthorizer"></a>
API Gateway API に対する API コールの認証に使用するデフォルトのオーソライザーを指定します。`EnableIamAuthorizer` が `true` に設定されている場合、`AWS_IAM` をデフォルトの承認者として指定できます。それ以外の場合は、`Authorizers` で定義した承認者を指定します。  
*タイプ*: 文字列  
*必須:* いいえ  
*デフォルト*: なし  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `EnableIamAuthorizer`   <a name="sam-httpapi-httpapiauth-enableiamauthorizer"></a>
API ルートに IAM 認可を使用するかどうかを指定します。  
型: ブール  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

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

### OAuth 2.0 オーソライザー
<a name="sam-property-httpapi-httpapiauth--examples--oauth-2.0-authorizer"></a>

OAuth 2.0 オーソライザーの例

#### YAML
<a name="sam-property-httpapi-httpapiauth--examples--oauth-2.0-authorizer--yaml"></a>

```
Auth:
  Authorizers:
    OAuth2Authorizer:
      AuthorizationScopes:
        - scope1
        - scope2
      JwtConfiguration:
        issuer: "https://www.example.com/v1/connect/oauth2"
        audience:
          - MyApi
      IdentitySource: "$request.querystring.param"
  DefaultAuthorizer: OAuth2Authorizer
```

### IAM 承認者
<a name="sam-property-httpapi-httpapiauth--examples--iam-authorizer"></a>

IAM 承認者の例

#### YAML
<a name="sam-property-httpapi-httpapiauth--examples--iam-authorizer--yaml"></a>

```
Auth:
  EnableIamAuthorizer: true
  DefaultAuthorizer: AWS_IAM
```

# LambdaAuthorizer
<a name="sam-property-httpapi-lambdaauthorizer"></a>

 AWS Lambda 関数を使用して Amazon API Gateway HTTP API へのアクセスを制御するように Lambda オーソライザーを設定します。

詳細と例については、*API Gateway デベロッパーガイド*の[「HTTP API の AWS Lambda オーソライザーの使用 APIs](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-lambda-authorizer.html)」を参照してください。

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

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

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

```
  [AuthorizerPayloadFormatVersion](#sam-httpapi-lambdaauthorizer-authorizerpayloadformatversion): String
  EnableFunctionDefaultPermissions: Boolean
  [EnableSimpleResponses](#sam-httpapi-lambdaauthorizer-enablesimpleresponses): Boolean
  [FunctionArn](#sam-httpapi-lambdaauthorizer-functionarn): String
  [FunctionInvokeRole](#sam-httpapi-lambdaauthorizer-functioninvokerole): String
  [Identity](#sam-httpapi-lambdaauthorizer-identity): LambdaAuthorizationIdentity
```

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

 `AuthorizerPayloadFormatVersion`   <a name="sam-httpapi-lambdaauthorizer-authorizerpayloadformatversion"></a>
HTTP API Lambda オーソライザーに送信されるペイロードの形式を指定します。HTTP API Lambda オーソライザーに必要です。  
これは、OpenAPI 定義の `securitySchemes` セクションにある `x-amazon-apigateway-authorizer` の `authorizerPayloadFormatVersion` セクションに渡されます。  
*有効な値*: `1.0` または `2.0`  
*タイプ*: 文字列  
*必須*: はい  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `EnableFunctionDefaultPermissions`   <a name="sam-httpapi-lambdaauthorizer-enablefunctiondefaultpermissions"></a>
デフォルトでは、HTTP API リソースには Lambda オーソライザーを呼び出すための許可が付与されていません。HTTP API リソースと Lambda オーソライザーの間の許可を自動的に作成するには、このプロパティを `true` として指定します。  
型: ブール  
*必須:* いいえ  
*デフォルト値*: `false`  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、同等の CloudFormation ものはありません。

 `EnableSimpleResponses`   <a name="sam-httpapi-lambdaauthorizer-enablesimpleresponses"></a>
Lambda オーソライザーがシンプルな形式でレスポンスを返すかどうかを指定します。デフォルトでは、Lambda オーソライザーは AWS Identity and Access Management (IAM) ポリシーを返す必要があります。有効にした場合、Lambda オーソライザーは IAM ポリシーの代わりにブール値を返すことができます。  
これは、OpenAPI 定義の `securitySchemes` セクションにある `x-amazon-apigateway-authorizer` の `enableSimpleResponses` セクションに渡されます。  
型: ブール  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `FunctionArn`   <a name="sam-httpapi-lambdaauthorizer-functionarn"></a>
API の認可を提供する Lambda 関数の Amazon リソースネーム (ARN) です。  
これは、OpenAPI 定義の `securitySchemes` セクションにある `x-amazon-apigateway-authorizer` の `authorizerUri` セクションに渡されます。  
*タイプ*: 文字列  
*必須*: はい  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `FunctionInvokeRole`   <a name="sam-httpapi-lambdaauthorizer-functioninvokerole"></a>
API Gateway がオーソライザー関数を呼び出すために必要な認証情報を持つ IAM ロールの ARN です。このパラメータは、関数のリソースベースのポリシーが API Gateway に `lambda:InvokeFunction` 許可を付与しない場合に指定します。  
これは、OpenAPI 定義の `securitySchemes` セクションにある `x-amazon-apigateway-authorizer` の `authorizerCredentials` セクションに渡されます。  
詳細については、*API Gateway デベロッパーガイド*の「[Lambda オーソライザーの作成](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-lambda-authorizer.html#http-api-lambda-authorizer.example-create)」を参照してください。  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のプロパティはありません。

 `Identity`   <a name="sam-httpapi-lambdaauthorizer-identity"></a>
オーソライザーの受信リクエストに `IdentitySource` を指定します。  
これは、OpenAPI 定義の `securitySchemes` セクションにある `x-amazon-apigateway-authorizer` の `identitySource` セクションに渡されます。  
*タイプ*: [LambdaAuthorizationIdentity](sam-property-httpapi-lambdaauthorizationidentity.md)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

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

### LambdaAuthorizer
<a name="sam-property-httpapi-lambdaauthorizer--examples--lambdaauthorizer"></a>

LambdaAuthorizer の例

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

```
Auth:
  Authorizers:
    MyLambdaAuthorizer:
      AuthorizerPayloadFormatVersion: 2.0
      FunctionArn:
        Fn::GetAtt:
          - MyAuthFunction
          - Arn
      FunctionInvokeRole:
        Fn::GetAtt:
          - LambdaAuthInvokeRole
          - Arn
      Identity:
        Headers:
          - Authorization
```

# LambdaAuthorizationIdentity
<a name="sam-property-httpapi-lambdaauthorizationidentity"></a>

このプロパティは、Lambda オーソライザーの受信リクエストに IdentitySource を指定するために使用できます。アイデンティティソースの詳細については、*API Gateway デベロッパーガイド*の「[ID ソース](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-lambda-authorizer.html#http-api-lambda-authorizer.identity-sources)」を参照してください。

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

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

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

```
  [Context](#sam-httpapi-lambdaauthorizationidentity-context): List
  [Headers](#sam-httpapi-lambdaauthorizationidentity-headers): List
  [QueryStrings](#sam-httpapi-lambdaauthorizationidentity-querystrings): List
  [ReauthorizeEvery](#sam-httpapi-lambdaauthorizationidentity-reauthorizeevery): Integer
  [StageVariables](#sam-httpapi-lambdaauthorizationidentity-stagevariables): List
```

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

 `Context`   <a name="sam-httpapi-lambdaauthorizationidentity-context"></a>
所定のコンテキスト文字列を、`$context.contextString` 形式のマッピング式のリストに変換します。  
*タイプ*: リスト  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `Headers`   <a name="sam-httpapi-lambdaauthorizationidentity-headers"></a>
ヘッダーを、`$request.header.name` 形式のマッピング式のリストに変換します。  
*タイプ*: リスト  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `QueryStrings`   <a name="sam-httpapi-lambdaauthorizationidentity-querystrings"></a>
所定のクエリ文字列を、`$request.querystring.queryString` 形式のマッピング式のリストに変換します。  
*タイプ*: リスト  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `ReauthorizeEvery`   <a name="sam-httpapi-lambdaauthorizationidentity-reauthorizeevery"></a>
API Gateway がオーソライザー結果をキャッシュする時間を指定する有効期限 (TTL) (秒) です。0 より大きい値を指定する場合、API Gateway が認証レスポンスをキャッシュします。最大値は 3600、つまり 1 時間です。  
*タイプ*: 整数  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `StageVariables`   <a name="sam-httpapi-lambdaauthorizationidentity-stagevariables"></a>
所定のステージ変数を、`$stageVariables.stageVariable` 形式のマッピング式のリストに変換します。  
*タイプ*: リスト  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

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

### LambdaRequestIdentity
<a name="sam-property-httpapi-lambdaauthorizationidentity--examples--lambdarequestidentity"></a>

Lambda リクエストアイデンティティの例

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

```
Identity:
  QueryStrings:
    - auth
  Headers:
    - Authorization
  StageVariables:
    - VARIABLE
  Context:
    - authcontext
  ReauthorizeEvery: 100
```

# OAuth2Authorizer
<a name="sam-property-httpapi-oauth2authorizer"></a>

JSON Web トークン (JWT) オーソライザーとしても知られる OAuth 2.0 オーソライザーの定義です。

詳細については、*API Gateway デベロッパーガイド*の「[JWT オーソライザーを使用した HTTP API へのアクセスの制御](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-jwt-authorizer.html)」を参照してください。

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

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

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

```
  [AuthorizationScopes](#sam-httpapi-oauth2authorizer-authorizationscopes): List
  [IdentitySource](#sam-httpapi-oauth2authorizer-identitysource): String
  [JwtConfiguration](#sam-httpapi-oauth2authorizer-jwtconfiguration): Map
```

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

 `AuthorizationScopes`   <a name="sam-httpapi-oauth2authorizer-authorizationscopes"></a>
このオーソライザーの認可スコープのリストです。  
*タイプ*: リスト  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `IdentitySource`   <a name="sam-httpapi-oauth2authorizer-identitysource"></a>
このオーソライザーのアイデンティティソース式です。  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `JwtConfiguration`   <a name="sam-httpapi-oauth2authorizer-jwtconfiguration"></a>
このオーソライザーの JWT 設定です。  
これは、OpenAPI 定義の `securitySchemes` セクションにある `x-amazon-apigateway-authorizer` の `jwtConfiguration` セクションに渡されます。  
プロパティ `issuer` と `audience` は大文字と小文字を区別せず、OpenAPI のように小文字を使用することも、[ AWS::ApiGatewayV2::Authorizer](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigatewayv2-authorizer-jwtconfiguration.html) のように大文字の `Issuer` および `Audience` を使用することもできます。
*タイプ*: マップ  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

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

### OAuth 2.0 オーソライザー
<a name="sam-property-httpapi-oauth2authorizer--examples--oauth-2.0-authorizer"></a>

OAuth 2.0 オーソライザーの例

#### YAML
<a name="sam-property-httpapi-oauth2authorizer--examples--oauth-2.0-authorizer--yaml"></a>

```
Auth:
  Authorizers:
    OAuth2Authorizer:
      AuthorizationScopes:
        - scope1
      JwtConfiguration:
        issuer: "https://www.example.com/v1/connect/oauth2"
        audience:
          - MyApi
      IdentitySource: "$request.querystring.param"
  DefaultAuthorizer: OAuth2Authorizer
```

# HttpApiCorsConfiguration
<a name="sam-property-httpapi-httpapicorsconfiguration"></a>

HTTP API のクロスオリジンリソース共有 (CORS) を管理します。許可するドメインを文字列として指定するか、追加の CORS 設定でディクショナリを指定します。注意: CORS では OpenAPI 定義の変更に SAM が必要となるため、これが機能するのは `DefinitionBody` で Inline OpenApi が定義されている場合のみです。

CORS の詳細については、*API Gateway デベロッパーガイド*の「[HTTP API の CORS の設定](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-cors.html)」を参照してください。

注: HttpApiCorsConfiguration が OpenAPI とプロパティレベルの両方で設定されている場合、 はそれらのプロパティを優先して AWS SAM マージします。

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

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

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

```
  [AllowCredentials](#sam-httpapi-httpapicorsconfiguration-allowcredentials): Boolean
  [AllowHeaders](#sam-httpapi-httpapicorsconfiguration-allowheaders): List
  [AllowMethods](#sam-httpapi-httpapicorsconfiguration-allowmethods): List
  [AllowOrigins](#sam-httpapi-httpapicorsconfiguration-alloworigins): List
  [ExposeHeaders](#sam-httpapi-httpapicorsconfiguration-exposeheaders): List
  [MaxAge](#sam-httpapi-httpapicorsconfiguration-maxage): Integer
```

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

 `AllowCredentials`   <a name="sam-httpapi-httpapicorsconfiguration-allowcredentials"></a>
CORS リクエストに認証情報を含めるかどうかを指定します。  
型: ブール  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `AllowHeaders`   <a name="sam-httpapi-httpapicorsconfiguration-allowheaders"></a>
許可されるヘッダーのコレクションを表します。  
*タイプ*: リスト  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `AllowMethods`   <a name="sam-httpapi-httpapicorsconfiguration-allowmethods"></a>
許可される HTTP メソッドのコレクションを表します。  
*タイプ*: リスト  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `AllowOrigins`   <a name="sam-httpapi-httpapicorsconfiguration-alloworigins"></a>
許可されたオリジンのコレクションを表します。  
*タイプ*: リスト  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `ExposeHeaders`   <a name="sam-httpapi-httpapicorsconfiguration-exposeheaders"></a>
公開されたヘッダーのコレクションを表します。  
*タイプ*: リスト  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `MaxAge`   <a name="sam-httpapi-httpapicorsconfiguration-maxage"></a>
ブラウザがプリフライトリクエスト結果をキャッシュする秒数。  
*タイプ:* 整数  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

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

### HttpApiCorsConfiguration
<a name="sam-property-httpapi-httpapicorsconfiguration--examples--httpapicorsconfiguration"></a>

HTTP API Cors 設定の例です。

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

```
CorsConfiguration:
  AllowOrigins:
    - "https://example.com"
  AllowHeaders:
    - x-apigateway-header
  AllowMethods:
    - GET
  MaxAge: 600
  AllowCredentials: true
```

# HttpApiDefinition
<a name="sam-property-httpapi-httpapidefinition"></a>

API を定義する OpenAPI ドキュメントです。

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

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

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

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

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

 `Bucket`   <a name="sam-httpapi-httpapidefinition-bucket"></a>
OpenAPI ファイルが保存されている Amazon S3 バケットの名前です。  
*タイプ*: 文字列  
*必須*: はい  
*CloudFormation 互換性*: このプロパティは、 `AWS::ApiGatewayV2::Api` `BodyS3Location` データ型の `[Bucket](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigatewayv2-api-bodys3location.html#cfn-apigatewayv2-api-bodys3location-bucket)`プロパティに直接渡されます。

 `Key`   <a name="sam-httpapi-httpapidefinition-key"></a>
OpenAPI ファイルの Amazon S3 キーです。  
*タイプ*: 文字列  
*必須*: はい  
*CloudFormation 互換性*: このプロパティは、 `AWS::ApiGatewayV2::Api` `BodyS3Location` データ型の `[Key](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigatewayv2-api-bodys3location.html#cfn-apigatewayv2-api-bodys3location-key)`プロパティに直接渡されます。

 `Version`   <a name="sam-httpapi-httpapidefinition-version"></a>
バージョン管理されたオブジェクトの場合は、OpenAPI ファイルのバージョンです。  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::ApiGatewayV2::Api` `BodyS3Location` データ型の `[Version](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigatewayv2-api-bodys3location.html#cfn-apigatewayv2-api-bodys3location-version)`プロパティに直接渡されます。

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

### 定義 URI の例
<a name="sam-property-httpapi-httpapidefinition--examples--definition-uri-example"></a>

API 定義の例

#### YAML
<a name="sam-property-httpapi-httpapidefinition--examples--definition-uri-example--yaml"></a>

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

# HttpApiDomainConfiguration
<a name="sam-property-httpapi-httpapidomainconfiguration"></a>

API のカスタムドメインを設定します。

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

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

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

```
  [BasePath](#sam-httpapi-httpapidomainconfiguration-basepath): List
  [CertificateArn](#sam-httpapi-httpapidomainconfiguration-certificatearn): String
  [DomainName](#sam-httpapi-httpapidomainconfiguration-domainname): String
  [EndpointConfiguration](#sam-httpapi-httpapidomainconfiguration-endpointconfiguration): String
  [MutualTlsAuthentication](#sam-httpapi-httpapidomainconfiguration-mutualtlsauthentication): [MutualTlsAuthentication](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigatewayv2-domainname.html#cfn-apigatewayv2-domainname-mutualtlsauthentication)
  [OwnershipVerificationCertificateArn](#sam-httpapi-httpapidomainconfiguration-ownershipverificationcertificatearn): String
  [Route53](#sam-httpapi-httpapidomainconfiguration-route53): Route53Configuration
  [SecurityPolicy](#sam-httpapi-httpapidomainconfiguration-securitypolicy): String
```

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

 `BasePath`   <a name="sam-httpapi-httpapidomainconfiguration-basepath"></a>
Amazon API Gateway ドメイン名で設定する basepaths のリストです。  
*タイプ*: リスト  
*必須:* いいえ  
*デフォルト*: /  
*CloudFormation 互換性*: このプロパティは、 `AWS::ApiGatewayV2::ApiMapping` resource. AWS SAM creates の `[ApiMappingKey](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigatewayv2-apimapping.html#cfn-apigatewayv2-apimapping-apimappingkey)` プロパティに似ています。このプロパティで指定された値ごとに 1 つずつ、複数の`AWS::ApiGatewayV2::ApiMapping`リソースを作成します。

 `CertificateArn`   <a name="sam-httpapi-httpapidomainconfiguration-certificatearn"></a>
このドメイン名のエンドポイントの AWS マネージド証明書の Amazon リソースネーム (ARN)。 は、サポートされている唯一のソース AWS Certificate Manager です。  
*タイプ*: 文字列  
*必須*: はい  
*CloudFormation 互換性*: このプロパティは、 `AWS::ApiGateway2::DomainName DomainNameConfiguration`リソースの `[CertificateArn](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigatewayv2-domainname-domainnameconfiguration.html#cfn-apigatewayv2-domainname-domainnameconfiguration-certificatearn)`プロパティに直接渡されます。

 `DomainName`   <a name="sam-httpapi-httpapidomainconfiguration-domainname"></a>
API Gateway API のカスタムドメイン名です。大文字はサポートされていません。  
AWS SAM このプロパティが設定されると、 は `AWS::ApiGatewayV2::DomainName`リソースを生成します。このシナリオの詳細については、「[DomainName プロパティが指定されている](sam-specification-generated-resources-httpapi.md#sam-specification-generated-resources-httpapi-domain-name)」を参照してください。生成された CloudFormation リソースの詳細については、「」を参照してください[の生成済み CloudFormation リソース AWS SAM](sam-specification-generated-resources.md)。  
*タイプ*: 文字列  
*必須*: はい  
*CloudFormation 互換性*: このプロパティは、 `AWS::ApiGateway2::DomainName`リソースの `[DomainName](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigatewayv2-domainname.html#cfn-apigatewayv2-domainname-domainname)`プロパティに直接渡されます。

 `EndpointConfiguration`   <a name="sam-httpapi-httpapidomainconfiguration-endpointconfiguration"></a>
カスタムドメインにマップする API Gateway エンドポイントのタイプを定義します。このプロパティの値は、`CertificateArn`プロパティのマッピング方法を決定します CloudFormation。  
HTTP API に有効な値は `REGIONAL` のみです。  
*タイプ*: 文字列  
*必須:* いいえ  
*デフォルト*: `REGIONAL`  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `MutualTlsAuthentication`   <a name="sam-httpapi-httpapidomainconfiguration-mutualtlsauthentication"></a>
カスタムドメイン名の相互 Transport Layer Security (TLS) 認証設定です。  
*タイプ*: [MutualTlsAuthentication](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigatewayv2-domainname.html#cfn-apigatewayv2-domainname-mutualtlsauthentication)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::ApiGatewayV2::DomainName`リソースの `[MutualTlsAuthentication](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigatewayv2-domainname.html#cfn-apigatewayv2-domainname-mutualtlsauthentication)`プロパティに直接渡されます。

 `OwnershipVerificationCertificateArn`   <a name="sam-httpapi-httpapidomainconfiguration-ownershipverificationcertificatearn"></a>
カスタムドメインの所有権を検証するために ACM によって発行されたパブリック証明書の ARN。相互 TLS を設定し、ACM にインポートされた、またはプライベート CA 証明書の ARN を `CertificateArn` に指定する場合のみ必須です。  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::ApiGatewayV2::DomainName` `DomainNameConfiguration` データ型の `[OwnershipVerificationCertificateArn](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigatewayv2-domainname-domainnameconfiguration.html#cfn-apigatewayv2-domainname-domainnameconfiguration-ownershipverificationcertificatearn)`プロパティに直接渡されます。

 `Route53`   <a name="sam-httpapi-httpapidomainconfiguration-route53"></a>
Amazon Route 53 設定を定義します。  
*タイプ*: [Route53Configuration](sam-property-httpapi-route53configuration.md)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `SecurityPolicy`   <a name="sam-httpapi-httpapidomainconfiguration-securitypolicy"></a>
このドメイン名に対するセキュリティポリシーの TLS バージョンです。  
HTTP API に有効な値は `TLS_1_2` のみです。  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::ApiGatewayV2::DomainName` `DomainNameConfiguration` データ型の `[SecurityPolicy](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigatewayv2-domainname-domainnameconfiguration.html#cfn-apigatewayv2-domainname-domainnameconfiguration-securitypolicy)`プロパティに直接渡されます。

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

### DomainName
<a name="sam-property-httpapi-httpapidomainconfiguration--examples--domainname"></a>

DomainName の例

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

```
Domain:
  DomainName: www.example.com
  CertificateArn: arn-example
  EndpointConfiguration: REGIONAL
  Route53:
    HostedZoneId: Z1PA6795UKMFR9
  BasePath:
    - foo
    - bar
```

# Route53Configuration
<a name="sam-property-httpapi-route53configuration"></a>

API の Route53 レコードセットを設定します。

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

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

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

```
  [DistributionDomainName](#sam-httpapi-route53configuration-distributiondomainname): String
  [EvaluateTargetHealth](#sam-httpapi-route53configuration-evaluatetargethealth): Boolean
  [HostedZoneId](#sam-httpapi-route53configuration-hostedzoneid): String
  [HostedZoneName](#sam-httpapi-route53configuration-hostedzonename): String
  [IpV6](#sam-httpapi-route53configuration-ipv6): Boolean
  Region: String
  SetIdentifier: String
```

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

 `DistributionDomainName`   <a name="sam-httpapi-route53configuration-distributiondomainname"></a>
API カスタムドメイン名のカスタムディストリビューションを設定します。  
*タイプ*: 文字列  
*必須:* いいえ  
*デフォルト*: API Gateway ディストリビューションを使用します。  
*CloudFormation 互換性*: このプロパティは、 `AWS::Route53::RecordSetGroup AliasTarget`リソースの `[DNSName](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53-aliastarget-1.html#cfn-route53-aliastarget-dnshostname)`プロパティに直接渡されます。  
*その他の注意点*: [CloudFront ディストリビューション](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudfront-distribution.html)のドメイン名です。

 `EvaluateTargetHealth`   <a name="sam-httpapi-route53configuration-evaluatetargethealth"></a>
EvaluateTargetHealth が true の場合、エイリアスレコードは、Elastic Load Balancing ロードバランサーやホストゾーン内の別のレコードなど、参照される AWS リソースのヘルスを継承します。  
型: ブール  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Route53::RecordSetGroup AliasTarget`リソースの `[EvaluateTargetHealth](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53-aliastarget.html#cfn-route53-aliastarget-evaluatetargethealth)`プロパティに直接渡されます。  
*その他の注意点*: エイリアスターゲットが CloudFront ディストリビューションの場合は EvaluateTargetHealth を true に設定できません。

 `HostedZoneId`   <a name="sam-httpapi-route53configuration-hostedzoneid"></a>
レコードを作成するホストゾーンの ID です。  
`HostedZoneName` または `HostedZoneId` を指定します。両方を指定することはできません。同じドメイン名のホストゾーンが複数ある場合は、`HostedZoneId` を使用してホストゾーンを指定する必要があります。  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Route53::RecordSetGroup RecordSet`リソースの `[HostedZoneId](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53-recordset-1.html#cfn-route53-recordset-hostedzoneid)`プロパティに直接渡されます。

 `HostedZoneName`   <a name="sam-httpapi-route53configuration-hostedzonename"></a>
レコードを作成するホストゾーンの名前です。`HostedZoneName` の一部には、末尾のドット (`www.example.com.` など) を含める必要があります。  
`HostedZoneName` または `HostedZoneId` を指定します。両方を指定することはできません。同じドメイン名のホストゾーンが複数ある場合は、`HostedZoneId` を使用してホストゾーンを指定する必要があります。  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Route53::RecordSetGroup RecordSet`リソースの `[HostedZoneName](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53-recordset-1.html#cfn-route53-recordset-hostedzonename)`プロパティに直接渡されます。

 `IpV6`   <a name="sam-httpapi-route53configuration-ipv6"></a>
このプロパティが設定されると、 は`AWS::Route53::RecordSet`リソース AWS SAM を作成し、指定された HostedZone [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53-recordset.html#cfn-route53-recordset-type](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53-recordset.html#cfn-route53-recordset-type) `AAAA` のタイプを に設定します。  
型: ブール  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

`Region`  <a name="sam-httpapi-route53configuration-region"></a>
*レイテンシーベースのリソースレコードセットのみ:* このリソースレコードセットが参照するリソースを作成した Amazon EC2 リージョン。リソースは通常、EC2 インスタンスや ELB ロードバランサーなどの AWS リソースであり、レコードタイプに応じて IP アドレスまたは DNS ドメイン名によって参照されます。  
レイテンシーリソースレコードセットが作成されているドメインの名前や種類を要求する DNS クエリを受け取ると、Amazon Route 53 は、エンドユーザーとそのユーザーに関連付けられている Amazon EC2 リージョンとの間でレイテンシーが最も小さいレイテンシーリソースレコードセットを選択します。その後、Route 53 は、選択したリソースレコードセットに関連付けられている値を返します。  
次の点に注意してください。  
+ レイテンシーリソースレコードセットごとに 1 つの `ResourceRecord` のみ指定できます。
+ 作成できるレイテンシーリソースレコードセットは、各 Amazon EC2 リージョンにつき 1 つだけです。
+ すべての Amazon EC2 リージョンに対してレイテンシーリソースレコードセットを作成する必要はありません。レイテンシーリソースレコードセットを作成したリージョンの中から、レイテンシーの最も小さいリージョンが Route 53 によって選択されます。
+ レイテンシーリソースレコードセットリソースと `Name` および `Type` 要素の値が同じである非レイテンシーリソースレコードセットを作成することはできません。
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Route53::RecordSetGroup` `RecordSet` データ型の `[ Region](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53-recordset-1.html#cfn-route53-recordset-region)`プロパティに直接渡されます。

`SetIdentifier`  <a name="sam-httpapi-route53configuration-setidentifier"></a>
*シンプル以外のルーティングポリシーを持つリソースレコードセット:* タイプが A である acme.example.com という名前の複数の加重リソースレコードセットなど、名前とタイプの組み合わせが同じである複数のリソースレコードセットを区別する識別子。名前とタイプが同じであるリソースレコードセットのグループでは、リソースレコードセットごとに `SetIdentifier` の値が一意である必要があります。  
ルーティングポリシーの詳細については、「Amazon Route 53 デベロッパーガイド」の「[ルーティングポリシーの選択](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/routing-policy.html)」を参照してください。  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Route53::RecordSetGroup` `RecordSet` データ型の `[ SetIdentifier](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53-recordset-1.html#cfn-route53-recordset-setidentifier)`プロパティに直接渡されます。

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

### Route 53 設定の例
<a name="sam-property-httpapi-route53configuration--examples--route-53-configuration-example"></a>

この例は、Route 53 の設定方法を示しています。

#### YAML
<a name="sam-property-httpapi-route53configuration--examples--route-53-configuration-example--yaml"></a>

```
Domain:
  DomainName: www.example.com
  CertificateArn: arn-example
  EndpointConfiguration: EDGE
  Route53:
    HostedZoneId: Z1PA6795UKMFR9
    EvaluateTargetHealth: true
    DistributionDomainName: xyz
```

# AWS::Serverless::LayerVersion
<a name="sam-resource-layerversion"></a>

Lambda 関数に必要なライブラリまたはランタイムコードが含まれる Lambda LayerVersion を作成します。

[AWS::Serverless::LayerVersion](#sam-resource-layerversion) リソースは `Metadata`リソース属性もサポートしているため、アプリケーションに含まれるレイヤーを構築する AWS SAM ように に指示できます。レイヤーの構築に関する詳細については、「[での Lambda レイヤーの構築 AWS SAM](building-layers.md)」を参照してください。

**重要な注意**: で [UpdateReplacePolicy](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-updatereplacepolicy.html) リソース属性がリリースされたため CloudFormation、 [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-layerversion.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-layerversion.html) (推奨) には と同じ利点があります[AWS::Serverless::LayerVersion](#sam-resource-layerversion)。

サーバーレス LayerVersion が変換されると、SAM はリソースの論理 ID も変換し、リソースの更新時に CloudFormation によって古い LayerVersion が自動的に削除されないようにします。

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

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

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

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

```
Type: AWS::Serverless::LayerVersion
Properties:
  [CompatibleArchitectures](#sam-layerversion-compatiblearchitectures): List
  [CompatibleRuntimes](#sam-layerversion-compatibleruntimes): List
  [ContentUri](#sam-layerversion-contenturi): String | LayerContent
  [Description](#sam-layerversion-description): String
  [LayerName](#sam-layerversion-layername): String
  [LicenseInfo](#sam-layerversion-licenseinfo): String
  [PublishLambdaVersion](#sam-layerversion-PublishLambdaVersion): Boolean
  [RetentionPolicy](#sam-layerversion-retentionpolicy): String
```

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

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

 `CompatibleRuntimes`   <a name="sam-layerversion-compatibleruntimes"></a>
この LayerVersion との互換性のあるランタイムのリストです。  
*タイプ*: リスト  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::LayerVersion`リソースの `[CompatibleRuntimes](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-layerversion.html#cfn-lambda-layerversion-compatibleruntimes)`プロパティに直接渡されます。

 `ContentUri`   <a name="sam-layerversion-contenturi"></a>
Amazon S3 URI、ローカルフォルダーへのパス、またはレイヤーコードの LayerContent オブジェクトです。  
Amazon S3 URI または LayerContent オブジェクトが提供されている場合、参照される Amazon S3 オブジェクトは、[Lambda レイヤー](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)のコンテンツが含まれる有効な ZIP アーカイブである必要があります。  
ローカルフォルダへのパスが提供されている場合は、コンテンツが適切に変換されるようにするために、[sam build](sam-cli-command-reference-sam-build.md) が含まれ、その後に [sam deploy](sam-cli-command-reference-sam-deploy.md) または [sam package](sam-cli-command-reference-sam-package.md) が続くワークフローをテンプレートが実行する必要があります。デフォルトでは、相対パスは AWS SAM テンプレートの場所に関して解決されます。  
*タイプ*: 文字列 \$1 [LayerContent](sam-property-layerversion-layercontent.md)  
*必須:* はい  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::LayerVersion`リソースの `[Content](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-layerversion.html#cfn-lambda-layerversion-content)`プロパティに似ています。ネストされた Amazon S3 プロパティには異なる名前が付けられています。

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

 `LayerName`   <a name="sam-layerversion-layername"></a>
レイヤーの名前または Amazon リソースネーム (ARN) です。  
*タイプ*: 文字列  
*必須:* いいえ  
*デフォルト*: リソースの論理 ID  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::LayerVersion`リソースの `[LayerName](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-layerversion.html#cfn-lambda-layerversion-layername)`プロパティに似ています。名前を指定しない場合は、リソースの論理 ID が名前として使用されます。

 `LicenseInfo`   <a name="sam-layerversion-licenseinfo"></a>
この LayerVersion のライセンスに関する情報です。  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::LayerVersion`リソースの `[LicenseInfo](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-layerversion.html#cfn-lambda-layerversion-licenseinfo)`プロパティに直接渡されます。

 `PublishLambdaVersion`   <a name="sam-layerversion-PublishLambdaVersion"></a>
参照される `LayerVersion` リソースに変更があるたびに新しい Lambda バージョンを作成するオプトインプロパティ。接続された Lambda 関数 で `AutoPublishAlias` と `AutoPublishAliasAllProperties` を使用して有効にすると、`LayerVersion` リソースに行われる変更ごとに新しい Lambda バージョンが作成されます。  
型: ブール  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `RetentionPolicy`   <a name="sam-layerversion-retentionpolicy"></a>
このプロパティは、リソースを削除するときに `LayerVersion` の古いバージョンを保持するか削除するかを指定します。リソースを更新または置き換えるときに `LayerVersion` の古いバージョンを保持する必要がある場合は、 `UpdateReplacePolicy` 属性を有効にする必要があります。これを行う方法については、「*AWS CloudFormation ユーザーガイド*」の 「[`UpdateReplacePolicy` 属性](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-updatereplacepolicy.html)」を参照してください。  
*有効な値*: `Retain` または `Delete`  
タイプ：文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。  
*追加の注意*: を指定すると`Retain`、 は変換された`AWS::Lambda::LayerVersion`リソース`DeletionPolicy: Retain`に [でサポートされるリソース属性 AWS SAM](sam-specification-resource-attributes.md) の AWS SAM を追加します。

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

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

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

`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)」を参照してください。

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

### LayerVersionExample
<a name="sam-resource-layerversion--examples--layerversionexample"></a>

LayerVersion の例

#### YAML
<a name="sam-resource-layerversion--examples--layerversionexample--yaml"></a>

```
Properties:
  LayerName: MyLayer
  Description: Layer description
  ContentUri: 's3://sam-s3-demo-bucket/my-layer.zip'
  CompatibleRuntimes:
    - nodejs10.x
    - nodejs12.x
  LicenseInfo: 'Available under the MIT-0 license.'
  RetentionPolicy: Retain
```

# LayerContent
<a name="sam-property-layerversion-layercontent"></a>

[Lambda レイヤー](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)のコンテンツが含まれる ZIP アーカイブです。

## 構文
<a name="sam-property-layerversion-layercontent-syntax"></a>

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

### YAML
<a name="sam-property-layerversion-layercontent-syntax.yaml"></a>

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

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

 `Bucket`   <a name="sam-layerversion-layercontent-bucket"></a>
レイヤーアーカイブの Amazon S3 バケットです。  
*タイプ*: 文字列  
*必須*: はい  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::LayerVersion` `Content` データ型の `[S3Bucket](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-layerversion-content.html#cfn-lambda-layerversion-content-s3bucket)`プロパティに直接渡されます。

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

 `Version`   <a name="sam-layerversion-layercontent-version"></a>
バージョン管理されたオブジェクトの場合に使用する、レイヤーアーカイブオブジェクトのバージョンです。  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::Lambda::LayerVersion` `Content` データ型の `[S3ObjectVersion](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-layerversion-content.html#cfn-lambda-layerversion-content-s3objectversion)`プロパティに直接渡されます。

## 例
<a name="sam-property-layerversion-layercontent--examples"></a>

### LayerContent
<a name="sam-property-layerversion-layercontent--examples--layercontent"></a>

LayerContent の例

#### YAML
<a name="sam-property-layerversion-layercontent--examples--layercontent--yaml"></a>

```
LayerContent:
  Bucket: amzn-s3-demo-bucket-name
  Key: mykey-name
  Version: 121212
```

# AWS::Serverless::SimpleTable
<a name="sam-resource-simpletable"></a>

単一属性のプライマリキーで DynamoDB テーブルを作成します。これは、データへのアクセスがプライマリキー経由でのアクセスに限定されている場合に役立ちます。

より高度な機能については、 CloudFormationで [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dynamodb-table.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dynamodb-table.html) リソースを使用します。これらのリソースは AWS SAMで使用できます。これらは包括的であり、[https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-keyschema.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-keyschema.html) や [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-resourcepolicy.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-resourcepolicy.html) のカスタマイズなど、さらなるカスタマイズを提供します。

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

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

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

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

```
Type: AWS::Serverless::SimpleTable
Properties:
  PointInTimeRecoverySpecification: [PointInTimeRecoverySpecification](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-pointintimerecoveryspecification.html)
  [PrimaryKey](#sam-simpletable-primarykey): PrimaryKeyObject
  [ProvisionedThroughput](#sam-simpletable-provisionedthroughput): ProvisionedThroughputObject
  [SSESpecification](#sam-simpletable-ssespecification): [SSESpecification](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-ssespecification.html)
  [TableName](#sam-simpletable-tablename): String
  [Tags](#sam-simpletable-tags): Map
```

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

 `PointInTimeRecoverySpecification`   <a name="sam-simpletable-pointintimerecoveryspecification"></a>
ポイントインタイムリカバリを有効にするための設定。  
*タイプ*: [PointInTimeRecoverySpecification](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-pointintimerecoveryspecification.html)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::DynamoDB::Table`リソースの `[PointInTimeRecoverySpecification](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-pointintimerecoveryspecification.html)`プロパティに直接渡されます。

 `PrimaryKey`   <a name="sam-simpletable-primarykey"></a>
テーブルのプライマリキーとして使用される属性の名前とタイプです。指定しない場合、プライマリキーは値が `id` の `String` になります。  
このプロパティの値は、このリソースが作成された後で変更することはできません。
*タイプ*: [PrimaryKeyObject](sam-property-simpletable-primarykeyobject.md)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `ProvisionedThroughput`   <a name="sam-simpletable-provisionedthroughput"></a>
読み取りおよび書き込みスループットのプロビジョニング情報です。  
`ProvisionedThroughput` が指定されていない場合、`BillingMode` は `PAY_PER_REQUEST` として指定されます。  
*タイプ*: [ProvisionedThroughputObject](sam-property-simpletable-provisionedthroughputobject.md)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::DynamoDB::Table`リソースの `[ProvisionedThroughput](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-provisionedthroughput.html)`プロパティに直接渡されます。

 `SSESpecification`   <a name="sam-simpletable-ssespecification"></a>
サーバー側の暗号化を有効にする設定を指定します。  
*タイプ*: [SSESpecification](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-ssespecification.html)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::DynamoDB::Table`リソースの `[SSESpecification](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-ssespecification.html)`プロパティに直接渡されます。

 `TableName`   <a name="sam-simpletable-tablename"></a>
DynamoDB テーブルの名前です。  
*型*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::DynamoDB::Table`リソースの `[TableName](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dynamodb-table.html#cfn-dynamodb-table-tablename)`プロパティに直接渡されます。

 `Tags`   <a name="sam-simpletable-tags"></a>
この SimpleTable に追加されるタグを指定するマップ (文字列対文字列) です。タグの有効なキーと値の詳細については、*AWS CloudFormation ユーザーガイド*の[リソースタグ](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html)を参照してください。  
*タイプ*: マップ  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::DynamoDB::Table`リソースの `[Tags](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dynamodb-table.html#cfn-dynamodb-table-tags)`プロパティに似ています。SAM の Tags プロパティは、キーバリューペアで構成されています。CloudFormation では、タグオブジェクトのリストで構成されています。

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

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

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

`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)」を参照してください。

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

### SimpleTableExample
<a name="sam-resource-simpletable--examples--simpletableexample"></a>

SimpleTable の例

#### YAML
<a name="sam-resource-simpletable--examples--simpletableexample--yaml"></a>

```
Properties:
  TableName: my-table
  PrimaryKey:
    Name: MyPrimaryKey
    Type: String
  ProvisionedThroughput:
    ReadCapacityUnits: 5
    WriteCapacityUnits: 5
  Tags:
    Department: Engineering
    AppType: Serverless
```

# PrimaryKeyObject
<a name="sam-property-simpletable-primarykeyobject"></a>

プライマリキーのプロパティを説明するオブジェクトです。

## 構文
<a name="sam-property-simpletable-primarykeyobject-syntax"></a>

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

### YAML
<a name="sam-property-simpletable-primarykeyobject-syntax.yaml"></a>

```
  [Name](#sam-simpletable-primarykeyobject-name): String
  [Type](#sam-simpletable-primarykeyobject-type): String
```

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

 `Name`   <a name="sam-simpletable-primarykeyobject-name"></a>
プライマリキーの属性名です。  
*タイプ*: 文字列  
*必須*: はい  
*CloudFormation 互換性*: このプロパティは、 `AWS::DynamoDB::Table` `AttributeDefinition` データ型の `[AttributeName](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-attributedef.html#cfn-dynamodb-attributedef-attributename)`プロパティに直接渡されます。  
*その他の注意点*: このプロパティは、`AWS::DynamoDB::Table KeySchema` データ型の [AttributeName](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-keyschema.html#aws-properties-dynamodb-keyschema-attributename) プロパティにも渡されます。

 `Type`   <a name="sam-simpletable-primarykeyobject-type"></a>
プライマリキーのデータ型です。  
有効な値: `String`、`Number`、`Binary`  
*タイプ*: 文字列  
*必須*: はい  
*CloudFormation 互換性*: このプロパティは、 `AWS::DynamoDB::Table` `AttributeDefinition` データ型の `[AttributeType](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-attributedef.html#cfn-dynamodb-attributedef-attributename-attributetype)`プロパティに直接渡されます。

## 例
<a name="sam-property-simpletable-primarykeyobject--examples"></a>

### PrimaryKey
<a name="sam-property-simpletable-primarykeyobject--examples--primarykey"></a>

プライマリキーの例です。

#### YAML
<a name="sam-property-simpletable-primarykeyobject--examples--primarykey--yaml"></a>

```
Properties:
  PrimaryKey:
    Name: MyPrimaryKey
    Type: String
```

# ProvisionedThroughputObject
<a name="sam-property-simpletable-provisionedthroughputobject"></a>

プロビジョニングされたスループットのプロパティを記述するオブジェクト。

## 構文
<a name="sam-property-simpletable-provisionedthroughputobject-syntax"></a>

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

### YAML
<a name="w2aac13c22c41c19b5b5"></a>

```
  [ReadCapacityUnits](#sam-simpletable-provisionedthroughputobject-readcapacityunits): Integer
  [WriteCapacityUnits](#sam-simpletable-provisionedthroughputobject-writecapacityunits): Integer
```

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

 `ReadCapacityUnits`   <a name="sam-simpletable-provisionedthroughputobject-readcapacityunits"></a>
1 秒間に消費される強力な整合性のある読み取りの最大数。この最大数を超えると、DynamoDB が `ThrottlingException` を返します。  
*タイプ:* 整数  
*必須:* はい  
*CloudFormation 互換性*: このプロパティは、 `AWS::DynamoDB::Table` `ProvisionedThroughput` データ型の `[ReadCapacityUnits](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-provisionedthroughput.html#aws-properties-dynamodb-table-provisionedthroughput-properties)`プロパティに直接渡されます。

 `WriteCapacityUnits`   <a name="sam-simpletable-provisionedthroughputobject-writecapacityunits"></a>
1 秒間に消費される書き込みの最大数。この最大数を超えると、DynamoDB が `ThrottlingException` を返します。  
*タイプ:* 整数  
*必須:* はい  
*CloudFormation 互換性*: このプロパティは、 `AWS::DynamoDB::Table` `ProvisionedThroughput` データ型の `[WriteCapacityUnits](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-provisionedthroughput.html#aws-properties-dynamodb-table-provisionedthroughput-properties)`プロパティに直接渡されます。

## 例
<a name="sam-property-simpletable-provisionedthroughputobject--examples"></a>

### ProvisionedThroughput
<a name="sam-property-simpletable-provisionedthroughputobject--examples--provisionedthroughput"></a>

プロビジョニングされたスループットの例。

#### YAML
<a name="sam-property-simpletable-provisionedthroughputobject--examples--provisionedthroughput--yaml"></a>

```
Properties:
   ProvisionedThroughput:
     ReadCapacityUnits: 5
     WriteCapacityUnits: 5
```

# AWS::Serverless::StateMachine
<a name="sam-resource-statemachine"></a>

 AWS Step Functions ステートマシンを作成します。ステートマシンを使用して、 AWS Lambda 関数やその他の AWS リソースをオーケストレーションし、複雑で堅牢なワークフローを形成できます。

Step Functions の詳細については、[AWS Step Functions デベロッパーガイド](https://docs.aws.amazon.com/step-functions/latest/dg/welcome.html)を参照してください。

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

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

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

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

```
Type: AWS::Serverless::StateMachine
Properties:
  AutoPublishAlias: String
  UseAliasAsEventTarget: Boolean
  [Definition](#sam-statemachine-definition): Map
  [DefinitionSubstitutions](#sam-statemachine-definitionsubstitutions): Map
  [DefinitionUri](#sam-statemachine-definitionuri): String | [S3Location](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-stepfunctions-statemachine.html#cfn-stepfunctions-statemachine-definitions3location)
  DeploymentPreference: [DeploymentPreference](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-stepfunctions-statemachinealias-deploymentpreference.html)
  [Events](#sam-statemachine-events): EventSource
  [Logging](#sam-statemachine-logging): [LoggingConfiguration](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-stepfunctions-statemachine.html#cfn-stepfunctions-statemachine-loggingconfiguration)
  [Name](#sam-statemachine-name): String
  [PermissionsBoundary](#sam-statemachine-permissionsboundary): String
  [Policies](#sam-statemachine-policies): String | List | Map
  PropagateTags: Boolean
  [RolePath](#sam-statemachine-rolepath): String
  [Role](#sam-statemachine-role): String
  [Tags](#sam-statemachine-tags): Map
  [Tracing](#sam-statemachine-tracing): [TracingConfiguration](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-stepfunctions-statemachine.html#cfn-stepfunctions-statemachine-tracingconfiguration)
  [Type](#sam-statemachine-type): String
```

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

 `AutoPublishAlias`   <a name="sam-statemachine-autopublishalias"></a>
ステートマシンエイリアスの名前です。Step Functions ステートマシンエイリアスの使用に関する詳細については、「AWS Step Functions デベロッパーガイド」の「[Versions and Aliases を使用して継続的なデプロイを管理する](https://docs.aws.amazon.com/step-functions/latest/dg/concepts-cd-aliasing-versioning.html)」を参照してください。  
`DeploymentPreference` を使用して、エイリアスのデプロイ設定を実行します。を指定しない場合`DeploymentPreference`、 AWS SAM は新しいステートマシンバージョンに一度に移行するようにトラフィックを設定します。  
AWS SAM は、`Retain`デフォルトでバージョンの `DeletionPolicy`と `UpdateReplacePolicy`を に設定します。以前のバージョンは自動的に削除されません。  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::StepFunctions::StateMachineAlias`リソースの ` [ Name](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-stepfunctions-statemachinealias.html#cfn-stepfunctions-statemachinealias-name)`プロパティに直接渡されます。

 `UseAliasAsEventTarget`   <a name="sam-statemachine-usealiasaseventtarget"></a>
`AutoPublishAlias` プロパティを使用して作成されたエイリアスを、[Events](#sam-statemachine-events)として定義されたイベントソースのターゲットに渡すかどうかを指定します。  
エイリアスをイベントのターゲットとして使用するには、`True` を指定します。  
型: ブール  
*必須:* いいえ  
*デフォルト*: `False`  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `Definition`   <a name="sam-statemachine-definition"></a>
ステートマシン定義は オブジェクトで、オブジェクトの形式は JSON や YAML などの AWS SAM テンプレートファイルの形式と一致します。ステートマシンの定義は、[Amazon States Language](https://docs.aws.amazon.com/step-functions/latest/dg/concepts-amazon-states-language.html) に準拠しています。  
インラインステートマシンの定義例については、「[例](#sam-resource-statemachine--examples)」を参照してください。  
`Definition` または `DefinitionUri` を提供する必要があります。  
*タイプ*: マップ  
*必須*: 条件に応じて異なります  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のプロパティはありません。

 `DefinitionSubstitutions`   <a name="sam-statemachine-definitionsubstitutions"></a>
ステートマシン定義内のプレースホルダー変数のマッピングを指定する文字列対文字列のマップです。これは、実行時に取得した値 (組み込み関数からの値など) をステートマシン定義に挿入できるようにします。  
*タイプ*: マップ  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::StepFunctions::StateMachine`リソースの `[DefinitionSubstitutions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-stepfunctions-statemachine.html#cfn-stepfunctions-statemachine-definitionsubstitutions)`プロパティに似ています。インラインステートマシン定義で組み込み関数が指定されている場合、 はこのプロパティにエントリ AWS SAM を追加してステートマシン定義に挿入します。

 `DefinitionUri`   <a name="sam-statemachine-definitionuri"></a>
[Amazon States Language](https://docs.aws.amazon.com/step-functions/latest/dg/concepts-amazon-states-language.html) で記述されたステートマシン定義の Amazon Simple Storage Service (Amazon S3) URI またはローカルファイルパスです。  
ローカルファイルパスを指定する場合は、定義が適切に変換されるようにするために、テンプレートが `sam deploy` または `sam package` コマンドを含むワークフローを実行する必要があります。これを行うには、バージョン 0.52.0 以降の AWS SAM CLI を使用する必要があります。  
`Definition` または `DefinitionUri` を提供する必要があります。  
*タイプ*: 文字列 \$1 [S3Location](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-stepfunctions-statemachine.html#cfn-stepfunctions-statemachine-definitions3location)  
*必須*: 条件に応じて異なります  
*CloudFormation 互換性*: このプロパティは、 `AWS::StepFunctions::StateMachine`リソースの `[DefinitionS3Location](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-stepfunctions-statemachine.html#cfn-stepfunctions-statemachine-definitions3location)`プロパティに直接渡されます。

 `DeploymentPreference`   <a name="sam-statemachine-deploymentpreference"></a>
段階的なステートマシンデプロイを有効化して設定する設定です。Step Functions の段階的なデプロイに関する詳細については、「*AWS Step Functions Developer Guide*」の「[ Manage continuous deployments with versions and aliases](https://docs.aws.amazon.com/step-functions/latest/dg/concepts-cd-aliasing-versioning.html)」を参照してください。  
このプロパティを設定する前に、`AutoPublishAlias` を指定してください。`DeploymentPreference` 設定は、`AutoPublishAlias` で指定されたエイリアスに適用されます。  
を指定すると`DeploymentPreference`、 は`StateMachineVersionArn`サブプロパティ値を自動的に AWS SAM 生成します。  
*タイプ*: [DeploymentPreference](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-stepfunctions-statemachinealias-deploymentpreference.html)  
*必須:* いいえ  
*CloudFormation compatibility*: `StateMachineVersionArn`プロパティ値 AWS SAM を生成して にアタッチ`DeploymentPreference`し、 `AWS::StepFunctions::StateMachineAlias`リソースの `[DeploymentPreference](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-stepfunctions-statemachinealias.html#cfn-stepfunctions-statemachinealias-deploymentpreference)`プロパティ`DeploymentPreference`に渡します。

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

 `Logging`   <a name="sam-statemachine-logging"></a>
どの実行履歴イベントがどこにログされるかを定義します。  
*タイプ*: [LoggingConfiguration](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-stepfunctions-statemachine.html#cfn-stepfunctions-statemachine-loggingconfiguration)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::StepFunctions::StateMachine`リソースの `[LoggingConfiguration](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-stepfunctions-statemachine.html#cfn-stepfunctions-statemachine-loggingconfiguration)`プロパティに直接渡されます。

 `Name`   <a name="sam-statemachine-name"></a>
ステートマシンの名前です。  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::StepFunctions::StateMachine`リソースの `[StateMachineName](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-stepfunctions-statemachine.html#cfn-stepfunctions-statemachine-statemachinename)`プロパティに直接渡されます。

 `PermissionsBoundary`   <a name="sam-statemachine-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-statemachine-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 SAM であり、 CloudFormation 同等のものはありません。

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

 `Role`   <a name="sam-statemachine-role"></a>
このステートマシンの実行ロールとして使用する IAM ロールの ARN です。  
*タイプ*: 文字列  
*必須*: 条件に応じて異なります  
*CloudFormation 互換性*: このプロパティは、 `AWS::StepFunctions::StateMachine`リソースの `[ RoleArn](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-stepfunctions-statemachine.html#cfn-stepfunctions-statemachine-rolearn)`プロパティに直接渡されます。

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

 `Tags`   <a name="sam-statemachine-tags"></a>
ステートマシンと対応する実行ロールに追加されるタグを指定する文字列対文字列マップです。タグの有効なキーと値についての情報は、[https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-stepfunctions-statemachine.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-stepfunctions-statemachine.html) リソースの [Tags](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-stepfunctions-statemachine.html#cfn-stepfunctions-statemachine-tags) プロパティを参照してください。  
*タイプ*: マップ  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::StepFunctions::StateMachine` resource の `[Tags](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-stepfunctions-statemachine.html#cfn-stepfunctions-statemachine-tags)` プロパティに似ています。 は、このリソースと、それに対して生成されるデフォルトのロールに`stateMachine:createdBy:SAM`タグ AWS SAM を自動的に追加します。

 `Tracing`   <a name="sam-statemachine-tracing"></a>
ステートマシンで AWS X-Ray を有効にするかどうかを選択します。X-Ray の Step Functions との使用に関する詳細については、*AWS Step Functions デベロッパーガイド*の「[AWS X-Ray and Step Functions](https://docs.aws.amazon.com/step-functions/latest/dg/concepts-xray-tracing.html)」を参照してください。  
*タイプ*: [TracingConfiguration](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-stepfunctions-statemachine.html#cfn-stepfunctions-statemachine-tracingconfiguration)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::StepFunctions::StateMachine`リソースの `[TracingConfiguration](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-stepfunctions-statemachine.html#cfn-stepfunctions-statemachine-tracingconfiguration)`プロパティに直接渡されます。

 `Type`   <a name="sam-statemachine-type"></a>
ステートマシンのタイプです。  
*有効な値*: `STANDARD` または `EXPRESS`  
タイプ：文字列  
*必須:* いいえ  
*デフォルト*: `STANDARD`  
*CloudFormation 互換性*: このプロパティは、 `AWS::StepFunctions::StateMachine`リソースの `[StateMachineType](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-stepfunctions-statemachine.html#cfn-stepfunctions-statemachine-statemachinetype)`プロパティに直接渡されます。

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

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

このリソースの論理 ID を Ref 組み込み関数に提供すると、Ref は基盤となる `AWS::StepFunctions::StateMachine` リソースの Amazon リソースネーム (ARN) を返します。

`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-statemachine-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)」を参照してください。

`Name`  <a name="Name-fn::getatt"></a>
ステートマシンの名前 (`HelloWorld-StateMachine` など) を返します。

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

### ステートマシン定義ファイル
<a name="sam-resource-statemachine--examples--state-machine-definition-file"></a>

以下は、Lambda 関数によるステートマシンの呼び出しを許可するインラインステートマシン定義の例です。この例では、呼び出しを許可する適切なポリシーが `Role` プロパティで設定されることを想定している点に注意してください。`my_state_machine.asl.json` ファイルは [Amazon States Language](https://docs.aws.amazon.com/step-functions/latest/dg/concepts-amazon-states-language.html) で記述される必要があります。

この例では、`DefinitionSubstitution`エントリにより、ステートマシンは AWS SAM テンプレートファイルに宣言されたリソースを含めることができます。

#### YAML
<a name="sam-resource-statemachine--examples--state-machine-definition-file--yaml"></a>

```
MySampleStateMachine:
  Type: AWS::Serverless::StateMachine
  Properties:
    DefinitionUri: statemachine/my_state_machine.asl.json
    Role: arn:aws:iam::123456123456:role/service-role/my-sample-role
    Tracing:
      Enabled: true
    DefinitionSubstitutions:
      MyFunctionArn: !GetAtt MyFunction.Arn
      MyDDBTable: !Ref TransactionTable
```

### インラインステートマシン定義
<a name="sam-resource-statemachine--examples--inline-state-machine-definition"></a>

以下は、インラインステートマシン定義の例です。

この例では、 AWS SAM テンプレートファイルは YAML で書き込まれるため、ステートマシン定義も YAML にあります。インラインステートマシン定義を JSON で宣言するには、 AWS SAM テンプレートファイルを JSON で書き込みます。

#### YAML
<a name="sam-resource-statemachine--examples--inline-state-machine-definition--yaml"></a>

```
MySampleStateMachine:
  Type: AWS::Serverless::StateMachine
  Properties:
    Definition:
      StartAt: MyLambdaState
      States:
        MyLambdaState:
          Type: Task
          Resource: arn:aws:lambda:us-east-1:123456123456:function:my-sample-lambda-app
          End: true
    Role: arn:aws:iam::123456123456:role/service-role/my-sample-role
    Tracing:
      Enabled: true
```

# EventSource
<a name="sam-property-statemachine-statemachineeventsource"></a>

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

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

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

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

```
  [Properties](#sam-statemachine-statemachineeventsource-properties): Schedule | ScheduleV2 | CloudWatchEvent | EventBridgeRule | Api
  [Type](#sam-statemachine-statemachineeventsource-type): String
```

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

 `Properties`   <a name="sam-statemachine-statemachineeventsource-properties"></a>
このイベントマッピングのプロパティを説明するオブジェクトです。プロパティのセットは、定義された `Type` に準拠する必要があります。  
タイプ: [Schedule](sam-property-statemachine-statemachineschedule.md) \$1 [ScheduleV2](sam-property-statemachine-statemachineschedulev2.md) \$1 [CloudWatchEvent](sam-property-statemachine-statemachinecloudwatchevent.md) \$1 [EventBridgeRule](sam-property-statemachine-statemachineeventbridgerule.md) \$1 [Api](sam-property-statemachine-statemachineapi.md)  
*必須:* はい  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のプロパティはありません。

 `Type`   <a name="sam-statemachine-statemachineeventsource-type"></a>
イベントタイプです。  
有効な値: `Api`、`Schedule`、`ScheduleV2`、`CloudWatchEvent`、`EventBridgeRule`  
*タイプ*: 文字列  
*必須*: はい  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

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

### API
<a name="sam-property-statemachine-statemachineeventsource--examples--api"></a>

以下は、`API` タイプのイベントの例です。

#### YAML
<a name="sam-property-statemachine-statemachineeventsource--examples--api--yaml"></a>

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

# Api
<a name="sam-property-statemachine-statemachineapi"></a>

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

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

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

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

```
  [Auth](#sam-statemachine-statemachineapi-auth): ApiStateMachineAuth
  [Method](#sam-statemachine-statemachineapi-method): String
  [Path](#sam-statemachine-statemachineapi-path): String
  [RestApiId](#sam-statemachine-statemachineapi-restapiid): String
  UnescapeMappingTemplate: Boolean
```

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

 `Auth`   <a name="sam-statemachine-statemachineapi-auth"></a>
この API、パス、およびメソッドの認可設定です。  
このプロパティを使用して、`DefaultAuthorizer` が指定されていない場合、またはデフォルトの `ApiKeyRequired` 設定を上書きするために、個々のパスに対する API の `DefaultAuthorizer` 設定を上書きします。  
*タイプ*: [ApiStateMachineAuth](sam-property-statemachine-apistatemachineauth.md)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `Method`   <a name="sam-statemachine-statemachineapi-method"></a>
この関数が呼び出される HTTP メソッドです。  
*タイプ*: 文字列  
*必須*: はい  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

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

 `RestApiId`   <a name="sam-statemachine-statemachineapi-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 同等のものはありません。

 `UnescapeMappingTemplate`   <a name="sam-statemachine-statemachineapi-unescapemappingtemplate"></a>
`\'` を `'` に置き換えて、ステートマシンに渡される入力の一重引用符のエスケープを解除します。入力に一重引用符が含まれている場合に使用します。  
`False` に設定し、入力に一重引用符が含まれている場合、エラーが発生します。
型: ブール  
*必須:* いいえ  
*デフォルト*: False  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、同等の CloudFormation ものはありません。

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

### ApiEvent
<a name="sam-property-statemachine-statemachineapi--examples--apievent"></a>

以下は、`Api` タイプのイベントの例です。

#### YAML
<a name="sam-property-statemachine-statemachineapi--examples--apievent--yaml"></a>

```
Events:
  ApiEvent:
    Type: Api
    Properties:
      Path: /path
      Method: get
```

# ApiStateMachineAuth
<a name="sam-property-statemachine-apistatemachineauth"></a>

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

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

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

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

```
  [ApiKeyRequired](#sam-statemachine-apistatemachineauth-apikeyrequired): Boolean
  [AuthorizationScopes](#sam-statemachine-apistatemachineauth-authorizationscopes): List
  [Authorizer](#sam-statemachine-apistatemachineauth-authorizer): String
  [ResourcePolicy](#sam-statemachine-apistatemachineauth-resourcepolicy): ResourcePolicyStatement
```

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

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

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

 `Authorizer`   <a name="sam-statemachine-apistatemachineauth-authorizer"></a>
特定のステートマシンの `Authorizer` です。  
API のグローバルオーソライザーが指定されているときにこのステートマシンを公開したい場合は、`Authorizer` を `NONE` に設定してグローバルオーソライザーを上書きします。  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

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

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

### Statemachine-Auth
<a name="sam-property-statemachine-apistatemachineauth--examples--statemachine-auth"></a>

以下の例は、ステートマシンレベルで認可を指定します。

#### YAML
<a name="sam-property-statemachine-apistatemachineauth--examples--statemachine-auth--yaml"></a>

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

#### YAML
<a name="sam-property-statemachine-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
```

# CloudWatchEvent
<a name="sam-property-statemachine-statemachinecloudwatchevent"></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-statemachine-statemachineeventbridgerule.md)は、 の代わりに使用する優先イベントソースタイプです`CloudWatchEvent`。 `EventBridgeRule`および は、同じ基盤となるサービス、API、 CloudFormation リソース`CloudWatchEvent`を使用します。ただし、 AWS SAM は新機能のサポートを にのみ追加します`EventBridgeRule`。

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

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

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

```
  [EventBusName](#sam-statemachine-statemachinecloudwatchevent-eventbusname): String
  [Input](#sam-statemachine-statemachinecloudwatchevent-input): String
  [InputPath](#sam-statemachine-statemachinecloudwatchevent-inputpath): String
  [Pattern](#sam-statemachine-statemachinecloudwatchevent-pattern): [EventPattern](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-rule.html#cfn-events-rule-eventpattern)
```

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

# DeadLetterConfig
<a name="sam-property-statemachine-statemachinedeadletterconfig"></a>

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

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

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

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

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

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

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

 `Type`   <a name="sam-statemachine-statemachinedeadletterconfig-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-statemachine-statemachinedeadletterconfig--examples"></a>

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

DeadLetterConfig

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

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

# Target
<a name="sam-property-statemachine-statemachinetarget"></a>

ルールがトリガーされたときに EventBridge が呼び出す AWS リソースを設定します。

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

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

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

```
  [Id](#sam-statemachine-statemachinetarget-id): String
```

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

 `Id`   <a name="sam-statemachine-statemachinetarget-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-statemachine-statemachinetarget--examples"></a>

### ターゲット
<a name="sam-property-statemachine-statemachinetarget--examples--target"></a>

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

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

# Schedule
<a name="sam-property-statemachine-statemachineschedule"></a>

`Schedule` イベントソースタイプを説明するオブジェクトです。これは、ステートマシンをスケジュールに従ってトリガーする EventBridge ルールのターゲットとして設定します。詳細については、*Amazon EventBridge ユーザーガイド*の「[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)リソースを生成します。

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

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

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

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

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

 `DeadLetterConfig`   <a name="sam-statemachine-statemachineschedule-deadletterconfig"></a>
ターゲットの呼び出しに失敗した後で EventBridge がイベントを送信する Amazon Simple Queue Service (Amazon SQS) キューを設定します。呼び出しは、存在しない Lambda 関数にイベントを送信した場合、または Lambda 関数を呼び出すために十分な許可が EventBridge にない場合などに失敗します。詳細については、*Amazon EventBridge ユーザーガイド*の「[Event retry policy and using dead-letter queues](https://docs.aws.amazon.com/eventbridge/latest/userguide/rule-dlq.html)」を参照してください。  
*タイプ*: [DeadLetterConfig](sam-property-statemachine-statemachinescheduledeadletterconfig.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-statemachine-statemachineschedule-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-statemachine-statemachineschedule-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-statemachine-statemachineschedule-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-statemachine-statemachineschedule-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-statemachine-statemachineschedule-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)`プロパティに直接渡されます。

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

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

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

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

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

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

#### YAML
<a name="sam-property-statemachine-statemachineschedule--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-statemachine-statemachinescheduledeadletterconfig"></a>

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

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

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

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

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

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

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

 `Type`   <a name="sam-statemachine-statemachinescheduledeadletterconfig-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-statemachine-statemachinescheduledeadletterconfig--examples"></a>

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

DeadLetterConfig

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

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

# Target
<a name="sam-property-statemachine-statemachinescheduletarget"></a>

ルールがトリガーされたときに EventBridge が呼び出す AWS リソースを設定します。

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

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

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

```
  [Id](#sam-statemachine-statemachinescheduletarget-id): String
```

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

 `Id`   <a name="sam-statemachine-statemachinescheduletarget-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-statemachine-statemachinescheduletarget--examples"></a>

### ターゲット
<a name="sam-property-statemachine-statemachinescheduletarget--examples--target"></a>

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

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

# ScheduleV2
<a name="sam-property-statemachine-statemachineschedulev2"></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-statemachine-statemachineschedulev2-syntax"></a>

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

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

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

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

 `DeadLetterConfig`   <a name="sam-statemachine-statemachineschedulev2-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 スケジューラのデッドレターキューの設定) を参照してください。  
*タイプ*: [DeadLetterConfig](sam-property-statemachine-statemachinescheduledeadletterconfig.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-statemachine-statemachineschedulev2-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-statemachine-statemachineschedulev2-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-statemachine-statemachineschedulev2-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.html#cfn-scheduler-schedule-flexibletimewindow)`プロパティに直接渡されます。

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

 `PermissionsBoundary`   <a name="sam-statemachine-statemachineschedulev2-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-statemachine-statemachineschedulev2-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-statemachine-statemachineschedulev2-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-statemachine-statemachineschedulev2-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-statemachine-statemachineschedulev2-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-statemachine-statemachineschedulev2-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-statemachine-statemachineschedulev2-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-statemachine-statemachineschedulev2--examples"></a>

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

```
StateMachine:
  Type: AWS::Serverless::StateMachine
  Properties:
    Name: MyStateMachine
    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
    DefinitionUri:
      Bucket: sam-sam-s3-demo-bucket
      Key: my-state-machine.asl.json
      Version: 3
    Policies:
      - LambdaInvokePolicy:
          FunctionName: !Ref MyFunction
```

# の生成済み CloudFormation リソース AWS SAM
<a name="sam-specification-generated-resources"></a>

このセクションでは、 が AWS テンプレート AWS SAM を処理するときに作成される CloudFormation リソースについて詳しく説明します。が AWS SAM 生成する CloudFormation リソースのセットは、指定したシナリオによって異なります。*シナリオ*とは、テンプレートファイルで指定される AWS SAM リソースとプロパティの組み合わせのことです。テンプレートファイル内の他の部分で生成された CloudFormation リソースは、テンプレートファイルで明示的に宣言するリファレンスの参照方法と同じように参照できます。

例えば、 AWS SAM テンプレートファイルで `AWS::Serverless::Function` リソースを指定すると、 AWS SAM は常に `AWS::Lambda::Function` ベースのリソースを生成します。オプションの `AutoPublishAlias`プロパティも指定すると、 は AWS SAM さらに `AWS::Lambda::Alias`および `AWS::Lambda::Version`リソースを生成します。

このセクションでは、シナリオとそれらが生成する CloudFormation リソースを一覧表示し、 AWS SAM テンプレートファイルで生成された CloudFormation リソースを参照する方法を示します。

## 生成された CloudFormation リソースの参照
<a name="sam-specification-generated-resources-referencing"></a>

 AWS SAM テンプレートファイル内で生成された CloudFormation リソースを参照するには、 `LogicalId`または参照可能なプロパティの 2 つのオプションがあります。

### LogicalId による生成された CloudFormation リソースの参照
<a name="sam-specification-generated-resources-referencing-logicalid"></a>

が AWS SAM 生成する各 CloudFormation リソースには`[LogicalId](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/resources-section-structure.html#resources-section-structure-logicalid)`、テンプレートファイル内で一意の英数字 (A～Z、a～z、0～9) 識別子である があります。 は、テンプレートファイル内の AWS SAM リソース`LogicalIds`の AWS SAM を使用して、生成する CloudFormation リソース`LogicalIds`の を構築します。生成された CloudFormation リソース`LogicalId`の を使用して、明示的に宣言した リソースの場合と同様に CloudFormation 、テンプレートファイル内のそのリソースのプロパティにアクセスできます。 CloudFormation および AWS SAM テンプレートの詳細については、`LogicalIds`*AWS CloudFormation 「 ユーザーガイド*」の[「 リソース](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/resources-section-structure.html)」を参照してください。

**注記**  
生成されたリソースの `LogicalIds` には、名前空間の衝突を避けるための一意のハッシュ値が含まれるものがあります。これらのリソースの `LogicalIds` は、スタックの作成時に導出されます。スタックが作成された後にのみ AWS マネジメントコンソール、 AWS CLI、またはいずれかの AWS SDKs を使用して取得できます。ハッシュ値が変更される可能性があるため、`LogicalId` によるこれらのリソースの参照は推奨されません。

### 参照可能なプロパティによる生成された CloudFormation リソースの参照
<a name="sam-specification-generated-resources-referencing-referenceable-property"></a>

一部の生成されたリソースについて、 はリソースの AWS SAM 参照可能なプロパティ AWS SAM を提供します。このプロパティを使用して、生成された CloudFormation リソースとそのプロパティを AWS SAM テンプレートファイル内で参照できます。

**注記**  
生成されたすべての CloudFormation リソースに参照可能なプロパティがあるわけではありません。これらのリソースには、`LogicalId` を使用する必要があります。

## 生成された CloudFormation リソースシナリオ
<a name="sam-specification-generated-resources-scenarios"></a>

次の表は、 AWS SAM リソースを生成するシナリオを構成する CloudFormation リソースとプロパティをまとめたものです。**シナリオ**列のトピックには、そのシナリオで が AWS SAM 生成する追加の CloudFormation リソースに関する詳細が記載されています。


| AWS SAM リソース | 基本 CloudFormation リソース | シナリオ | 
| --- | --- | --- | 
| AWS::Serverless::Api  | [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-restapi.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-restapi.html) |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ja_jp/serverless-application-model/latest/developerguide/sam-specification-generated-resources.html)  | 
| AWS::Serverless::Application  | [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-stack.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-stack.html) |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ja_jp/serverless-application-model/latest/developerguide/sam-specification-generated-resources.html)  | 
| AWS::Serverless::CapacityProvider  | [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-capacityprovider.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-capacityprovider.html) |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ja_jp/serverless-application-model/latest/developerguide/sam-specification-generated-resources.html)  | 
| AWS::Serverless::Function | [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html) |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ja_jp/serverless-application-model/latest/developerguide/sam-specification-generated-resources.html)  | 
| AWS::Serverless::HttpApi | [AWS::ApiGatewayV2::Api](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigatewayv2-api.html) |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ja_jp/serverless-application-model/latest/developerguide/sam-specification-generated-resources.html)  | 
| AWS::Serverless::LayerVersion  | [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-layerversion.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-layerversion.html) |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ja_jp/serverless-application-model/latest/developerguide/sam-specification-generated-resources.html)  | 
| AWS::Serverless::SimpleTable  | [AWS::DynamoDB::Table](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dynamodb-table.html) |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ja_jp/serverless-application-model/latest/developerguide/sam-specification-generated-resources.html)  | 
| AWS::Serverless::StateMachine  | [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-stepfunctions-statemachine.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-stepfunctions-statemachine.html) |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ja_jp/serverless-application-model/latest/developerguide/sam-specification-generated-resources.html)  | 

**Topics**
+ [

## 生成された CloudFormation リソースの参照
](#sam-specification-generated-resources-referencing)
+ [

## 生成された CloudFormation リソースシナリオ
](#sam-specification-generated-resources-scenarios)
+ [

# CloudFormation AWS::Serverless::Apiが指定されているときに生成される リソース
](sam-specification-generated-resources-api.md)
+ [

# CloudFormation AWS::Serverless::Applicationが指定されているときに生成される リソース
](sam-specification-generated-resources-application.md)
+ [

# CloudFormation AWS::Serverless::CapacityProviderが指定されているときに生成される リソース
](sam-specification-generated-resources-capacityprovider.md)
+ [

# CloudFormation を指定したときに生成される リソース AWS::Serverless::Connector
](sam-specification-generated-resources-connector.md)
+ [

# CloudFormation AWS::Serverless::Functionが指定されているときに生成される リソース
](sam-specification-generated-resources-function.md)
+ [

# CloudFormation AWS::Serverless::GraphQLApiが指定されているときに生成される リソース
](sam-specification-generated-resources-graphqlapi.md)
+ [

# CloudFormation AWS::Serverless::HttpApi を指定したときに生成される リソース
](sam-specification-generated-resources-httpapi.md)
+ [

# CloudFormation AWS::Serverless::LayerVersionが指定されているときに生成される リソース
](sam-specification-generated-resources-layerversion.md)
+ [

# CloudFormation AWS::Serverless::SimpleTableが指定されているときに生成される リソース
](sam-specification-generated-resources-simpletable.md)
+ [

# CloudFormation AWS::Serverless::StateMachineが指定されているときに生成される リソース
](sam-specification-generated-resources-statemachine.md)

# CloudFormation AWS::Serverless::Apiが指定されているときに生成される リソース
<a name="sam-specification-generated-resources-api"></a>

を指定する`AWS::Serverless::Api`と、 AWS Serverless Application Model (AWS SAM) は常に`AWS::ApiGateway::RestApi`ベース CloudFormation リソースを生成します。これに加えて、`AWS::ApiGateway::Stage` と `AWS::ApiGateway::Deployment` リソースも常に生成します。

**`AWS::ApiGateway::RestApi`**  
*`LogicalId`: *`<api‑LogicalId>`  
*参照可能なプロパティ: *該当なし (この CloudFormation リソースを参照`LogicalId`するには を使用する必要があります)

**`AWS::ApiGateway::Stage`**  
*`LogicalId`: *`<api‑LogicalId><stage‑name>Stage`  
`<stage‑name>` は、`StageName` プロパティが設定されている文字列です。例えば、`StageName` を `Gamma` に設定とすると、`LogicalId` が `MyRestApiGammaStage` になります。  
*参照可能なプロパティ: *`<api‑LogicalId>.Stage`

**`AWS::ApiGateway::Deployment`**  
*`LogicalId`: *`<api‑LogicalId>Deployment<sha>`  
`<sha>` は、スタックが作成されるときに生成される一意のハッシュ値です。例えば、`MyRestApiDeployment926eeb5ff1`。  
*参照可能なプロパティ: *`<api‑LogicalId>.Deployment`

これらの CloudFormation リソースに加えて、 を指定すると、 `AWS::Serverless::Api`は次のシナリオで追加の CloudFormation リソース AWS SAM を生成します。

**Topics**
+ [

## DomainName プロパティが指定されている
](#sam-specification-generated-resources-api-domain-name)
+ [

## UsagePlan プロパティが指定されている
](#sam-specification-generated-resources-api-usage-plan)

## DomainName プロパティが指定されている
<a name="sam-specification-generated-resources-api-domain-name"></a>

の `DomainName`プロパティの `Domain`プロパティを指定すると、 `AWS::Serverless::Api`は `AWS::ApiGateway::DomainName` CloudFormation リソース AWS SAM を生成します。

**`AWS::ApiGateway::DomainName`**  
*`LogicalId`: *`ApiGatewayDomainName<sha>`  
`<sha>` は、スタックが作成されるときに生成される一意のハッシュ値です。例: `ApiGatewayDomainName926eeb5ff1`。  
*参照可能なプロパティ: *`<api‑LogicalId>.DomainName`

## UsagePlan プロパティが指定されている
<a name="sam-specification-generated-resources-api-usage-plan"></a>

の `UsagePlan`プロパティの `Auth`プロパティを指定すると、 `AWS::Serverless::Api`は `AWS::ApiGateway::UsagePlan`、`AWS::ApiGateway::UsagePlanKey`、および の CloudFormation リソース AWS SAM を生成します`AWS::ApiGateway::ApiKey`。

**`AWS::ApiGateway::UsagePlan`**  
*`LogicalId`: *`<api‑LogicalId>UsagePlan`  
*参照可能なプロパティ: *`<api‑LogicalId>.UsagePlan`

**`AWS::ApiGateway::UsagePlanKey`**  
*`LogicalId`: *`<api‑LogicalId>UsagePlanKey`  
*参照可能なプロパティ: *`<api‑LogicalId>.UsagePlanKey`

**`AWS::ApiGateway::ApiKey`**  
*`LogicalId`: *`<api‑LogicalId>ApiKey`  
*参照可能なプロパティ: *`<api‑LogicalId>.ApiKey`

# CloudFormation AWS::Serverless::Applicationが指定されているときに生成される リソース
<a name="sam-specification-generated-resources-application"></a>

`AWS::Serverless::Application` を指定すると、 AWS Serverless Application Model (AWS SAM) は `AWS::CloudFormation::Stack` ベース CloudFormation リソースを生成します。

**`AWS::CloudFormation::Stack`**  
*`LogicalId`: *`<application‑LogicalId>`   
*参照可能なプロパティ: *該当なし (この CloudFormation リソースを参照`LogicalId`するには を使用する必要があります)

# CloudFormation AWS::Serverless::CapacityProviderが指定されているときに生成される リソース
<a name="sam-specification-generated-resources-capacityprovider"></a>

`AWS::Serverless::CapacityProvider` が指定されている場合、 AWS Serverless Application Model (AWS SAM) は `AWS::Lambda::CapacityProvider` のベース CloudFormation リソースを生成します。

**`AWS::Lambda::CapacityProvider`**  
*`LogicalId`: *`<capacityprovider‑LogicalId>`  
*参照可能なプロパティ: *該当なし (この CloudFormation リソースを参照`LogicalId`するには を使用する必要があります)

この CloudFormation リソースに加えて、 を指定すると、 `AWS::Serverless::CapacityProvider`は次のシナリオの CloudFormation リソース AWS SAM も生成します。

**Topics**
+ [

## OperatorRole プロパティが指定されていません
](#sam-specification-generated-resources-capacityprovider-iam-role)

## OperatorRole プロパティが指定されていません
<a name="sam-specification-generated-resources-capacityprovider-iam-role"></a>

の `OperatorRole`プロパティが指定され*ていない場合*、 `AWS::Serverless::CapacityProvider`は `AWSLambdaManagedEC2ResourceOperator`マネージドポリシーがアタッチされた `AWS::IAM::Role` CloudFormation リソース AWS SAM を生成します。

**`AWS::IAM::Role`**  
*`LogicalId`: *`<capacityprovider‑LogicalId>OperatorRole`  
*参照可能なプロパティ: *該当なし (この CloudFormation リソースを参照`LogicalId`するには を使用する必要があります)

# CloudFormation を指定したときに生成される リソース AWS::Serverless::Connector
<a name="sam-specification-generated-resources-connector"></a>

**注記**  
埋め込み `Connectors` プロパティを介してコネクタを定義すると、これらのリソースを生成する前に、まず `AWS::Serverless::Connector` リソースに変換されます。

 AWS SAM テンプレートで `AWS::Serverless::Connector`リソースを指定すると、 は必要に応じて次の AWS CloudFormation リソース AWS SAM を生成します。

**`AWS::IAM::ManagedPolicy`**  
 *`LogicalId`:*`<connector‑LogicalId>Policy`   
 *参照可能なプロパティ:* N/A (この CloudFormation リソースを参照するには、 を使用する必要があります)`LogicalId`。

**`AWS::SNS::TopicPolicy`**  
 *`LogicalId`:*`<connector‑LogicalId>TopicPolicy`   
 *参照可能なプロパティ:* N/A (この CloudFormation リソースを参照するには、 を使用する必要があります)`LogicalId`。

**`AWS::SQS::QueuePolicy`**  
 *`LogicalId`:*`<connector‑LogicalId>QueuePolicy`   
 *参照可能なプロパティ:* N/A (この CloudFormation リソースを参照するには、 を使用する必要があります)`LogicalId`。

**`AWS::Lambda::Permission`**  
 *`LogicalId`:*`<connector‑LogicalId><permission>LambdaPermission`   
 `<permission>` は、`Permissions` プロパティによって指定されたアクセス許可です。例えば、`Write`。  
*参照可能なプロパティ:* N/A (この CloudFormation リソースを参照するには、 を使用する必要があります)`LogicalId`。

# CloudFormation AWS::Serverless::Functionが指定されているときに生成される リソース
<a name="sam-specification-generated-resources-function"></a>

`AWS::Serverless::Function` を指定すると、 AWS Serverless Application Model (AWS SAM) は常に `AWS::Lambda::Function` ベース CloudFormation リソースを作成します。

**`AWS::Lambda::Function`**  
*`LogicalId`: *`<function‑LogicalId>`  
*参照可能なプロパティ: *該当なし (この CloudFormation リソースを参照`LogicalId`するには を使用する必要があります)

この CloudFormation リソースに加えて、 を指定すると、 `AWS::Serverless::Function`は次のシナリオの CloudFormation リソース AWS SAM も生成します。

**Topics**
+ [

## コア関数のプロパティ
](#sam-specification-generated-resources-function-core-properties)
+ [

## イベントソース
](#sam-specification-generated-resources-function-event-sources)
+ [

## イベント設定
](#sam-specification-generated-resources-function-event-configuration)

## コア関数のプロパティ
<a name="sam-specification-generated-resources-function-core-properties"></a>

次のシナリオでは、コア関数のプロパティに基づいて CloudFormation リソースを生成します。

### Role プロパティが指定されていない
<a name="sam-specification-generated-resources-function-not-role"></a>

の `Role`プロパティが指定され*ていない場合*、 `AWS::Serverless::Function`は `AWS::IAM::Role` CloudFormation リソース AWS SAM を生成します。

**`AWS::IAM::Role`**  
*`LogicalId`: *`<function‑LogicalId>Role`  
*参照可能なプロパティ: *該当なし (この CloudFormation リソースを参照`LogicalId`するには を使用する必要があります)

### AutoPublishAlias プロパティが指定されている
<a name="sam-specification-generated-resources-function-autopublishalias"></a>

の `AutoPublishAlias`プロパティ`AWS::Serverless::Function`を指定すると、 は `AWS::Lambda::Alias`および の CloudFormation リソース AWS SAM を生成します`AWS::Lambda::Version`。

**`AWS::Lambda::Alias`**  
*`LogicalId`: *`<function‑LogicalId>Alias<alias‑name>`  
`<alias‑name>` は、`AutoPublishAlias` が設定されている文字列です。例えば、`AutoPublishAlias` を `live` に設定すると、`LogicalId` は *MyFunction*Alias*live* になります。  
*参照可能なプロパティ: *`<function‑LogicalId>.Alias`

**`AWS::Lambda::Version`**  
*`LogicalId`: *`<function‑LogicalId>Version<sha>`  
`<sha>` は、スタックが作成されるときに生成される一意のハッシュ値です。例えば、*MyFunction*Version*926eeb5ff1* などです。  
*参照可能なプロパティ: *`<function‑LogicalId>.Version`

`AutoPublishAlias` プロパティの詳細については、[AWS::Serverless::Function のプロパティセクション](sam-resource-function.md#sam-resource-function-properties)を参照してください。

### DeploymentPreference プロパティが指定されている
<a name="sam-specification-generated-resources-function-deploymentpreference"></a>

の `DeploymentPreference`プロパティを指定する`AWS::CodeDeploy::Application`と、 `AWS::Serverless::Function`は および の CloudFormation リソース AWS SAM リソースを生成します`AWS::CodeDeploy::DeploymentGroup`。さらに、 `DeploymentPreference` オブジェクトの `Role`プロパティが指定され*ていない場合*、 は `AWS::IAM::Role` CloudFormation リソース AWS SAM も生成します。

**`AWS::CodeDeploy::Application`**  
*`LogicalId`: *`ServerlessDeploymentApplication`  
*参照可能なプロパティ: *該当なし (この CloudFormation リソースを参照`LogicalId`するには を使用する必要があります)

**`AWS::CodeDeploy::DeploymentGroup`**  
*`LogicalId`: *`<function‑LogicalId>DeploymentGroup`  
*参照可能なプロパティ: *該当なし (この CloudFormation リソースを参照`LogicalId`するには を使用する必要があります)

**`AWS::IAM::Role`**  
*`LogicalId`: *`CodeDeployServiceRole`  
*参照可能なプロパティ: *該当なし (この CloudFormation リソースを参照`LogicalId`するには を使用する必要があります)

### FunctionUrlConfig プロパティが指定されている
<a name="sam-specification-generated-resources-function-functionurlconfig"></a>

`FunctionUrlConfig` プロパティを指定すると、 は に基づいて異なる CloudFormation リソース AWS SAM を生成します`AuthType`。

を指定する`AuthType: NONE`と、 は次の CloudFormation リソース AWS SAM を生成します。

**`AWS::Lambda::Permission` (アクセスを呼び出す)**  
*`LogicalId`: *`<function‑LogicalId>URLInvokeAllowPublicAccess`  
*参照可能なプロパティ: *該当なし (この CloudFormation リソースを参照`LogicalId`するには を使用する必要があります)

**`AWS::Lambda::Permission` (パブリックアクセス)**  
*`LogicalId`: *`<function‑LogicalId>UrlPublicPermissions`  
*参照可能なプロパティ: *該当なし (この CloudFormation リソースを参照`LogicalId`するには を使用する必要があります)

**`AWS::Lambda::Url`**  
*`LogicalId`: *`<function‑LogicalId>Url`  
*参照可能なプロパティ: *該当なし (この CloudFormation リソースを参照`LogicalId`するには を使用する必要があります)

を指定する`AuthType: AWS_IAM`と、 は以下のみ AWS SAM を生成します。

**`AWS::Lambda::Url`**  
*`LogicalId`: *`<function‑LogicalId>Url`  
*参照可能なプロパティ: *該当なし (この CloudFormation リソースを参照`LogicalId`するには を使用する必要があります)

`FunctionUrlConfig` プロパティの詳細については、「[FunctionUrlConfig](sam-property-function-functionurlconfig.md)」を参照してください。

## イベントソース
<a name="sam-specification-generated-resources-function-event-sources"></a>

次のシナリオでは、イベントソースに基づいて CloudFormation リソースを生成します。

### Api イベントソースが指定されている
<a name="sam-specification-generated-resources-function-api"></a>

の `Event`プロパティ`AWS::Serverless::Function`が に設定されているが`Api`、 `RestApiId`プロパティが指定され*ていない場合*、 は`AWS::ApiGateway::RestApi` CloudFormation リソース AWS SAM を生成します。

**`AWS::ApiGateway::RestApi`**  
*`LogicalId`: *`ServerlessRestApi`  
*参照可能なプロパティ: *該当なし (この CloudFormation リソースを参照`LogicalId`するには を使用する必要があります)

### HttpApi イベントソースが指定されている
<a name="sam-specification-generated-resources-function-httpapi"></a>

の `Event`プロパティ`AWS::Serverless::Function`が に設定されているが`HttpApi`、 `ApiId`プロパティが指定され*ていない場合*、 は`AWS::ApiGatewayV2::Api` CloudFormation リソース AWS SAM を生成します。

**`AWS::ApiGatewayV2::Api`**  
*`LogicalId`: *`ServerlessHttpApi`  
*参照可能なプロパティ: *該当なし (この CloudFormation リソースを参照`LogicalId`するには を使用する必要があります)

### ストリーミングイベントソースが指定されている
<a name="sam-specification-generated-resources-function-streaming"></a>

の `Event`プロパティ`AWS::Serverless::Function`がストリーミングタイプの 1 つに設定されている場合、 は`AWS::Lambda::EventSourceMapping` CloudFormation リソース AWS SAM を生成します。これは、`DynamoDB`、`Kinesis`、`MQ`、`MSK`、および `SQS` の各タイプに適用されます。

**`AWS::Lambda::EventSourceMapping`**  
*`LogicalId`: *`<function‑LogicalId><event‑LogicalId>`  
*参照可能なプロパティ: *該当なし (この CloudFormation リソースを参照`LogicalId`するには を使用する必要があります)

### イベントブリッジ (またはイベントバス) イベントソースが指定されている
<a name="sam-specification-generated-resources-function-eventbridge"></a>

の `Event`プロパティ`AWS::Serverless::Function`がイベントブリッジ (またはイベントバス) タイプの 1 つに設定されている場合、 は`AWS::Events::Rule` CloudFormation リソース AWS SAM を生成します。これは、`EventBridgeRule`、`Schedule`、および `CloudWatchEvents` の各タイプに適用されます。

**`AWS::Events::Rule`**  
*`LogicalId`: *`<function‑LogicalId><event‑LogicalId>`  
*参照可能なプロパティ: *該当なし (この CloudFormation リソースを参照`LogicalId`するには を使用する必要があります)

### IotRule イベントソースが指定されている
<a name="sam-specification-generated-resources-function-iotrule"></a>

の `Event`プロパティ`AWS::Serverless::Function`が IoTRule に設定されている場合、 は`AWS::IoT::TopicRule` CloudFormation リソース AWS SAM を生成します。

**`AWS::IoT::TopicRule`**  
*`LogicalId`: *`<function‑LogicalId><event‑LogicalId>`  
*参照可能なプロパティ: *該当なし (この CloudFormation リソースを参照`LogicalId`するには を使用する必要があります)

## イベント設定
<a name="sam-specification-generated-resources-function-event-configuration"></a>

次のシナリオでは、イベント設定に基づいて CloudFormation リソースを生成します。

### Amazon SNS イベントに対して OnSuccess (または OnFailure) プロパティが指定されている
<a name="sam-specification-generated-resources-function-sns-onsuccess"></a>

の プロパティの `DestinationConfig`プロパティの `OnSuccess` (または `OnFailure`) `EventInvokeConfig`プロパティ`AWS::Serverless::Function`が指定され、送信先タイプが `SNS`であっても送信先 ARN が指定され*ていない場合*、 は `AWS::Lambda::EventInvokeConfig`および の CloudFormation リソース AWS SAM を生成します`AWS::SNS::Topic`。

**`AWS::Lambda::EventInvokeConfig`**  
*`LogicalId`: *`<function‑LogicalId>EventInvokeConfig`  
*参照可能なプロパティ: *該当なし (この CloudFormation リソースを参照`LogicalId`するには を使用する必要があります)

**`AWS::SNS::Topic`**  
*`LogicalId`: *`<function‑LogicalId>OnSuccessTopic` (または `<function‑LogicalId>OnFailureTopic`)  
*参照可能なプロパティ: *`<function‑LogicalId>.DestinationTopic`  
`OnSuccess` と `OnFailure` の両方が Amazon SNS イベントに指定されている場合、生成されたリソースを区別するには `LogicalId` を使用する必要があります。

### Amazon SQS イベントに対して OnSuccess (または OnFailure) プロパティが指定されている
<a name="sam-specification-generated-resources-function-sqs-onsuccess"></a>

の プロパティの `DestinationConfig`プロパティの `OnSuccess` (または `OnFailure`) `EventInvokeConfig`プロパティ`AWS::Serverless::Function`が指定され、送信先タイプが `SQS`であっても送信先 ARN が指定され*ていない場合*、 は `AWS::Lambda::EventInvokeConfig`および の CloudFormation リソース AWS SAM を生成します`AWS::SQS::Queue`。

**`AWS::Lambda::EventInvokeConfig`**  
*`LogicalId`: *`<function‑LogicalId>EventInvokeConfig`  
*参照可能なプロパティ: *該当なし (この CloudFormation リソースを参照`LogicalId`するには を使用する必要があります)

**`AWS::SQS::Queue`**  
*`LogicalId`: *`<function‑LogicalId>OnSuccessQueue` (または `<function‑LogicalId>OnFailureQueue`)  
*参照可能なプロパティ: *`<function‑LogicalId>.DestinationQueue`  
`OnSuccess` と `OnFailure` の両方が Amazon SQS イベントに指定されている場合、生成されたリソースを区別するには `LogicalId` を使用する必要があります。

# CloudFormation AWS::Serverless::GraphQLApiが指定されているときに生成される リソース
<a name="sam-specification-generated-resources-graphqlapi"></a>

(AWS SAM) テンプレートで AWS Serverless Application Model `AWS::Serverless::GraphQLApi`リソースを指定すると、 AWS SAM は常に次の基本 AWS CloudFormation リソースを作成します。

**`AWS::AppSync::DataSource`**  
*`LogicalId`: *`<graphqlapi-LogicalId><datasource-RelativeId><datasource-Type>DataSource`  
*参照可能なプロパティ: *該当なし (この CloudFormation リソースを参照`LogicalId`するには を使用する必要があります)

**`AWS::AppSync::FunctionConfiguration`**  
*`LogicalId`: *`<graphqlapi-LogicalId><function-RelativeId>`  
*参照可能なプロパティ: *該当なし (この CloudFormation リソースを参照`LogicalId`するには を使用する必要があります)

**`AWS::AppSync::GraphQLApi`**  
*`LogicalId`: *`<graphqlapi-LogicalId>`  
*参照可能なプロパティ: *該当なし (この CloudFormation リソースを参照`LogicalId`するには を使用する必要があります)

**`AWS::AppSync::GraphQLSchema`**  
*`LogicalId`: *`<graphqlapi-LogicalId>Schema`  
*参照可能なプロパティ: *該当なし (この CloudFormation リソースを参照`LogicalId`するには を使用する必要があります)

**`AWS::AppSync::Resolver`**  
*`LogicalId`: *`<graphqlapi-LogicalId><OperationType><resolver-RelativeId>`  
*参照可能なプロパティ: *該当なし (この CloudFormation リソースを参照`LogicalId`するには を使用する必要があります)

これらの CloudFormation リソースに加えて、 を指定する`AWS::Serverless::GraphQLApi`と、次の CloudFormation リソースも生成 AWS SAM される場合があります。

`AWS::AppSync::ApiCache`  
*`LogicalId`: *`<graphqlapi-LogicalId>ApiCache`  
*参照可能なプロパティ: *該当なし (この CloudFormation リソースを参照`LogicalId`するには を使用する必要があります)

`AWS::AppSync::ApiKey`  
*`LogicalId`: *`<graphqlapi-LogicalId><apikey-RelativeId>`  
*参照可能なプロパティ: *該当なし (この CloudFormation リソースを参照`LogicalId`するには を使用する必要があります)

`AWS::AppSync::DomainName`  
*`LogicalId`: *`<graphqlapi-LogicalId>DomainName`  
*参照可能なプロパティ: *該当なし (この CloudFormation リソースを参照`LogicalId`するには を使用する必要があります)

`AWS::AppSync::DomainNameApiAssociation`  
*`LogicalId`: *`<graphqlapi-LogicalId>DomainNameApiAssociation`  
*参照可能なプロパティ: *該当なし (この CloudFormation リソースを参照`LogicalId`するには を使用する必要があります)

AWS SAM は、 `AWS::Serverless::Connector`リソースを使用してアクセス許可をプロビジョニングすることもできます。詳細については、「[CloudFormation を指定したときに生成される リソース AWS::Serverless::Connector](sam-specification-generated-resources-connector.md)」を参照してください。

# CloudFormation AWS::Serverless::HttpApi を指定したときに生成される リソース
<a name="sam-specification-generated-resources-httpapi"></a>

`AWS::Serverless::HttpApi` を指定すると、 AWS Serverless Application Model (AWS SAM) は `AWS::ApiGatewayV2::Api` ベース CloudFormation リソースを生成します。

**`AWS::ApiGatewayV2::Api`**  
*`LogicalId`: *`<httpapi‑LogicalId>`  
*参照可能なプロパティ: *該当なし (この CloudFormation リソースを参照`LogicalId`するには を使用する必要があります)

この CloudFormation リソースに加えて、 を指定すると、 `AWS::Serverless::HttpApi`は次のシナリオの CloudFormation リソース AWS SAM も生成します。

**Topics**
+ [

## StageName プロパティが指定されている
](#sam-specification-generated-resources-httpapi-stage-name)
+ [

## StageName プロパティが指定されて*いない*
](#sam-specification-generated-resources-httpapi-not-stage-name)
+ [

## DomainName プロパティが指定されている
](#sam-specification-generated-resources-httpapi-domain-name)

## StageName プロパティが指定されている
<a name="sam-specification-generated-resources-httpapi-stage-name"></a>

の `StageName`プロパティを指定すると、 `AWS::Serverless::HttpApi`は`AWS::ApiGatewayV2::Stage` CloudFormation リソース AWS SAM を生成します。

**`AWS::ApiGatewayV2::Stage`**  
*`LogicalId`: *`<httpapi‑LogicalId><stage‑name>Stage`  
`<stage‑name>` は、`StageName` プロパティが設定されている文字列です。例えば、`StageName` を `Gamma` に設定すると、`LogicalId` は *MyHttpapigamma*Stage になります。  
*参照可能なプロパティ: *`<httpapi‑LogicalId>.Stage`

## StageName プロパティが指定されて*いない*
<a name="sam-specification-generated-resources-httpapi-not-stage-name"></a>

の `StageName`プロパティが指定され*ていない場合*、 `AWS::Serverless::HttpApi`は`AWS::ApiGatewayV2::Stage` CloudFormation リソース AWS SAM を生成します。

**`AWS::ApiGatewayV2::Stage`**  
*`LogicalId`: *`<httpapi‑LogicalId>ApiGatewayDefaultStage`  
*参照可能なプロパティ: *`<httpapi‑LogicalId>.Stage`

## DomainName プロパティが指定されている
<a name="sam-specification-generated-resources-httpapi-domain-name"></a>

の `DomainName`プロパティの `Domain`プロパティを指定すると、 `AWS::Serverless::HttpApi`は `AWS::ApiGatewayV2::DomainName` CloudFormation リソース AWS SAM を生成します。

**`AWS::ApiGatewayV2::DomainName`**  
*`LogicalId`: *`ApiGatewayDomainNameV2<sha>`  
`<sha>` は、スタックが作成されるときに生成される一意のハッシュ値です。例えば、`ApiGatewayDomainNameV2`*926eeb5ff1* などです。  
*参照可能なプロパティ: *`<httpapi‑LogicalId>.DomainName`

# CloudFormation AWS::Serverless::LayerVersionが指定されているときに生成される リソース
<a name="sam-specification-generated-resources-layerversion"></a>

`AWS::Serverless::LayerVersion` を指定すると、 AWS Serverless Application Model (AWS SAM) は `AWS::Lambda::LayerVersion` ベース CloudFormation リソースを生成します。

**`AWS::Lambda::LayerVersion`**  
*`LogicalId`: *`<layerversion‑LogicalId>`   
*参照可能なプロパティ: *該当なし (この CloudFormation リソースを参照`LogicalId`するには を使用する必要があります)

# CloudFormation AWS::Serverless::SimpleTableが指定されているときに生成される リソース
<a name="sam-specification-generated-resources-simpletable"></a>

`AWS::Serverless::SimpleTable` を指定すると、 AWS Serverless Application Model (AWS SAM) は `AWS::DynamoDB::Table` ベース CloudFormation リソースを生成します。

**`AWS::DynamoDB::Table`**  
*`LogicalId`: *`<simpletable‑LogicalId>`   
*参照可能なプロパティ: *該当なし (この CloudFormation リソースを参照`LogicalId`するには を使用する必要があります)

# CloudFormation AWS::Serverless::StateMachineが指定されているときに生成される リソース
<a name="sam-specification-generated-resources-statemachine"></a>

`AWS::Serverless::StateMachine` が指定されている場合、 AWS Serverless Application Model (AWS SAM) は `AWS::StepFunctions::StateMachine` のベース CloudFormation リソースを生成します。

**`AWS::StepFunctions::StateMachine`**  
*`LogicalId`: *`<statemachine‑LogicalId>`  
*参照可能なプロパティ: *該当なし (この CloudFormation リソースを参照`LogicalId`するには を使用する必要があります)

この CloudFormation リソースに加えて、 を指定すると、 `AWS::Serverless::StateMachine`は次のシナリオの CloudFormation リソース AWS SAM も生成します。

**Topics**
+ [

## Role プロパティが指定されていない
](#sam-specification-generated-resources-statemachine-not-role)
+ [

## Api イベントソースが指定されている
](#sam-specification-generated-resources-statemachine-api)
+ [

## イベントブリッジ (またはイベントバス) イベントソースが指定されている
](#sam-specification-generated-resources-statemachine-eventbridge)

## Role プロパティが指定されていない
<a name="sam-specification-generated-resources-statemachine-not-role"></a>

の `Role`プロパティが指定され*ていない場合*、 `AWS::Serverless::StateMachine`は `AWS::IAM::Role` CloudFormation リソース AWS SAM を生成します。

**`AWS::IAM::Role`**  
*`LogicalId`: *`<statemachine‑LogicalId>Role`  
*参照可能なプロパティ: *該当なし (この CloudFormation リソースを参照`LogicalId`するには を使用する必要があります)

## Api イベントソースが指定されている
<a name="sam-specification-generated-resources-statemachine-api"></a>

の `Event`プロパティ`AWS::Serverless::StateMachine`が に設定されているが`Api`、 `RestApiId`プロパティが指定され*ていない場合*、 は`AWS::ApiGateway::RestApi` CloudFormation リソース AWS SAM を生成します。

**`AWS::ApiGateway::RestApi`**  
*`LogicalId`: *`ServerlessRestApi`  
*参照可能なプロパティ: *該当なし (この CloudFormation リソースを参照`LogicalId`するには を使用する必要があります)

## イベントブリッジ (またはイベントバス) イベントソースが指定されている
<a name="sam-specification-generated-resources-statemachine-eventbridge"></a>

の `Event`プロパティ`AWS::Serverless::StateMachine`がイベントブリッジ (またはイベントバス) タイプの 1 つに設定されている場合、 は`AWS::Events::Rule` CloudFormation リソース AWS SAM を生成します。これは、`EventBridgeRule`、`Schedule`、および `CloudWatchEvents` の各タイプに適用されます。

**`AWS::Events::Rule`**  
*`LogicalId`: *`<statemachine‑LogicalId><event‑LogicalId>`  
*参照可能なプロパティ: *該当なし (この CloudFormation リソースを参照`LogicalId`するには を使用する必要があります)

# でサポートされるリソース属性 AWS SAM
<a name="sam-specification-resource-attributes"></a>

リソース属性は、追加の動作 AWS SAM と関係を制御するために および CloudFormation リソースに追加できる属性です。リソース属性の詳細については、*AWS CloudFormation ユーザーガイド*の「[Resource Attribute Reference](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-product-attribute-reference.html)」を参照してください。

AWS SAM は、 で定義されるリソース属性のサブセットをサポートします CloudFormation。サポートされているリソース属性のうち、一部は対応するリソースの基本生成 CloudFormation リソースにのみコピーされ AWS SAM 、一部は対応する CloudFormation リソースから生成されたすべての AWS SAM リソースにコピーされます。対応する CloudFormation リソースから生成された AWS SAM リソースの詳細については、「」を参照してください[の生成済み CloudFormation リソース AWS SAM](sam-specification-generated-resources.md)。

次の表は、以下の条件に従って AWS SAM、 によるリソース属性のサポートをまとめ[例外](#sam-specification-resource-attributes-exceptions)たものです。


| リソース属性 | 送信先で生成されるリソース | 
| --- | --- | 
|  ** [DependsOn](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html) ** ** [Metadata](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html) **1、2  |  ベース CloudFormation 生成リソースのみ。 AWS SAM リソースとベース CloudFormation リソース間のマッピングについては、「」を参照してください[生成された CloudFormation リソースシナリオ](sam-specification-generated-resources.md#sam-specification-generated-resources-scenarios)。  | 
| ** [条件](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/conditions-section-structure.html) ** ** [DeletionPolicy](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html) ** ** [UpdateReplacePolicy](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-updatereplacepolicy.html) **  |  対応する CloudFormation AWS SAM リソースから生成されたすべてのリソース。生成された CloudFormation リソースのシナリオについては、「」を参照してください[生成された CloudFormation リソースシナリオ](sam-specification-generated-resources.md#sam-specification-generated-resources-scenarios)。  | 

**注意**:

1. `AWS::Serverless::Function` リソースタイプとの `Metadata` リソース属性の使用に関する詳細については、「[でのカスタムランタイムを使用した Lambda 関数の構築 AWS SAM](building-custom-runtimes.md)」を参照してください。

1. `AWS::Serverless::LayerVersion` リソースタイプとの `Metadata` リソース属性の使用に関する詳細については、「[での Lambda レイヤーの構築 AWS SAM](building-layers.md)」を参照してください。

## 例外
<a name="sam-specification-resource-attributes-exceptions"></a>

前述のリソース属性ルールには、いくつかの例外があります。
+ の場合`AWS::Lambda::LayerVersion`、 AWS SAMのみのカスタムフィールドは、生成された CloudFormation リソース`DeletionPolicy`の `RetentionPolicy`を設定します。この設定は、`DeletionPolicy` 自体よりも優先されます。どちらも設定されていない場合、`DeletionPolicy` はデフォルトで `Retain` に設定されます。
+ `AWS::Lambda::Version` については、`DeletionPolicy` が指定されていない場合のデフォルトは `Retain` です。
+ サーバーレス関数に `DeploymentPreferences`が指定されている場合、リソース属性は次の生成された CloudFormation リソースにコピーされません。
  + `AWS::CodeDeploy::Application`
  + `AWS::CodeDeploy::DeploymentGroup`
  + このシナリオ用に作成された、`CodeDeployServiceRole` という名前の `AWS::IAM::Role`
+  AWS SAM テンプレートに暗黙的に作成された API イベントソースを持つ複数の関数が含まれている場合、関数は生成された`AWS::ApiGateway::RestApi`リソースを共有します。このシナリオでは、関数のリソース属性が異なる場合、生成された`AWS::ApiGateway::RestApi`リソースについて、 は次の優先順位リストに従ってリソース属性 AWS SAM をコピーします。
  + `UpdateReplacePolicy`:

    1. `Retain`

    1. `Snapshot`

    1. `Delete`
  + `DeletionPolicy`:

    1. `Retain`

    1. `Delete`

# の API Gateway 拡張機能 AWS SAM
<a name="sam-specification-api-gateway-extensions"></a>

API Gateway 拡張機能は、API を設計および管理するための追加のカスタマイズと機能 AWSを提供します APIs 。API Gateway 拡張機能は、 AWS固有の認可と API Gateway 固有の API 統合をサポートする OpenAPI 仕様の拡張機能です。API Gateway 拡張機能の詳細情報については、「[API Gateway の OpenAPI 拡張機能](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-swagger-extensions.html)」を参照してください。

AWS SAM は API Gateway 拡張機能のサブセットをサポートします。でサポートされている API Gateway 拡張機能を確認するには AWS SAM、次の表を参照してください。


|  |  | 
| --- |--- |
|  API Gateway 拡張機能  |  でサポート AWS SAM  | 
| [x-amazon-apigateway-any-method オブジェクト](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-swagger-extensions-any-method.html) | はい | 
| [x-amazon-apigateway-api-key-source プロパティ](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-swagger-extensions-api-key-source.html) | 不可 | 
| [x-amazon-apigateway-auth オブジェクト](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-swagger-extensions-auth.html) | はい | 
| [x-amazon-apigateway-authorizer オブジェクト](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-swagger-extensions-authorizer.html) | はい | 
| [x amazon-apigateway-authtype プロパティ](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-swagger-extensions-authtype.html) | はい | 
| [x-amazon-apigateway-binary-media-types のプロパティ](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-swagger-extensions-binary-media-types.html) | はい | 
| [x-amazon-apigateway-documentation オブジェクト](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-swagger-extensions-documentation.html) | 不可 | 
| [x-amazon-apigateway-endpoint-configuration オブジェクト](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-swagger-extensions-endpoint-configuration.html) | 不可 | 
| [x-amazon-apigateway-gateway-responses オブジェクト](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-swagger-extensions-gateway-responses.html) | はい | 
| [x-amazon-apigateway-gateway-responses.gatewayResponse オブジェクト](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-swagger-extensions-gateway-responses.gatewayResponse.html) | はい | 
| [x-amazon-apigateway-gateway-responses.responseParameters オブジェクト](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-swagger-extensions-gateway-responses.responseParameters.html) | はい | 
| [x-amazon-apigateway-gateway-responses.responseTemplates オブジェクト](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-swagger-extensions-gateway-responses.responseTemplates.html) | はい | 
| [x-amazon-apigateway-integration オブジェクト](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-swagger-extensions-integration.html) | はい | 
| [x-amazon-apigateway-integration.requestTemplates オブジェクト](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-swagger-extensions-integration-requestTemplates.html) | はい | 
| [x-amazon-apigateway-integration.requestParameters オブジェクト](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-swagger-extensions-integration-requestParameters.html) | 不可 | 
| [x-amazon-apigateway-integration.responses オブジェクト](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-swagger-extensions-integration-responses.html) | はい | 
| [x-amazon-apigateway-integration.response オブジェクト](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-swagger-extensions-integration-response.html) | はい | 
| [x-amazon-apigateway-integration.responseTemplates オブジェクト](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-swagger-extensions-integration-responseTemplates.html) | はい | 
| [x-amazon-apigateway-integration.responseParameters オブジェクト](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-swagger-extensions-integration-responseParameters.html) | はい | 
| [x-amazon-apigateway-request-validator プロパティ](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-swagger-extensions-request-validator.html) | 不可 | 
| [x-amazon-apigateway-request-validators オブジェクト](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-swagger-extensions-request-validators.html) | 不可 | 
| [x-amazon-apigateway-request-validators.requestValidator オブジェクト](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-swagger-extensions-request-validators.requestValidator.html) | 不可 | 

# の組み込み関数 AWS SAM
<a name="sam-specification-intrinsic-functions"></a>

組み込み関数は、ランタイムでのみ使用可能なプロパティに値を割り当てることができる組み込み関数です。 AWS SAM では、特定の組み込み関数プロパティのサポートが制限されているため、一部の組み込み関数を解決できません。したがって、これを解決するためには、`AWS::LanguageExtensions` 変換を追加することをお勧めします。`AWS::LanguageExtensions` は、 によってホスト CloudFormation されるマクロであり、デフォルトでは含まれていない組み込み関数やその他の機能を使用できます CloudFormation。

```
Transform:
  - AWS::LanguageExtensions
  - AWS::Serverless-2016-10-31
```

**注記**  
CodeUri プロパティで組み込み関数を使用する場合、 は値を正しく解析 AWS SAM できません。代わりに `AWS::LanguageExtensions` 変換の使用を検討してください。  
詳細情報については、[AWS::Serverless::Function のプロパティセクション](sam-resource-function.md#sam-resource-function-properties)を参照してください。

組み込み関数の詳細については、*AWS CloudFormation ユーザーガイド*の「[Intrinsic Function Reference](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference.html)」を参照してください。