

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

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