

Les traductions sont fournies par des outils de traduction automatique. En cas de conflit entre le contenu d'une traduction et celui de la version originale en anglais, la version anglaise prévaudra.

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

Configure un plan d'utilisation pour une API API Gateway. Pour plus d'informations sur les plans d'utilisation, consultez [Création et utilisation de plans d'utilisation avec les clés API](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-api-usage-plans.html) dans le *Guide du développeur API Gateway*.

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

Pour déclarer cette entité dans votre modèle AWS Serverless Application Model (AWS SAM), utilisez la syntaxe suivante.

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

## Propriétés
<a name="sam-property-api-apiusageplan-properties"></a>

 `CreateUsagePlan`   <a name="sam-api-apiusageplan-createusageplan"></a>
Détermine comment ce plan d'utilisation est configuré. Les valeurs valides sont `PER_API`, `SHARED` et `NONE`.  
`PER_API` crée [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), et des ressources [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) propres à cette API. Ces ressources ont respectivement IDs une logique de `<api-logical-id>UsagePlan` `<api-logical-id>ApiKey``<api-logical-id>UsagePlanKey`, et.  
`SHARED`les [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)créations et [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)les [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)ressources qui sont partagées entre toutes les API figurant également `CreateUsagePlan: SHARED` dans le même AWS SAM modèle. Ces ressources ont respectivement IDs une logique de `ServerlessUsagePlan` `ServerlessApiKey``ServerlessUsagePlanKey`, et. Si vous utilisez cette option, nous vous recommandons d'ajouter une configuration supplémentaire pour ce plan d'utilisation sur une seule ressource API afin d'éviter des définitions conflictuelles et un état incertain.  
`NONE` désactive la création ou l'association d'un plan d'utilisation avec cette API. Ceci n'est nécessaire que si `SHARED` ou `PER_API` est spécifié dans le paramètre [Section « Globales » du modèle AWS SAM](sam-specification-template-anatomy-globals.md).  
*Valeurs valides*: `PER_API`, `SHARED`, et `NONE`  
*Type* : chaîne  
*Obligatoire* : oui  
*CloudFormation compatibilité* : cette propriété est unique AWS SAM et n'a pas d' CloudFormation équivalent.

 `Description`   <a name="sam-api-apiusageplan-description"></a>
Description du plan d'utilisation.  
*Type* : chaîne  
*Obligatoire* : non  
*CloudFormation compatibilité* : cette propriété est transmise directement à la `[Description](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-usageplan.html#cfn-apigateway-usageplan-description)` propriété d'une `AWS::ApiGateway::UsagePlan` ressource.

 `Quota`   <a name="sam-api-apiusageplan-quota"></a>
Configure le nombre de demandes que les utilisateurs peuvent soumettre au cours d'un intervalle donné.  
*Type :* [QuotaSettings](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-usageplan.html#cfn-apigateway-usageplan-quota)  
*Obligatoire* : non  
*CloudFormation compatibilité* : cette propriété est transmise directement à la `[Quota](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-usageplan.html#cfn-apigateway-usageplan-quota)` propriété d'une `AWS::ApiGateway::UsagePlan` ressource.

 `Tags`   <a name="sam-api-apiusageplan-tags"></a>
Tableau de balises arbitraires (paires clé-valeur) à associer au plan d'utilisation.  
Cette propriété utilise le [type de CloudFormation balise](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html).  
*Type* : liste  
*Obligatoire* : non  
*CloudFormation compatibilité* : cette propriété est transmise directement à la `[Tags](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-usageplan.html#cfn-apigateway-usageplan-tags)` propriété d'une `AWS::ApiGateway::UsagePlan` ressource.

 `Throttle`   <a name="sam-api-apiusageplan-throttle"></a>
Configure le taux de demandes global (nombre moyen de demandes par seconde), ainsi que la capacité de transmission en mode rafale.  
*Type :* [ThrottleSettings](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-usageplan.html#cfn-apigateway-usageplan-throttle)  
*Obligatoire* : non  
*CloudFormation compatibilité* : cette propriété est transmise directement à la `[Throttle](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-usageplan.html#cfn-apigateway-usageplan-throttle)` propriété d'une `AWS::ApiGateway::UsagePlan` ressource.

 `UsagePlanName`   <a name="sam-api-apiusageplan-usageplanname"></a>
Nom pour le plan d'utilisation.  
*Type* : chaîne  
*Obligatoire* : non  
*CloudFormation compatibilité* : cette propriété est transmise directement à la `[UsagePlanName](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-usageplan.html#cfn-apigateway-usageplan-usageplanname)` propriété d'une `AWS::ApiGateway::UsagePlan` ressource.

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

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

Voici un exemple de plan d'utilisation.

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