

Die vorliegende Übersetzung wurde maschinell erstellt. Im Falle eines Konflikts oder eines Widerspruchs zwischen dieser übersetzten Fassung und der englischen Fassung (einschließlich infolge von Verzögerungen bei der Übersetzung) ist die englische Fassung maßgeblich.

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

Erstellt eine Sammlung von Amazon API Gateway Gateway-Ressourcen und -Methoden, die über HTTPS-Endpunkte aufgerufen werden können.

Eine [AWS::Serverless::Api](#sam-resource-api) Ressource muss nicht explizit zu einer Vorlage für AWS serverlose Anwendungsdefinitionen hinzugefügt werden. Eine Ressource dieses Typs wird implizit aus der Vereinigung von API-Ereignissen erstellt, die für [AWS::Serverless::Function](sam-resource-function.md) Ressourcen definiert sind, die in der Vorlage definiert sind und sich nicht auf eine [AWS::Serverless::Api](#sam-resource-api) Ressource beziehen.

Eine [AWS::Serverless::Api](#sam-resource-api) Ressource sollte verwendet werden, um die verwendete API zu definieren und zu dokumentieren OpenApi, was mehr Möglichkeiten bietet, die zugrunde liegenden Amazon API Gateway Gateway-Ressourcen zu konfigurieren.

Wir empfehlen, CloudFormation Hooks oder IAM-Richtlinien zu verwenden, um zu überprüfen, ob an API-Gateway-Ressourcen Autorisatoren angehängt sind, um den Zugriff darauf zu kontrollieren.

Weitere Informationen zur Verwendung von CloudFormation Hooks finden Sie unter [Hooks registrieren](https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/registering-hook-python.html) im *CloudFormation CLI-Benutzerhandbuch* und im [apigw-enforce-authorizer](https://github.com/aws-cloudformation/aws-cloudformation-samples/tree/main/hooks/python-hooks/apigw-enforce-authorizer/) GitHub Repository.

Weitere Informationen zur Verwendung von IAM-Richtlinien finden Sie unter [Erfordern, dass API-Routen autorisiert sind](https://docs.aws.amazon.com/apigateway/latest/developerguide/security_iam_id-based-policy-examples.html#security_iam_id-based-policy-examples-require-authorization) im *API Gateway Developer Guide*.

**Anmerkung**  
Bei der Bereitstellung auf werden AWS CloudFormation Ihre AWS SAM Ressourcen in Ressourcen umgewandelt CloudFormation . AWS SAM Weitere Informationen finden Sie unter [Generierte CloudFormation Ressourcen für AWS SAM](sam-specification-generated-resources.md).

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

Verwenden Sie die folgende Syntax, um diese Entität in Ihrer AWS Serverless Application Model (AWS SAM) -Vorlage zu deklarieren.

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

## Eigenschaften
<a name="sam-resource-api-properties"></a>

 `AccessLogSetting`   <a name="sam-api-accesslogsetting"></a>
Konfiguriert die Einstellung für das Zugriffsprotokoll für eine Phase.  
*Typ:* [AccessLogSetting](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-stage.html#cfn-apigateway-stage-accesslogsetting)  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft wird direkt an die `[AccessLogSetting](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-stage.html#cfn-apigateway-stage-accesslogsetting)` Eigenschaft einer `AWS::ApiGateway::Stage` Ressource übergeben.

 `AlwaysDeploy`   <a name="sam-api-alwaysdeploy"></a>
Stellt die API immer bereit, auch wenn keine Änderungen an der API festgestellt wurden.  
*Typ*: Boolesch  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft ist einzigartig AWS SAM und hat kein CloudFormation Äquivalent.

 `ApiKeySourceType`   <a name="sam-api-apikeysourcetype"></a>
Die Quelle des API-Schlüssels für Messungsanforderungen nach einem Nutzungsplan. Gültige Werte sind `HEADER` und `AUTHORIZER`.  
*Typ:* Zeichenfolge  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft wird direkt an die `[ApiKeySourceType](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-restapi.html#cfn-apigateway-restapi-apikeysourcetype)` Eigenschaft einer `AWS::ApiGateway::RestApi` Ressource übergeben.

 `Auth`   <a name="sam-api-auth"></a>
Konfigurieren Sie die Autorisierung, um den Zugriff auf Ihre API-Gateway-API zu kontrollieren.  
Weitere Informationen zur Konfiguration des Zugriffs mithilfe von AWS SAM finden Sie unter[Kontrollieren Sie den API-Zugriff mit Ihrer AWS SAM Vorlage](serverless-controlling-access-to-apis.md). Ein Beispiel, das zeigt, wie Sie einen globalen Autorisierer überschreiben können, finden Sie unter[Überschreiben Sie einen globalen Autorisierer für Ihre Amazon API Gateway Gateway-REST-API](sam-property-function-apifunctionauth.md#sam-property-function-apifunctionauth--examples--override).  
*Typ:* [ApiAuth](sam-property-api-apiauth.md)  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft ist einzigartig für AWS SAM und hat kein CloudFormation Äquivalent.

 `BinaryMediaTypes`   <a name="sam-api-binarymediatypes"></a>
Liste der MIME-Typen, die Ihre API zurückgeben könnte. Verwenden Sie dies, um die Binärunterstützung für zu aktivierenAPIs.  
*Typ*: Liste  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft ähnelt der `[BinaryMediaTypes](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-restapi.html#cfn-apigateway-restapi-binarymediatypes)` Eigenschaft einer `AWS::ApiGateway::RestApi` Ressource. Die Liste von BinaryMediaTypes wird sowohl der CloudFormation Ressource als auch dem OpenAPI-Dokument hinzugefügt.

 `CacheClusterEnabled`   <a name="sam-api-cacheclusterenabled"></a>
Gibt an, ob das Caching für die Phase aktiviert ist. Um Antworten zwischenzuspeichern, müssen Sie auch `CachingEnabled` auf `true` unter `MethodSettings` setzen.  
*Typ*: Boolesch  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft wird direkt an die `[CacheClusterEnabled](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-stage.html#cfn-apigateway-stage-cacheclusterenabled)` Eigenschaft einer `AWS::ApiGateway::Stage` Ressource übergeben.

 `CacheClusterSize`   <a name="sam-api-cacheclustersize"></a>
Die Cache-Cluster-Größe der Stufe.  
*Typ:* Zeichenfolge  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft wird direkt an die `[CacheClusterSize](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-stage.html#cfn-apigateway-stage-cacheclustersize)` Eigenschaft einer `AWS::ApiGateway::Stage` Ressource übergeben.

 `CanarySetting`   <a name="sam-api-canarysetting"></a>
Konfigurieren Sie eine Canary-Einstellung für eine Phase einer regulären Bereitstellung.  
*Typ:* [CanarySetting](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-stage.html#cfn-apigateway-stage-canarysetting)  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft wird direkt an die `[CanarySetting](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-stage.html#cfn-apigateway-stage-canarysetting)` Eigenschaft einer `AWS::ApiGateway::Stage` Ressource übergeben.

 `Cors`   <a name="sam-api-cors"></a>
Verwalten Sie Cross-Origin Resource Sharing (CORS) für Ihr gesamtes API Gateway. APIs Geben Sie die Domäne, die zugelassen werden soll, als Zeichenfolge an oder geben Sie ein Wörterbuch mit zusätzlicher Cors-Konfiguration an.   
CORS erfordert eine AWS SAM Änderung Ihrer OpenAPI-Definition. Erstellen Sie eine Inline-OpenAPI-Definition in`DefinitionBody`, um CORS zu aktivieren.
Weitere Informationen zu CORS finden Sie unter [Aktivieren von CORS für eine API-Gateway-REST-API-Ressource](https://docs.aws.amazon.com/apigateway/latest/developerguide/how-to-cors.html) im *API Gateway Developer Guide*.  
*Typ: Zeichenfolge* \$1 [CorsConfiguration](sam-property-api-corsconfiguration.md)  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft ist einzigartig für AWS SAM und hat kein CloudFormation Äquivalent.

 `DefinitionBody`   <a name="sam-api-definitionbody"></a>
OpenAPI-Spezifikation, die Ihre API beschreibt. Wenn `DefinitionUri` weder noch angegeben `DefinitionBody` sind, generiert SAM auf der Grundlage Ihrer Vorlagenkonfiguration eine `DefinitionBody` für Sie.  
Verwenden Sie die `AWS::Include` Transformation, um auf eine lokale OpenAPI Datei zu verweisen, die Ihre API definiert. Weitere Informationen hierzu finden Sie unter [Wie werden AWS SAM lokale Dateien hochgeladen](deploy-upload-local-files.md).  
*Type*: JSON  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft ähnelt der `[Body](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-restapi.html#cfn-apigateway-restapi-body)` Eigenschaft einer `AWS::ApiGateway::RestApi` Ressource. Wenn bestimmte Eigenschaften bereitgestellt werden, können Inhalte in die eingefügt oder geändert werden, DefinitionBody bevor sie an sie übergeben werden CloudFormation. Zu den Eigenschaften gehören `Auth` `BinaryMediaTypes``Cors`,`GatewayResponses`,`Models`, und eine `EventSource` vom Typ Api für eine entsprechende`AWS::Serverless::Function`.

 `DefinitionUri`   <a name="sam-api-definitionuri"></a>
Amazon S3 S3-URI, lokaler Dateipfad oder Speicherortobjekt des OpenAPI-Dokuments, das die API definiert. Das Amazon S3 S3-Objekt, auf das diese Eigenschaft verweist, muss eine gültige OpenAPI-Datei sein. Wenn `DefinitionUri` weder noch angegeben `DefinitionBody` sind, generiert SAM auf der Grundlage Ihrer Vorlagenkonfiguration eine `DefinitionBody` für Sie.  
Wenn ein lokaler Dateipfad angegeben wird, muss die Vorlage den Workflow durchlaufen, der den `sam package` Befehl `sam deploy` oder enthält, damit die Definition ordnungsgemäß transformiert wird.  
Systeminterne Funktionen werden in externen OpenApi Dateien, auf die von verwiesen wird, nicht unterstützt. `DefinitionUri` Verwenden Sie stattdessen die `DefinitionBody` Eigenschaft mit der [Include-Transformation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/create-reusable-transform-function-snippets-and-add-to-your-template-with-aws-include-transform.html), um eine OpenApi Definition in die Vorlage zu importieren.  
*Typ*: Zeichenfolge \$1 [ApiDefinition](sam-property-api-apidefinition.md)  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft ähnelt der `[BodyS3Location](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-restapi.html#cfn-apigateway-restapi-bodys3location)` Eigenschaft einer `AWS::ApiGateway::RestApi` Ressource. Die verschachtelten Amazon S3 S3-Eigenschaften sind unterschiedlich benannt.

 `Description`   <a name="sam-api-description"></a>
Eine Beschreibung der Api-Ressource.  
*Typ:* Zeichenfolge  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft wird direkt an die `[Description](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-restapi.html#cfn-apigateway-restapi-description)` Eigenschaft einer `AWS::ApiGateway::RestApi` Ressource übergeben.

 `DisableExecuteApiEndpoint`   <a name="sam-api-disableexecuteapiendpoint"></a>
Gibt an, ob Clients Ihre API mithilfe des `execute-api`-Standardendpunkts aufrufen können. Standardmäßig können Clients Ihre API mit der Standardeinstellung `https://{api_id}.execute-api.{region}.amazonaws.com` aufrufen. Wenn Sie erzwingen möchten, dass Kunden einen benutzerdefinierten Domänennamen verwenden, um Ihre API aufzurufen, geben Sie a `True`.  
*Typ*: Boolesch  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft ähnelt der `[ DisableExecuteApiEndpoint](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-restapi.html#cfn-apigateway-restapi-disableexecuteapiendpoint)` Eigenschaft einer `AWS::ApiGateway::RestApi` Ressource. Sie wird direkt an die `disableExecuteApiEndpoint` Eigenschaft einer `[ x-amazon-apigateway-endpoint-configuration](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-swagger-extensions-endpoint-configuration.html)` Erweiterung übergeben, die der ` [ Body](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-restapi.html#cfn-apigateway-restapi-body)` Eigenschaft einer `AWS::ApiGateway::RestApi` Ressource hinzugefügt wird.

 `Domain`   <a name="sam-api-domain"></a>
Konfiguriert eine benutzerdefinierte Domain für diese API-Gateway-API.  
*Typ:* [DomainConfiguration](sam-property-api-domainconfiguration.md)  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft ist einzigartig für AWS SAM und hat kein CloudFormation Äquivalent.

 `EndpointConfiguration`   <a name="sam-api-endpointconfiguration"></a>
Der Endpunkttyp einer REST-API.  
*Typ:* [EndpointConfiguration](sam-property-api-endpointconfiguration.md)  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft ähnelt der `[EndpointConfiguration](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-restapi.html#cfn-apigateway-restapi-endpointconfiguration)` Eigenschaft einer `AWS::ApiGateway::RestApi` Ressource. Die verschachtelten Konfigurationseigenschaften sind unterschiedlich benannt.

 `FailOnWarnings`   <a name="sam-api-failonwarnings"></a>
Gibt an, ob die API-Erstellung rückgängig gemacht werden soll (`true`) oder nicht (`false`), wenn eine Warnung auftritt. Der Standardwert ist `false`.  
*Typ*: Boolesch  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft wird direkt an die `[FailOnWarnings](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-restapi.html#cfn-apigateway-restapi-failonwarnings)` Eigenschaft einer `AWS::ApiGateway::RestApi` Ressource übergeben.

 `GatewayResponses`   <a name="sam-api-gatewayresponses"></a>
Konfiguriert Gateway-Antworten für eine API. Gateway-Antworten sind Antworten, die von API Gateway entweder direkt oder mithilfe von Lambda-Autorisierern zurückgegeben werden. Weitere Informationen finden Sie in der Dokumentation zur [Api OpenApi Gateway-Erweiterung für Gateway Responses](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-swagger-extensions-gateway-responses.html).  
*Typ*: Karte  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft ist einzigartig für AWS SAM und hat kein CloudFormation Äquivalent.

 `MergeDefinitions`   <a name="sam-api-mergedefinitions"></a>
AWS SAM generiert eine OpenAPI Spezifikation aus Ihrer API-Ereignisquelle. Geben Sie `true` an, dass dies mit der in Ihrer `AWS::Serverless::Api` Ressource definierten OpenAPI Inline-Spezifikation AWS SAM zusammengeführt werden soll. Geben Sie `false` an, dass nicht zusammengeführt werden soll.  
`MergeDefinitions`erfordert, dass die `DefinitionBody` Eigenschaft `AWS::Serverless::Api` für definiert wird. `MergeDefinitions`ist nicht kompatibel mit der `DefinitionUri` Eigenschaft für`AWS::Serverless::Api`.  
*Standardwert*: `false`  
*Typ*: Boolesch  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft ist einzigartig für AWS SAM und hat kein CloudFormation Äquivalent.

 `MethodSettings`   <a name="sam-api-methodsettings"></a>
Konfiguriert alle Einstellungen für die API-Phase, einschließlich Logging, Metrics, CacheTTL und Throttling.  
*Typ*: Liste von [ MethodSetting](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigateway-stage-methodsetting.html)  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft wird direkt an die `[MethodSettings](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-stage.html#cfn-apigateway-stage-methodsettings)` Eigenschaft einer Ressource übergeben. `AWS::ApiGateway::Stage`

 `MinimumCompressionSize`   <a name="sam-api-minimumcompressionsize"></a>
Erlaubt die Komprimierung von Antworttexten auf der Grundlage des Accept-Encoding-Headers des Clients. Die Komprimierung wird ausgelöst, wenn die Größe des Antworttextes größer oder gleich dem konfigurierten Schwellenwert ist. Der maximale Schwellenwert für die Körpergröße beträgt 10 MB (10.485.760 Byte). - Die folgenden Komprimierungstypen werden unterstützt: gzip, deflate und identity.  
*Typ*: Ganzzahl  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft wird direkt an die `[MinimumCompressionSize](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-restapi.html#cfn-apigateway-restapi-minimumcompressionsize)` Eigenschaft einer Ressource übergeben. `AWS::ApiGateway::RestApi`

 `Mode`   <a name="sam-api-mode"></a>
Diese Eigenschaft gilt nur, wenn Sie OpenAPI zur Definition Ihrer REST-API verwenden. Der `Mode` bestimmt, wie API Gateway mit Ressourcen-Updates umgeht. Weitere Informationen finden Sie unter [Mode-Eigenschaft](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-restapi.html#cfn-apigateway-restapi-mode) des [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)Ressourcentyps.  
*Zulässige Werte*: `overwrite` oder `merge`.  
*Typ:* Zeichenfolge  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft wird direkt an die `[Mode](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-restapi.html#cfn-apigateway-restapi-mode)` Eigenschaft einer `AWS::ApiGateway::RestApi` Ressource übergeben.

 `Models`   <a name="sam-api-models"></a>
Die Schemas, die von Ihren API-Methoden verwendet werden sollen. Diese Schemas können mit JSON oder YAML beschrieben werden. Im Abschnitt Beispiele unten auf dieser Seite finden Sie Beispielmodelle.  
*Typ*: Karte  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft ist einzigartig für AWS SAM und hat kein CloudFormation Äquivalent.

 `Name`   <a name="sam-api-name"></a>
Ein Name für die RestApi API-Gateway-Ressource  
*Typ:* Zeichenfolge  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft wird direkt an die `[Name](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-restapi.html#cfn-apigateway-restapi-name)` Eigenschaft einer `AWS::ApiGateway::RestApi` Ressource übergeben.

 `OpenApiVersion`   <a name="sam-api-openapiversion"></a>
Version von OpenApi , die verwendet werden soll. Dies kann entweder `2.0` für die Swagger-Spezifikation oder für eine der OpenApi 3.0-Versionen sein. `3.0.1` Weitere Informationen zu OpenAPI finden Sie in der [OpenAPI-Spezifikation](https://swagger.io/specification/).  
 AWS SAM erstellt eine Stage, die `Stage` standardmäßig aufgerufen wird. Wenn Sie diese Eigenschaft auf einen beliebigen gültigen Wert setzen, wird die Erstellung der Phase verhindert`Stage`. 
*Typ:* Zeichenfolge  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft ist einzigartig für AWS SAM und hat kein CloudFormation Äquivalent.

`PropagateTags`  <a name="sam-api-propagatetags"></a>
Geben Sie an, ob Tags von der `Tags` Eigenschaft an Ihre [AWS::Serverless::Api](sam-specification-generated-resources-api.md) generierten Ressourcen weitergegeben werden sollen oder nicht. Geben Sie `True` an, dass Tags in Ihren generierten Ressourcen verbreitet werden sollen.  
*Typ*: Boolesch  
*Required*: No  
*Standardwert*: `False`  
*CloudFormation Kompatibilität*: Diese Eigenschaft ist einzigartig für AWS SAM und hat kein CloudFormation Äquivalent.

`Policy`  <a name="sam-api-policy"></a>
Ein Richtliniendokument, das die Berechtigungen für die API enthält. Um den ARN für die Richtlinie festzulegen, verwenden Sie die intrinsische `!Join`-Funktion mit `""` als Trennzeichen und die Werte von `"execute-api:/"` und `"*"`.  
*Type*: JSON  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft wird direkt an die [Policy-Eigenschaft](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-restapi.html#cfn-apigateway-restapi-policy) einer `AWS::ApiGateway::RestApi` Ressource übergeben.

 `StageName`   <a name="sam-api-stagename"></a>
Der Name der Stufe, die API Gateway als erstes Pfadsegment im Aufruf-URI (Uniform Resource Identifier) verwendet.  
Um auf die Staging-Ressource zu verweisen, verwenden Sie`<api-logical-id>.Stage`. Weitere Hinweise zum Verweisen auf Ressourcen, die bei der Angabe einer [AWS::Serverless::Api](#sam-resource-api) Ressource generiert werden, finden Sie unter[CloudFormation Ressourcen, die generiert werdenAWS::Serverless::Api, wenn angegeben](sam-specification-generated-resources-api.md). Allgemeine Informationen zu generierten CloudFormation Ressourcen finden Sie unter[Generierte CloudFormation Ressourcen für AWS SAM](sam-specification-generated-resources.md).  
*Typ:* Zeichenfolge  
*Erforderlich*: Ja  
*CloudFormation Kompatibilität*: Diese Eigenschaft ähnelt der `[StageName](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-stage.html#cfn-apigateway-stage-stagename)` Eigenschaft einer `AWS::ApiGateway::Stage` Ressource. Es ist in SAM erforderlich, aber nicht in API Gateway  
*Zusätzliche Hinweise*: Die implizite API hat den Stagennamen „Prod“.

 `Tags`   <a name="sam-api-tags"></a>
Eine Zuordnung (Zeichenfolge zu Zeichenfolge), die die Tags angibt, die zu diesem API-Gateway-Schritt hinzugefügt werden sollen. Einzelheiten zu gültigen Schlüsseln und Werten für Tags finden Sie unter [Resource-Tag](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html) im *AWS CloudFormation Benutzerhandbuch*.  
*Typ*: Karte  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft ähnelt der `[Tags](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-stage.html#cfn-apigateway-stage-tags)` Eigenschaft einer `AWS::ApiGateway::Stage` Ressource. Die Tags-Eigenschaft in SAM besteht aus Key:Value-Paaren; darin besteht CloudFormation sie aus einer Liste von Tag-Objekten.

 `TracingEnabled`   <a name="sam-api-tracingenabled"></a>
Zeigt an, ob aktives Tracing mit X-Ray für die Phase aktiviert ist. Weitere Informationen zu X-Ray finden Sie unter [Tracing user requests to REST APIs using X-Ray](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-xray.html) im *API Gateway Developer Guide*.  
*Typ*: Boolesch  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft wird direkt an die `[TracingEnabled](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-stage.html#cfn-apigateway-stage-tracingenabled)` Eigenschaft einer `AWS::ApiGateway::Stage` Ressource übergeben.

 `Variables`   <a name="sam-api-variables"></a>
Eine Zuordnung (Zeichenfolge zu Zeichenfolge), die die Stufenvariablen definiert, wobei der Variablenname der Schlüssel und der Variablenwert der Wert ist. Variablennamen sind auf alphanumerische Zeichen beschränkt. Werte müssen dem folgenden regulären Ausdruck entsprechen: `[A-Za-z0-9._~:/?#&=,-]+`.  
*Typ*: Karte  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft wird direkt an die `[Variables](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-stage.html#cfn-apigateway-stage-variables)` Eigenschaft einer `AWS::ApiGateway::Stage` Ressource übergeben.

## Rückgabewerte
<a name="sam-resource-api-return-values"></a>

### Punkt
<a name="sam-resource-api-return-values-ref"></a>

Wenn die logische ID dieser Ressource für die `Ref` intrinsische Funktion bereitgestellt wird, gibt sie die ID der zugrunde liegenden API-Gateway-API zurück.

Weitere Informationen zur Verwendung der `Ref` Funktion finden Sie [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)im *AWS CloudFormation Benutzerhandbuch*. 

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

`Fn::GetAtt` gibt einen Wert für ein angegebenes Attribut dieses Typs zurück. Im Folgenden sehen Sie die verfügbaren Attribute und Beispielrückgabewerte. 

Weitere Informationen zur Verwendung `Fn::GetAtt` finden Sie [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)im *AWS CloudFormation Benutzerhandbuch*. 

`RootResourceId`  <a name="RootResourceId-fn::getatt"></a>
Die Stamm-Ressourcen-ID für eine `RestApi`-Ressource, z. B. `a0bc123d4e`.

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

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

Eine Hello AWS SAM World-Vorlagendatei, die eine Lambda-Funktion mit einem API-Endpunkt enthält. Dies ist eine vollständige AWS SAM Vorlagendatei für eine funktionierende serverlose Anwendung.

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

Ein AWS SAM Vorlagenausschnitt mit einer API, die in einer externen Swagger-Datei definiert ist, zusammen mit Lambda-Integrationen und CORS-Konfigurationen. Dies ist nur ein Teil einer Vorlagendatei, der eine Definition zeigt. AWS SAM [AWS::Serverless::Api](#sam-resource-api)

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

Ein AWS SAM Vorlagenausschnitt mit einer API, die Amazon Cognito verwendet, um Anfragen an die API zu autorisieren. Dies ist nur ein Teil einer AWS SAM Vorlagendatei, die eine Definition enthält. [AWS::Serverless::Api](#sam-resource-api)

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

Ein AWS SAM Vorlagenausschnitt mit einer API, die ein Models-Schema enthält. Dies ist nur ein Teil einer AWS SAM Vorlagendatei, die eine [AWS::Serverless::Api](#sam-resource-api) Definition mit zwei Modellschemas zeigt.

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

### Beispiel für Caching
<a name="sam-resource-api--examples--caching-example"></a>

Eine Hello AWS SAM World-Vorlagendatei, die eine Lambda-Funktion mit einem API-Endpunkt enthält. In der API ist das Caching für eine Ressource und Methode aktiviert. Weitere Informationen zum Caching finden Sie unter [Aktivieren von API-Caching zur Verbesserung der Reaktionsfähigkeit](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-caching.html) im *API Gateway* Developer Guide.

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

### Beispiel für eine benutzerdefinierte Domain mit einer privaten API
<a name="sam-resource-api--examples--custom-domain-example"></a>

Eine Hello AWS SAM World-Vorlagendatei, die eine Lambda-Funktion mit einem API-Endpunkt enthält, der einer privaten Domain zugeordnet ist. Die Vorlage erstellt eine Domänenzugriffszuordnung zwischen einem VPC-Endpunkt und der privaten Domain. Weitere Informationen finden Sie unter [Benutzerdefinierte Domainnamen für private APIs in API Gateway](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>

Konfigurieren Sie die Autorisierung, um den Zugriff auf Ihre API-Gateway-API zu kontrollieren.

Weitere Informationen und Beispiele für die Konfiguration des Zugriffs mithilfe von AWS SAM finden Sie unter[Kontrollieren Sie den API-Zugriff mit Ihrer AWS SAM Vorlage](serverless-controlling-access-to-apis.md).

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

Verwenden Sie die folgende Syntax, um diese Entität in Ihrer Vorlage AWS Serverless Application Model (AWS SAM) zu deklarieren.

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

**Anmerkung**  
Die `Authorizers` Eigenschaft beinhaltet`AWS_IAM`, aber dafür ist keine zusätzliche Konfiguration erforderlich`AWS_IAM`. Ein Beispiel finden Sie unter [AWS ICH BIN](#sam-property-api-apiauth--examples--aws_iam).

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

 `AddApiKeyRequiredToCorsPreflight`   <a name="sam-api-apiauth-addapikeyrequiredtocorspreflight"></a>
Wenn die `Cors` Eigenschaften `ApiKeyRequired` und festgelegt sind, führt `AddApiKeyRequiredToCorsPreflight` diese Einstellung dazu, dass der API-Schlüssel der `Options` Eigenschaft hinzugefügt wird.  
*Typ*: Boolesch  
*Required*: No  
*Standardwert*: `True`  
*CloudFormation Kompatibilität*: Diese Eigenschaft ist einzigartig für AWS SAM und hat kein CloudFormation Äquivalent.

 `AddDefaultAuthorizerToCorsPreflight`   <a name="sam-api-apiauth-adddefaultauthorizertocorspreflight"></a>
Wenn die `Cors` Eigenschaften `DefaultAuthorizer` und gesetzt sind, `AddDefaultAuthorizerToCorsPreflight` führt die Einstellung dazu, dass der Standard-Authorizer zur `Options` Eigenschaft im OpenAPI-Abschnitt hinzugefügt wird.  
*Typ*: Boolesch  
*Required*: No  
*Standard*: Wahr  
*CloudFormation Kompatibilität*: Diese Eigenschaft ist einzigartig für AWS SAM und hat kein CloudFormation Äquivalent.

 `ApiKeyRequired`   <a name="sam-api-apiauth-apikeyrequired"></a>
Wenn auf true gesetzt, ist ein API-Schlüssel für alle API-Ereignisse erforderlich. Weitere Informationen zu API-Schlüsseln finden Sie unter [Nutzungspläne mit API-Schlüsseln erstellen und verwenden](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-api-usage-plans.html) im *API Gateway Developer Guide*.  
*Typ*: Boolesch  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft ist einzigartig für AWS SAM und hat kein CloudFormation Äquivalent.

 `Authorizers`   <a name="sam-api-apiauth-authorizers"></a>
Der Autorisierer, der zur Steuerung des Zugriffs auf Ihre API-Gateway-API verwendet wird.  
Weitere Informationen finden Sie unter [Kontrollieren Sie den API-Zugriff mit Ihrer AWS SAM Vorlage](serverless-controlling-access-to-apis.md).  
*Typ*: [CognitoAuthorizer](sam-property-api-cognitoauthorizer.md)\$1 \$1 [LambdaTokenAuthorizer](sam-property-api-lambdatokenauthorizer.md)\$1 [LambdaRequestAuthorizer](sam-property-api-lambdarequestauthorizer.md) AWS\$1IAM  
*Required*: No  
*Standard*: Keiner  
*CloudFormation Kompatibilität*: Diese Eigenschaft ist einzigartig für AWS SAM und hat kein CloudFormation Äquivalent.  
*Zusätzliche Hinweise*: SAM fügt die Authorizer zur OpenApi Definition einer API hinzu.

 `DefaultAuthorizer`   <a name="sam-api-apiauth-defaultauthorizer"></a>
Geben Sie einen Standardautorisierer für eine API-Gateway-API an, der standardmäßig für die Autorisierung von API-Aufrufen verwendet wird.  
Wenn die API EventSource für die mit dieser API verknüpfte Funktion für die Verwendung von IAM-Berechtigungen konfiguriert ist, muss diese Eigenschaft auf gesetzt werden`AWS_IAM`, da andernfalls ein Fehler auftritt.
*Typ:* Zeichenfolge  
*Required*: No  
*Standard*: Keiner  
*CloudFormation Kompatibilität*: Diese Eigenschaft ist einzigartig für AWS SAM und hat kein CloudFormation Äquivalent.

 `InvokeRole`   <a name="sam-api-apiauth-invokerole"></a>
Legt die Integrationsanmeldedaten für alle Ressourcen und Methoden auf diesen Wert fest.  
`CALLER_CREDENTIALS`ordnet zu`arn:aws:iam:::<user>/`, wodurch die Anmeldeinformationen des Anrufers verwendet werden, um den Endpunkt aufzurufen.  
*Gültige Werte*:`CALLER_CREDENTIALS`,, `NONE` `IAMRoleArn`  
*Typ:* Zeichenfolge  
*Required*: No  
*Standardwert*: `CALLER_CREDENTIALS`  
*CloudFormation Kompatibilität*: Diese Eigenschaft ist einzigartig für AWS SAM und hat kein CloudFormation Äquivalent.

 `ResourcePolicy`   <a name="sam-api-apiauth-resourcepolicy"></a>
Konfigurieren Sie die Ressourcenrichtlinie für alle Methoden und Pfade auf einer API.  
*Typ:* [ResourcePolicyStatement](sam-property-api-resourcepolicystatement.md)  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft ist einzigartig für AWS SAM und hat kein CloudFormation Äquivalent.  
*Zusätzliche Hinweise*: Diese Einstellung kann auch individuell `AWS::Serverless::Function` mit dem definiert werden[ApiFunctionAuth](sam-property-function-apifunctionauth.md). Dies ist für APIs with erforderlich`EndpointConfiguration: PRIVATE`.

 `UsagePlan`   <a name="sam-api-apiauth-usageplan"></a>
Konfiguriert einen mit dieser API verknüpften Nutzungsplan. Weitere Informationen zu Nutzungsplänen finden Sie unter [Nutzungspläne mit API-Schlüsseln erstellen und verwenden](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-api-usage-plans.html) im *API Gateway Developer Guide*.  
Diese AWS SAM Eigenschaft generiert drei zusätzliche CloudFormation Ressourcen, wenn diese Eigenschaft festgelegt ist: an [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), an und an [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). Informationen zu diesem Szenario finden Sie unter[UsagePlan Eigenschaft ist spezifiziert](sam-specification-generated-resources-api.md#sam-specification-generated-resources-api-usage-plan). Allgemeine Informationen zu generierten CloudFormation Ressourcen finden Sie unter[Generierte CloudFormation Ressourcen für AWS SAM](sam-specification-generated-resources.md).  
*Typ:* [ApiUsagePlan](sam-property-api-apiusageplan.md)  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft ist einzigartig für AWS SAM und hat kein CloudFormation Äquivalent.

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

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

Beispiel für Cognito Auth

#### 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 ICH BIN
<a name="sam-property-api-apiauth--examples--aws_iam"></a>

AWS IAM-Beispiel

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

```
Auth:
  Authorizers: AWS_IAM
```

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

Konfiguriert einen Nutzungsplan für eine API-Gateway-API. Weitere Informationen zu Nutzungsplänen finden Sie unter [Nutzungspläne mit API-Schlüsseln erstellen und verwenden](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-api-usage-plans.html) im *API Gateway Developer Guide*.

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

Verwenden Sie die folgende Syntax, um diese Entität in Ihrer Vorlage AWS Serverless Application Model (AWS SAM) zu deklarieren.

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

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

 `CreateUsagePlan`   <a name="sam-api-apiusageplan-createusageplan"></a>
Legt fest, wie dieser Nutzungsplan konfiguriert ist. Gültige Werte sind `PER_API`, `SHARED` und `NONE`.  
`PER_API`erstellt [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), und [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)Ressourcen, die für diese API spezifisch sind. Diese Ressourcen haben IDs den logischen Wert von `<api-logical-id>UsagePlan` `<api-logical-id>ApiKey``<api-logical-id>UsagePlanKey`, und.  
`SHARED`erstellt [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), und [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)Ressourcen, die von allen APIs gemeinsam genutzt werden, die auch `CreateUsagePlan: SHARED` in derselben AWS SAM Vorlage enthalten sind. Diese Ressourcen haben IDs den logischen Wert von `ServerlessUsagePlan` `ServerlessApiKey``ServerlessUsagePlanKey`, und. Wenn Sie diese Option verwenden, empfehlen wir, zusätzliche Konfigurationen für diesen Nutzungsplan nur für eine API-Ressource hinzuzufügen, um widersprüchliche Definitionen und einen unsicheren Status zu vermeiden.  
`NONE`deaktiviert die Erstellung oder Verknüpfung eines Nutzungsplans mit dieser API. Dies ist nur erforderlich, wenn `SHARED` oder in der [Abschnitt „Globals“ der Vorlage AWS SAM](sam-specification-template-anatomy-globals.md) angegeben `PER_API` ist.  
*Zulässige Werte*: `PER_API`, `SHARED` und `NONE`  
*Typ:* Zeichenfolge  
*Erforderlich*: Ja  
*CloudFormation Kompatibilität*: Diese Eigenschaft ist einzigartig für AWS SAM und hat kein CloudFormation Äquivalent.

 `Description`   <a name="sam-api-apiusageplan-description"></a>
Eine Beschreibung des Nutzungsplans.  
*Typ:* Zeichenfolge  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft wird direkt an die `[Description](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-usageplan.html#cfn-apigateway-usageplan-description)` Eigenschaft einer `AWS::ApiGateway::UsagePlan` Ressource übergeben.

 `Quota`   <a name="sam-api-apiusageplan-quota"></a>
Konfiguriert die Anzahl von Anforderungen, die Benutzer innerhalb eines bestimmten Intervalls vornehmen können.  
*Typ:* [QuotaSettings](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-usageplan.html#cfn-apigateway-usageplan-quota)  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft wird direkt an die `[Quota](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-usageplan.html#cfn-apigateway-usageplan-quota)` Eigenschaft einer `AWS::ApiGateway::UsagePlan` Ressource übergeben.

 `Tags`   <a name="sam-api-apiusageplan-tags"></a>
Ein Array an beliebigen Tags (Schlüssel-Wert-Paaren), die dem Nutzungsplan zugewiesen werden sollen.  
Diese Eigenschaft verwendet den [CloudFormation Tag-Typ](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html).  
*Typ*: Liste  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft wird direkt an die `[Tags](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-usageplan.html#cfn-apigateway-usageplan-tags)` Eigenschaft einer `AWS::ApiGateway::UsagePlan` Ressource übergeben.

 `Throttle`   <a name="sam-api-apiusageplan-throttle"></a>
Konfiguriert die gesamte Anforderungsrate (durchschnittliche Anforderungen pro Sekunde) und die Steigerungskapazität.  
*Typ:* [ThrottleSettings](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-usageplan.html#cfn-apigateway-usageplan-throttle)  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft wird direkt an die `[Throttle](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-usageplan.html#cfn-apigateway-usageplan-throttle)` Eigenschaft einer `AWS::ApiGateway::UsagePlan` Ressource übergeben.

 `UsagePlanName`   <a name="sam-api-apiusageplan-usageplanname"></a>
Ein Name für den Nutzungsplan.  
*Typ:* Zeichenfolge  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft wird direkt an die `[UsagePlanName](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-usageplan.html#cfn-apigateway-usageplan-usageplanname)` Eigenschaft einer `AWS::ApiGateway::UsagePlan` Ressource übergeben.

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

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

Im Folgenden finden Sie ein Beispiel für einen Nutzungsplan.

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

Definieren Sie einen Amazon Cognito Cognito-Benutzerpool-Autorisierer.

Weitere Informationen und Beispiele finden Sie unter [Kontrollieren Sie den API-Zugriff mit Ihrer AWS SAM Vorlage](serverless-controlling-access-to-apis.md).

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

Verwenden Sie die folgende Syntax, um diese Entität in Ihrer Vorlage AWS Serverless Application Model (AWS SAM) zu deklarieren.

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

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

 `AuthorizationScopes`   <a name="sam-api-cognitoauthorizer-authorizationscopes"></a>
Liste der Autorisierungsbereiche für diesen Autorisierer.  
*Typ*: Liste  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft ist einzigartig für AWS SAM und hat kein CloudFormation Äquivalent.

 `Identity`   <a name="sam-api-cognitoauthorizer-identity"></a>
Diese Eigenschaft kann verwendet werden, um `IdentitySource` in einer eingehenden Anfrage einen Autorisierer anzugeben.  
*Typ:* [CognitoAuthorizationIdentity](sam-property-api-cognitoauthorizationidentity.md)  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft ist einzigartig AWS SAM und hat kein CloudFormation Äquivalent.

 `UserPoolArn`   <a name="sam-api-cognitoauthorizer-userpoolarn"></a>
Kann einem Benutzer pool/specify einen Benutzerpool (ARN) zuweisen, zu dem Sie diesen Cognito-Autorisierer hinzufügen möchten.  
*Typ:* Zeichenfolge  
*Erforderlich*: Ja  
*CloudFormation Kompatibilität*: Diese Eigenschaft ist einzigartig für AWS SAM und hat kein Äquivalent. CloudFormation 

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

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

Beispiel für Cognito Auth

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

Diese Eigenschaft kann verwendet werden, um IdentitySource in einer eingehenden Anfrage nach einem Autorisierer ein anzugeben. Weitere Informationen dazu finden IdentitySource Sie unter der [ApiGateway Authorizer-Erweiterung OpenApi ](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-swagger-extensions-authorizer.html).

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

Verwenden Sie die folgende Syntax, um diese Entität in Ihrer Vorlage AWS Serverless Application Model (AWS SAM) zu deklarieren.

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

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

 `Header`   <a name="sam-api-cognitoauthorizationidentity-header"></a>
Geben Sie den Header-Namen für Authorization in der OpenApi Definition an.  
*Typ:* Zeichenfolge  
*Required*: No  
*Standard*: Autorisierung  
*CloudFormation Kompatibilität*: Diese Eigenschaft ist einzigartig für AWS SAM und hat kein CloudFormation Äquivalent.

 `ReauthorizeEvery`   <a name="sam-api-cognitoauthorizationidentity-reauthorizeevery"></a>
Der Zeitraum time-to-live (TTL) in Sekunden, der angibt, wie lange API Gateway Autorisierungsergebnisse zwischenspeichert. Wenn Sie einen Wert größer als 0 festlegen, speichert API Gateway die Genehmigerantworten im Cache. Standardmäßig legt API Gateway diese Eigenschaft auf 300 fest. Der maximale Wert ist 3600, oder 1 Stunde.  
*Typ*: Ganzzahl  
*Required*: No  
*Standard: 300*  
*CloudFormation Kompatibilität*: Diese Eigenschaft ist einzigartig für AWS SAM und hat kein CloudFormation Äquivalent.

 `ValidationExpression`   <a name="sam-api-cognitoauthorizationidentity-validationexpression"></a>
Geben Sie einen Validierungsausdruck für die Validierung der eingehenden Identität an  
*Typ:* Zeichenfolge  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft ist einzigartig für AWS SAM und hat kein CloudFormation Äquivalent.

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

Konfigurieren Sie einen Lambda Authorizer, um den Zugriff auf Ihre API mit einer Lambda-Funktion zu kontrollieren.

Weitere Informationen und Beispiele finden Sie unter [Kontrollieren Sie den API-Zugriff mit Ihrer AWS SAM Vorlage](serverless-controlling-access-to-apis.md).

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

Verwenden Sie die folgende Syntax, um diese Entität in Ihrer Vorlage AWS Serverless Application Model (AWS SAM) zu deklarieren.

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

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

 `DisableFunctionDefaultPermissions`   <a name="sam-api-lambdarequestauthorizer-disablefunctiondefaultpermissions"></a>
Geben Sie `true` an, dass nicht AWS SAM automatisch eine `AWS::Lambda::Permissions` Ressource erstellt wird, um Berechtigungen zwischen Ihrer `AWS::Serverless::Api` Ressource und der Autorisierungs-Lambda-Funktion bereitzustellen.  
*Standardwert*: `false`  
*Typ*: Boolesch  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft ist einzigartig für AWS SAM und hat kein CloudFormation Äquivalent.

 `FunctionArn`   <a name="sam-api-lambdarequestauthorizer-functionarn"></a>
Geben Sie den Funktions-ARN der Lambda-Funktion an, die die Autorisierung für die API bereitstellt.  
AWS SAM erstellt automatisch eine `AWS::Lambda::Permissions` Ressource, wenn dies angegeben `FunctionArn` ist. `AWS::Serverless::Api` Die `AWS::Lambda::Permissions` Ressource stellt Berechtigungen zwischen Ihrer API und der Autorisierungs-Lambda-Funktion bereit.
*Typ:* Zeichenfolge  
*Erforderlich*: Ja  
*CloudFormation Kompatibilität*: Diese Eigenschaft ist einzigartig für AWS SAM und hat kein CloudFormation Äquivalent.

 `FunctionInvokeRole`   <a name="sam-api-lambdarequestauthorizer-functioninvokerole"></a>
Fügt der OpenApi Definition des Lambda-Autorisierers Autorisierer-Anmeldeinformationen hinzu.  
*Typ:* Zeichenfolge  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft ist einzigartig für AWS SAM und hat kein Äquivalent. CloudFormation 

 `FunctionPayloadType`   <a name="sam-api-lambdarequestauthorizer-functionpayloadtype"></a>
Diese Eigenschaft kann verwendet werden, um den Typ des Lambda Authorizers für eine API zu definieren.  
*Zulässige Werte*: `TOKEN` oder `REQUEST`.  
*Typ:* Zeichenfolge  
*Required*: No  
*Standardwert*: `TOKEN`  
*CloudFormation Kompatibilität*: Diese Eigenschaft ist einzigartig AWS SAM und hat kein CloudFormation Äquivalent.

 `Identity`   <a name="sam-api-lambdarequestauthorizer-identity"></a>
Diese Eigenschaft kann verwendet werden, um `IdentitySource` in einer eingehenden Anfrage einen Autorisierer anzugeben. Diese Eigenschaft ist nur erforderlich, wenn die `FunctionPayloadType` Eigenschaft auf `REQUEST` gesetzt ist.  
*Typ:* [LambdaRequestAuthorizationIdentity](sam-property-api-lambdarequestauthorizationidentity.md)  
*Required*: Conditional  
*CloudFormation Kompatibilität*: Diese Eigenschaft ist einzigartig für AWS SAM und hat kein CloudFormation Äquivalent.

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

Diese Eigenschaft kann verwendet werden, um IdentitySource in einer eingehenden Anfrage nach einem Autorisierer ein anzugeben. Weitere Informationen dazu finden IdentitySource Sie unter der [ApiGateway Authorizer-Erweiterung OpenApi ](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-swagger-extensions-authorizer.html).

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

Verwenden Sie die folgende Syntax, um diese Entität in Ihrer Vorlage AWS Serverless Application Model (AWS SAM) zu deklarieren.

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

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

 `Context`   <a name="sam-api-lambdarequestauthorizationidentity-context"></a>
Konvertiert die angegebenen Kontextzeichenfolgen in die Mapping-Ausdrücke des Formats`context.contextString`.  
*Typ*: Liste  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft ist einzigartig für AWS SAM und hat kein CloudFormation Äquivalent.

 `Headers`   <a name="sam-api-lambdarequestauthorizationidentity-headers"></a>
Konvertiert die Header in eine durch Kommas getrennte Zeichenfolge von Zuordnungsausdrücken des Formats. `method.request.header.name`  
*Typ*: Liste  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft ist einzigartig für AWS SAM und hat kein Äquivalent. CloudFormation 

 `QueryStrings`   <a name="sam-api-lambdarequestauthorizationidentity-querystrings"></a>
Konvertiert die angegebenen Abfragezeichenfolgen in eine durch Kommas getrennte Zeichenfolge von Zuordnungsausdrücken des Formats. `method.request.querystring.queryString`  
*Typ*: Liste  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft ist einzigartig für AWS SAM und hat kein CloudFormation Äquivalent.

 `ReauthorizeEvery`   <a name="sam-api-lambdarequestauthorizationidentity-reauthorizeevery"></a>
Der Zeitraum time-to-live (TTL) in Sekunden, der angibt, wie lange API Gateway Autorisierungsergebnisse zwischenspeichert. Wenn Sie einen Wert größer als 0 festlegen, speichert API Gateway die Genehmigerantworten im Cache. Standardmäßig legt API Gateway diese Eigenschaft auf 300 fest. Der maximale Wert ist 3600, oder 1 Stunde.  
*Typ*: Ganzzahl  
*Required*: No  
*Standard: 300*  
*CloudFormation Kompatibilität*: Diese Eigenschaft ist einzigartig für AWS SAM und hat kein CloudFormation Äquivalent.

 `StageVariables`   <a name="sam-api-lambdarequestauthorizationidentity-stagevariables"></a>
Konvertiert die angegebenen Stufenvariablen in eine durch Kommas getrennte Zeichenfolge von Zuordnungsausdrücken des Formats. `stageVariables.stageVariable`  
*Typ*: Liste  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft ist einzigartig für AWS SAM und hat kein CloudFormation Äquivalent.

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

Konfigurieren Sie einen Lambda Authorizer, um den Zugriff auf Ihre API mit einer Lambda-Funktion zu kontrollieren.

Weitere Informationen und Beispiele finden Sie unter [Kontrollieren Sie den API-Zugriff mit Ihrer AWS SAM Vorlage](serverless-controlling-access-to-apis.md).

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

Verwenden Sie die folgende Syntax, um diese Entität in Ihrer Vorlage AWS Serverless Application Model (AWS SAM) zu deklarieren.

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

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

 `DisableFunctionDefaultPermissions`   <a name="sam-api-lambdatokenauthorizer-disablefunctiondefaultpermissions"></a>
Geben Sie `true` an, dass nicht AWS SAM automatisch eine `AWS::Lambda::Permissions` Ressource erstellt wird, um Berechtigungen zwischen Ihrer `AWS::Serverless::Api` Ressource und der Autorisierungs-Lambda-Funktion bereitzustellen.  
*Standardwert*: `false`  
*Typ*: Boolesch  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft ist einzigartig für AWS SAM und hat kein CloudFormation Äquivalent.

 `FunctionArn`   <a name="sam-api-lambdatokenauthorizer-functionarn"></a>
Geben Sie den Funktions-ARN der Lambda-Funktion an, die die Autorisierung für die API bereitstellt.  
AWS SAM erstellt automatisch eine `AWS::Lambda::Permissions` Ressource, wenn dies angegeben `FunctionArn` ist. `AWS::Serverless::Api` Die `AWS::Lambda::Permissions` Ressource stellt Berechtigungen zwischen Ihrer API und der Autorisierungs-Lambda-Funktion bereit.
*Typ:* Zeichenfolge  
*Erforderlich*: Ja  
*CloudFormation Kompatibilität*: Diese Eigenschaft ist einzigartig für AWS SAM und hat kein CloudFormation Äquivalent.

 `FunctionInvokeRole`   <a name="sam-api-lambdatokenauthorizer-functioninvokerole"></a>
Fügt der OpenApi Definition des Lambda-Autorisierers Autorisierer-Anmeldeinformationen hinzu.  
*Typ:* Zeichenfolge  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft ist einzigartig für AWS SAM und hat kein Äquivalent. CloudFormation 

 `FunctionPayloadType`   <a name="sam-api-lambdatokenauthorizer-functionpayloadtype"></a>
Diese Eigenschaft kann verwendet werden, um den Typ des Lambda Authorizers für eine Api zu definieren.  
*Zulässige Werte*: `TOKEN` oder `REQUEST`.  
*Typ:* Zeichenfolge  
*Required*: No  
*Standardwert*: `TOKEN`  
*CloudFormation Kompatibilität*: Diese Eigenschaft ist einzigartig AWS SAM und hat kein CloudFormation Äquivalent.

 `Identity`   <a name="sam-api-lambdatokenauthorizer-identity"></a>
Diese Eigenschaft kann verwendet werden, um `IdentitySource` in einer eingehenden Anfrage einen Autorisierer anzugeben. Diese Eigenschaft ist nur erforderlich, wenn die `FunctionPayloadType` Eigenschaft auf `REQUEST` gesetzt ist.  
*Typ:* [LambdaTokenAuthorizationIdentity](sam-property-api-lambdatokenauthorizationidentity.md)  
*Required*: Conditional  
*CloudFormation Kompatibilität*: Diese Eigenschaft ist einzigartig für AWS SAM und hat kein CloudFormation Äquivalent.

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

Diese Eigenschaft kann verwendet werden, um IdentitySource in einer eingehenden Anfrage einen Autorisierer anzugeben. Weitere Informationen dazu finden IdentitySource Sie unter der [ApiGateway Authorizer-Erweiterung OpenApi ](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-swagger-extensions-authorizer.html).

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

 Verwenden Sie die folgende Syntax, um diese Entität in Ihrer Vorlage AWS Serverless Application Model (AWS SAM) zu deklarieren. 

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

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

 `Header`   <a name="sam-api-lambdatokenauthorizationidentity-header"></a>
Geben Sie den Header-Namen für Authorization in der OpenApi Definition an.  
*Typ:* Zeichenfolge  
*Required*: No  
*Standard*: Autorisierung  
*CloudFormation Kompatibilität*: Diese Eigenschaft ist einzigartig für AWS SAM und hat kein CloudFormation Äquivalent.

 `ReauthorizeEvery`   <a name="sam-api-lambdatokenauthorizationidentity-reauthorizeevery"></a>
Der Zeitraum time-to-live (TTL) in Sekunden, der angibt, wie lange API Gateway Autorisierungsergebnisse zwischenspeichert. Wenn Sie einen Wert größer als 0 festlegen, speichert API Gateway die Genehmigerantworten im Cache. Standardmäßig legt API Gateway diese Eigenschaft auf 300 fest. Der maximale Wert ist 3600, oder 1 Stunde.  
*Typ*: Ganzzahl  
*Required*: No  
*Standard: 300*  
*CloudFormation Kompatibilität*: Diese Eigenschaft ist einzigartig für AWS SAM und hat kein CloudFormation Äquivalent.

 `ValidationExpression`   <a name="sam-api-lambdatokenauthorizationidentity-validationexpression"></a>
Geben Sie einen Validierungsausdruck für die Validierung der eingehenden Identität an.  
*Typ:* Zeichenfolge  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft ist einzigartig für AWS SAM und hat kein CloudFormation Äquivalent.

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

Konfiguriert eine Ressourcenrichtlinie für alle Methoden und Pfade einer API. Weitere Informationen zu Ressourcenrichtlinien finden Sie unter [Steuern des Zugriffs auf eine API mit API-Gateway-Ressourcenrichtlinien](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-resource-policies.html) im *API Gateway Developer Guide*.

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

Verwenden Sie die folgende Syntax, um diese Entität in Ihrer Vorlage AWS Serverless Application Model (AWS SAM) zu deklarieren.

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

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

 `AwsAccountBlacklist`   <a name="sam-api-resourcepolicystatement-awsaccountblacklist"></a>
Die zu blockierenden AWS Konten.  
*Typ*: Liste von Zeichenfolgen  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft ist einzigartig AWS SAM und hat kein CloudFormation Äquivalent.

 `AwsAccountWhitelist`   <a name="sam-api-resourcepolicystatement-awsaccountwhitelist"></a>
Die AWS Konten, die zugelassen werden sollen. Ein Beispiel für die Verwendung dieser Eigenschaft finden Sie im Abschnitt Beispiele unten auf dieser Seite.  
*Typ*: Liste von Zeichenfolgen  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft ist einzigartig für AWS SAM und hat kein CloudFormation Äquivalent.

 `CustomStatements`   <a name="sam-api-resourcepolicystatement-customstatements"></a>
Eine Liste von benutzerdefinierten Ressourcenrichtlinien-Anweisungen, die auf diese API angewendet werden sollen. Ein Beispiel für die Verwendung dieser Eigenschaft finden Sie im Abschnitt Beispiele unten auf dieser Seite.  
*Typ*: Liste  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft ist einzigartig für AWS SAM und hat kein CloudFormation Äquivalent.

 `IntrinsicVpcBlacklist`   <a name="sam-api-resourcepolicystatement-intrinsicvpcblacklist"></a>
Die Liste der zu blockierenden virtuellen privaten Clouds (VPCs), wobei jede VPC als Referenz angegeben ist, z. B. als [dynamische Referenz](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/dynamic-references.html) oder als `Ref` [intrinsische Funktion](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-ref.html). Ein Beispiel für die Verwendung dieser Eigenschaft finden Sie im Abschnitt Beispiele unten auf dieser Seite.  
*Typ*: Liste  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft ist einzigartig für AWS SAM und hat kein CloudFormation Äquivalent.

 `IntrinsicVpcWhitelist`   <a name="sam-api-resourcepolicystatement-intrinsicvpcwhitelist"></a>
Die Liste der VPCs Zulässigen, wobei jede VPC als Referenz angegeben wird, z. B. als [dynamische Referenz](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/dynamic-references.html) oder als `Ref` [intrinsische Funktion](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-ref.html).  
*Typ*: Liste  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft ist einzigartig AWS SAM und hat kein Äquivalent. CloudFormation 

 `IntrinsicVpceBlacklist`   <a name="sam-api-resourcepolicystatement-intrinsicvpceblacklist"></a>
[Die Liste der zu blockierenden VPC-Endpunkte, wobei jeder VPC-Endpunkt als Referenz angegeben ist, z. B. als [dynamische Referenz oder als intrinsische](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/dynamic-references.html) Funktion. `Ref`](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-ref.html)  
*Typ*: Liste  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft ist einzigartig für AWS SAM und hat kein Äquivalent. CloudFormation 

 `IntrinsicVpceWhitelist`   <a name="sam-api-resourcepolicystatement-intrinsicvpcewhitelist"></a>
[Die Liste der VPC-Endpunkte, die zugelassen werden sollen, wobei jeder VPC-Endpunkt als Referenz angegeben ist, z. B. als [dynamische Referenz](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/dynamic-references.html) oder als systemeigene Funktion. `Ref`](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-ref.html) Ein Beispiel für die Verwendung dieser Eigenschaft finden Sie im Abschnitt Beispiele unten auf dieser Seite.  
*Typ*: Liste  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft ist einzigartig für AWS SAM und hat kein CloudFormation Äquivalent.

 `IpRangeBlacklist`   <a name="sam-api-resourcepolicystatement-iprangeblacklist"></a>
Die IP-Adressen oder Adressbereiche, die blockiert werden sollen. Ein Beispiel für die Verwendung dieser Eigenschaft finden Sie im Abschnitt Beispiele unten auf dieser Seite.  
*Typ*: Liste  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft ist einzigartig für AWS SAM und hat kein CloudFormation Äquivalent.

 `IpRangeWhitelist`   <a name="sam-api-resourcepolicystatement-iprangewhitelist"></a>
Die IP-Adressen oder Adressbereiche, die zugelassen werden sollen.  
*Typ*: Liste  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft ist einzigartig für AWS SAM und hat kein CloudFormation Äquivalent.

 `SourceVpcBlacklist`   <a name="sam-api-resourcepolicystatement-sourcevpcblacklist"></a>
Die Quell-VPC oder die VPC-Endpoints, die blockiert werden sollen. Quell-VPC-Namen müssen mit beginnen `"vpc-"` und Quell-VPC-Endpunktnamen müssen mit beginnen. `"vpce-"` Ein Beispiel für die Verwendung dieser Eigenschaft finden Sie im Abschnitt Beispiele unten auf dieser Seite.  
*Typ*: Liste  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft ist einzigartig für AWS SAM und hat kein CloudFormation Äquivalent.

 `SourceVpcWhitelist`   <a name="sam-api-resourcepolicystatement-sourcevpcwhitelist"></a>
Die Quell-VPC oder VPC-Endpoints, die zugelassen werden sollen. Quell-VPC-Namen müssen mit beginnen `"vpc-"` und Quell-VPC-Endpunktnamen müssen mit beginnen. `"vpce-"`  
*Typ*: Liste  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft ist einzigartig für AWS SAM und hat kein CloudFormation Äquivalent.

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

### Beispiel für eine Ressourcenrichtlinie
<a name="sam-property-api-resourcepolicystatement--examples--resource-policy-example"></a>

Das folgende Beispiel blockiert zwei IP-Adressen und eine Quell-VPC und lässt ein AWS Konto zu.

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

Ein OpenAPI-Dokument, das die API definiert.

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

Verwenden Sie die folgende Syntax, um diese Entität in Ihrer Vorlage AWS Serverless Application Model (AWS SAM) zu deklarieren.

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

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

 `Bucket`   <a name="sam-api-apidefinition-bucket"></a>
Der Name des Amazon S3 S3-Buckets, in dem die OpenAPI-Datei gespeichert ist.  
*Typ:* Zeichenfolge  
*Erforderlich*: Ja  
*CloudFormation Kompatibilität*: Diese Eigenschaft wird direkt an die `[Bucket](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigateway-restapi-s3location.html#cfn-apigateway-restapi-s3location-bucket)` Eigenschaft des `AWS::ApiGateway::RestApi` `S3Location` Datentyps übergeben.

 `Key`   <a name="sam-api-apidefinition-key"></a>
Der Amazon S3 S3-Schlüssel der OpenAPI-Datei.  
*Typ:* Zeichenfolge  
*Erforderlich*: Ja  
*CloudFormation Kompatibilität*: Diese Eigenschaft wird direkt an die `[Key](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigateway-restapi-s3location.html#cfn-apigateway-restapi-s3location-key)` Eigenschaft des `AWS::ApiGateway::RestApi` `S3Location` Datentyps übergeben.

 `Version`   <a name="sam-api-apidefinition-version"></a>
Für versionierte Objekte die Version der OpenAPI-Datei.  
*Typ:* Zeichenfolge  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft wird direkt an die `[Version](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigateway-restapi-s3location.html#cfn-apigateway-restapi-s3location-version)` Eigenschaft des `AWS::ApiGateway::RestApi` `S3Location` Datentyps übergeben.

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

### Definition: Uri, Beispiel.
<a name="sam-property-api-apidefinition--examples--definition-uri-example"></a>

Beispiel für eine API-Definition

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

Verwalten Sie Cross-Origin Resource Sharing (CORS) für Ihr API Gateway. APIs Geben Sie die Domäne, die zugelassen werden soll, als Zeichenfolge an oder geben Sie ein Wörterbuch mit zusätzlicher Cors-Konfiguration an.

**Anmerkung**  
CORS erfordert eine AWS SAM Änderung Ihrer OpenAPI-Definition. Erstellen Sie eine Inline-OpenAPI-Definition in`DefinitionBody`, um CORS zu aktivieren. Wenn `CorsConfiguration` das in der OpenAPI-Definition und auch auf Eigenschaftsebene festgelegt ist, werden sie AWS SAM zusammengeführt. Die Eigenschaftsebene hat Vorrang vor der OpenAPI-Definition.

Weitere Informationen zu CORS finden Sie unter [Aktivieren von CORS für eine API-Gateway-REST-API-Ressource](https://docs.aws.amazon.com/apigateway/latest/developerguide/how-to-cors.html) im *API Gateway Developer Guide*.

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

Verwenden Sie die folgende Syntax, um diese Entität in Ihrer Vorlage AWS Serverless Application Model (AWS SAM) zu deklarieren.

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

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

 `AllowCredentials`   <a name="sam-api-corsconfiguration-allowcredentials"></a>
Boolescher Wert, der angibt, ob die Anfrage Anmeldeinformationen enthalten darf.  
*Typ*: Boolesch  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft ist einzigartig für AWS SAM und hat kein CloudFormation Äquivalent.

 `AllowHeaders`   <a name="sam-api-corsconfiguration-allowheaders"></a>
Zeichenfolge von Headern, die zugelassen werden sollen.  
*Typ:* Zeichenfolge  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft ist einzigartig für AWS SAM und hat kein CloudFormation Äquivalent.

 `AllowMethods`   <a name="sam-api-corsconfiguration-allowmethods"></a>
Zeichenfolge, die die zuzulassenden HTTP-Methoden enthält.  
*Typ:* Zeichenfolge  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft ist einzigartig für AWS SAM und hat kein CloudFormation Äquivalent.

 `AllowOrigin`   <a name="sam-api-corsconfiguration-alloworigin"></a>
Quellzeichenfolge, die zugelassen werden soll. Dies kann eine durch Kommas getrennte Liste im Zeichenkettenformat sein.  
*Typ:* Zeichenfolge  
*Erforderlich*: Ja  
*CloudFormation Kompatibilität*: Diese Eigenschaft ist einzigartig für AWS SAM und hat kein CloudFormation Äquivalent.

 `MaxAge`   <a name="sam-api-corsconfiguration-maxage"></a>
Zeichenfolge, die die Anzahl der Sekunden enthält, um die CORS-Preflight-Anfrage zwischenzuspeichern.  
*Typ:* Zeichenfolge  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft ist einzigartig für AWS SAM und hat kein CloudFormation Äquivalent.

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

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

Beispiel für eine CORS-Konfiguration. Dies ist nur ein Teil einer AWS SAM Vorlagendatei, die eine [AWS::Serverless::Api](sam-resource-api.md) Definition mit konfiguriertem CORS und einem zeigt. [AWS::Serverless::Function](sam-resource-function.md) Wenn Sie eine Lambda-Proxyintegration oder eine HTTP-Proxyintegration verwenden, muss Ihr Backend die Header `Access-Control-Allow-Origin``Access-Control-Allow-Methods`, und `Access-Control-Allow-Headers` zurückgeben.

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

Konfiguriert eine benutzerdefinierte Domain für eine API.

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

Verwenden Sie die folgende Syntax, um diese Entität in Ihrer Vorlage AWS Serverless Application Model (AWS SAM) zu deklarieren.

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

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

 `AccessAssociation`   <a name="sam-api-domainconfiguration-domainaccessassociation"></a>
Die Konfiguration, die zum Generieren der ` AWS::ApiGateway::DomainNameAccessAssociation` Ressource erforderlich ist.  
AWS SAM generiert eine [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)Ressource, wenn diese Eigenschaft festgelegt ist. Hinweise zu generierten CloudFormation Ressourcen finden Sie unter[Generierte CloudFormation Ressourcen für AWS SAM](sam-specification-generated-resources.md).  
*Typ:* [DomainAccessAssociation](sam-property-api-domainaccessassociation.md)  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft ist einzigartig für AWS SAM und hat kein CloudFormation Äquivalent.

 `BasePath`   <a name="sam-api-domainconfiguration-basepath"></a>
Eine Liste der Basepfade, die mit dem Amazon API Gateway Gateway-Domänennamen konfiguriert werden sollen.  
*Typ*: Liste  
*Required*: No  
*Standard:/*  
*CloudFormation Kompatibilität*: Diese Eigenschaft ähnelt der `[BasePath](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-basepathmapping.html#cfn-apigateway-basepathmapping-basepath)` Eigenschaft einer `AWS::ApiGateway::BasePathMapping` Ressource. AWS SAM erstellt mehrere `AWS::ApiGateway::BasePathMapping` Ressourcen, eine pro, die in dieser Eigenschaft `BasePath` angegeben ist.

 `CertificateArn`   <a name="sam-api-domainconfiguration-certificatearn"></a>
Der Amazon-Ressourcenname (ARN) eines AWS verwalteten Zertifikats, der Endpunkt dieses Domainnamens. AWS Certificate Manager ist die einzige unterstützte Quelle.  
*Typ:* Zeichenfolge  
*Erforderlich*: Ja  
*CloudFormation Kompatibilität*: Diese Eigenschaft ähnelt der `[CertificateArn](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-domainname.html#cfn-apigateway-domainname-certificatearn)` Eigenschaft einer `AWS::ApiGateway::DomainName` Ressource. Wenn auf `REGIONAL` (der Standardwert) gesetzt `EndpointConfiguration` ist, `CertificateArn` wird [RegionalCertificateArn](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-domainname.html#cfn-apigateway-domainname-regionalcertificatearn)in zugeordnet`AWS::ApiGateway::DomainName`. Wenn der auf gesetzt `EndpointConfiguration` ist`EDGE`, `CertificateArn` wird [CertificateArn](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-domainname.html#cfn-apigateway-domainname-certificatearn)in zugeordnet`AWS::ApiGateway::DomainName`. Wenn auf gesetzt `EndpointConfiguration` ist`PRIVATE`, wird diese Eigenschaft an die [AWS::ApiGateway::DomainNameV2-Ressource](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-domainnamev2) übergeben.  
*Zusätzliche Hinweise*: Für einen `EDGE` Endpunkt müssen Sie das Zertifikat in der `us-east-1` AWS Region erstellen.

 `DomainName`   <a name="sam-api-domainconfiguration-domainname"></a>
Der benutzerdefinierte Domainname für Ihre API-Gateway-API. Großbuchstaben werden nicht unterstützt.  
AWS SAM generiert eine [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)Ressource, wenn diese Eigenschaft festgelegt ist. Hinweise zu diesem Szenario finden Sie unter[DomainName Eigenschaft ist angegeben](sam-specification-generated-resources-api.md#sam-specification-generated-resources-api-domain-name). Hinweise zu generierten CloudFormation Ressourcen finden Sie unter[Generierte CloudFormation Ressourcen für AWS SAM](sam-specification-generated-resources.md).  
*Typ:* Zeichenfolge  
*Erforderlich*: Ja  
*CloudFormation Kompatibilität*: Diese Eigenschaft wird direkt an die `[DomainName](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-domainname.html#cfn-apigateway-domainname-domainname)` Eigenschaft einer `AWS::ApiGateway::DomainName` Ressource übergeben, oder an [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-domainnamev2](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-domainnamev2)when, auf gesetzt EndpointConfiguration ist`PRIVATE`.

 `EndpointConfiguration`   <a name="sam-api-domainconfiguration-endpointconfiguration"></a>
Definiert den Typ des API-Gateway-Endpunkts, der der benutzerdefinierten Domain zugeordnet werden soll. Der Wert dieser Eigenschaft bestimmt, wie die `CertificateArn` Eigenschaft zugeordnet wird. CloudFormation  
*Gültige Werte*: `EDGE`, `REGIONAL`, oder `PRIVATE`  
*Typ:* Zeichenfolge  
*Required*: No  
*Standardwert*: `REGIONAL`  
*CloudFormation Kompatibilität*: Diese Eigenschaft ist einzigartig für AWS SAM und hat kein CloudFormation Äquivalent.

 `MutualTlsAuthentication`   <a name="sam-api-domainconfiguration-mutualtlsauthentication"></a>
Die TLS-Authentifizierungskonfiguration (Mutual Transport Layer Security) für einen benutzerdefinierten Domainnamen.  
*Typ:* [MutualTlsAuthentication](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-domainname.html#cfn-apigateway-domainname-mutualtlsauthentication)  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft wird direkt an die `[MutualTlsAuthentication](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-domainname.html#cfn-apigateway-domainname-mutualtlsauthentication)` Eigenschaft einer `AWS::ApiGateway::DomainName` Ressource übergeben.

 `NormalizeBasePath`   <a name="sam-api-domainconfiguration-normalizebasepath"></a>
Gibt an, ob nicht-alphanumerische Zeichen in den durch die Eigenschaft definierten Basepfaden zulässig sind. `BasePath` Wenn auf gesetzt, werden nicht-alphanumerische Zeichen aus `True` Basepfaden entfernt.  
Wird zusammen mit der Eigenschaft verwendet. `NormalizeBasePath` `BasePath`  
*Typ*: Boolesch  
*Required*: No  
*Standard*: Wahr  
*CloudFormation Kompatibilität*: Diese Eigenschaft ist einzigartig für AWS SAM und hat kein CloudFormation Äquivalent.

 `OwnershipVerificationCertificateArn`   <a name="sam-api-domainconfiguration-ownershipverificationcertificatearn"></a>
Die ARN des öffentlichen Zertifikats, das von ACM ausgestellt wurde, um den Besitz Ihrer benutzerdefinierten Domain zu überprüfen. Nur erforderlich, wenn Sie Mutual TLS konfigurieren und einen von ACM importierten oder privaten CA-Zertifikat-ARN für angeben. `CertificateArn`  
*Typ:* Zeichenfolge  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft wird direkt an die `[OwnershipVerificationCertificateArn](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-domainname.html#cfn-apigateway-domainname-ownershipverificationcertificatearn)` Eigenschaft einer `AWS::ApiGateway::DomainName` Ressource übergeben.

 `Policy`   <a name="sam-api-domainconfiguration-policy"></a>
Die IAM-Richtlinie, die an den API-Gateway-Domänennamen angehängt werden soll. Gilt nur, wenn auf `PRIVATE` eingestellt `EndpointConfiguration` ist.  
*Type*: Json  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft wird direkt an die `Policy` Eigenschaft einer `AWS::ApiGateway::DomainNameV2` Ressource übergeben, wenn sie auf gesetzt `EndpointConfiguration` ist`PRIVATE`. Beispiele für gültige Richtliniendokumente finden Sie unter [AWS::ApiGateway::DomainNameV2](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-domainnamev2).

 `Route53`   <a name="sam-api-domainconfiguration-route53"></a>
Definiert eine Amazon Route 53-Konfiguration.  
*Typ*: [Route53-Konfiguration](sam-property-api-route53configuration.md)  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft ist einzigartig für AWS SAM und hat kein Äquivalent. CloudFormation 

 `SecurityPolicy`   <a name="sam-api-domainconfiguration-securitypolicy"></a>
Die TLS-Version plus die Cipher Suite für diesen Domainnamen.  
*Typ:* Zeichenfolge  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft wird direkt an die `[SecurityPolicy](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-domainname.html#cfn-apigateway-domainname-securitypolicy)` Eigenschaft einer `AWS::ApiGateway::DomainName` Ressource übergeben, oder an [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-domainnamev2](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-domainnamev2)when `EndpointConfiguration` ist auf gesetzt. `PRIVATE` Für `PRIVATE` Endgeräte wird nur TLS\$11\$12 unterstützt.

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

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

DomainName Beispiel

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

Konfiguriert eine Domänenzugriffszuordnung zwischen einer Zugriffszuordnungsquelle und einem privaten benutzerdefinierten Domänennamen. Die einzige unterstützte Quelle für die Zugriffszuweisung ist eine VPC-Endpunkt-ID. Weitere Informationen finden Sie unter [Benutzerdefinierte Domainnamen für private APIs in API Gateway](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-private-custom-domains.html).

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

Verwenden Sie die folgende Syntax, um diese Entität in Ihrer Vorlage AWS Serverless Application Model (AWS SAM) zu deklarieren.

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

```
 VpcEndpointId: String
```

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

 `VpcEndpointId`   <a name="sam-api-domainaccessassociation-vpcendpointid"></a>
Die Endpunkt-ID des VPC-Schnittstellenendpunkts, der dem API Gateway VPC-Dienst zugeordnet ist.  
*Typ:* Zeichenfolge  
*Erforderlich*: Ja  
*CloudFormation Kompatibilität*: Diese Eigenschaft wird direkt an die `[ AccessAssociationSource](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-domainnameaccessassociation.html#cfn-apigateway-domainnameaccessassociation-accessassociationsource)` Eigenschaft einer `AWS::ApiGateway::DomainNameAccessAssociation` Ressource übergeben.

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

Konfiguriert die Route53-Datensätze für eine API.

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

Verwenden Sie die folgende Syntax, um diese Entität in Ihrer AWS Serverless Application Model (AWS SAM) -Vorlage zu deklarieren.

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

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

 `DistributionDomainName`   <a name="sam-api-route53configuration-distributiondomainname"></a>
Konfiguriert eine benutzerdefinierte Verteilung des benutzerdefinierten API-Domänennamens.  
*Typ:* Zeichenfolge  
*Required*: No  
*Standard*: Verwenden Sie die API Gateway Gateway-Distribution.  
*CloudFormation Kompatibilität*: Diese Eigenschaft wird direkt an die `[DNSName](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53-aliastarget-1.html#cfn-route53-aliastarget-dnshostname)` Eigenschaft einer `AWS::Route53::RecordSetGroup AliasTarget` Ressource übergeben.  
*Zusätzliche Hinweise*: Der Domainname einer [CloudFrontDistribution](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudfront-distribution.html).

 `EvaluateTargetHealth`   <a name="sam-api-route53configuration-evaluatetargethealth"></a>
Wenn EvaluateTargetHealth wahr, erbt ein Aliaseintrag den Zustand der referenzierten AWS Ressource, z. B. eines Elastic Load Balancing Balancing-Load Balancers oder eines anderen Datensatzes in der Hosting-Zone.  
*Typ*: Boolesch  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft wird direkt an die `[EvaluateTargetHealth](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53-aliastarget.html#cfn-route53-aliastarget-evaluatetargethealth)` Eigenschaft einer `AWS::Route53::RecordSetGroup AliasTarget` Ressource übergeben.  
*Zusätzliche Hinweise*: Sie können den Wert nicht auf „true“ EvaluateTargetHealth setzen, wenn es sich bei dem Alias-Ziel um eine CloudFront Distribution handelt.

 `HostedZoneId`   <a name="sam-api-route53configuration-hostedzoneid"></a>
Die ID der gehosteten Zone, in der Sie Datensätze erstellen möchten.  
Geben Sie `HostedZoneName` oder `HostedZoneId` an, jedoch nicht beides. Wenn Sie mehrere gehostete Zonen mit dem gleichen Domainnamen haben, müssen Sie die gehostete Zone mit der `HostedZoneId` angeben.  
*Typ:* Zeichenfolge  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft wird direkt an die `[HostedZoneId](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53-recordset-1.html#cfn-route53-recordset-hostedzoneid)` Eigenschaft einer `AWS::Route53::RecordSetGroup RecordSet` Ressource übergeben.

 `HostedZoneName`   <a name="sam-api-route53configuration-hostedzonename"></a>
Der Name der gehosteten Zone, in der Sie Datensätze erstellen möchten.  
Geben Sie `HostedZoneName` oder `HostedZoneId` an, jedoch nicht beides. Wenn Sie mehrere gehostete Zonen mit dem gleichen Domainnamen haben, müssen Sie die gehostete Zone mit der `HostedZoneId` angeben.  
*Typ:* Zeichenfolge  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft wird direkt an die `[HostedZoneName](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53-recordset-1.html#cfn-route53-recordset-hostedzonename)` Eigenschaft einer `AWS::Route53::RecordSetGroup RecordSet` Ressource übergeben.

 `IpV6`   <a name="sam-api-route53configuration-ipv6"></a>
Wenn diese Eigenschaft gesetzt ist, wird eine `AWS::Route53::RecordSet` Ressource AWS SAM erstellt und [Type](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53-recordset.html#cfn-route53-recordset-type) `AAAA` für die angegebene Ressource auf gesetzt HostedZone.  
*Typ*: Boolesch  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft ist einzigartig für AWS SAM und hat kein CloudFormation Äquivalent.

`Region`  <a name="sam-api-route53configuration-region"></a>
*Nur latenzbasierte Ressourcendatensätze:* Die EC2 Amazon-Region, in der Sie die Ressource erstellt haben, auf die sich dieser Ressourcendatensatz bezieht. Bei der Ressource handelt es sich in der Regel um eine AWS Ressource, z. B. eine EC2 Instance oder einen ELB-Load Balancer, auf die je nach Datensatztyp mit einer IP-Adresse oder einem DNS-Domainnamen verwiesen wird.  
Wenn Amazon Route 53 eine DNS-Abfrage für einen Domainnamen und einen Domain-Typ empfängt, für den Sie Latenzressourcendatensätze erstellt haben, wählt Route 53 den Latenzressourcendatensatz aus, der die niedrigste Latenz zwischen dem Endbenutzer und der zugehörigen EC2 Amazon-Region aufweist. Route 53 gibt dann den Wert zurück, der dem ausgewählten Ressourcendatensatz zugeordnet ist.  
Beachten Sie Folgendes:  
+ Sie können nur einen `ResourceRecord` pro Latenz-Ressourcendatensatz angeben.
+ Sie können nur einen Latenzressourcendatensatz für jede EC2 Amazon-Region erstellen.
+ Sie müssen keine Latenzressourcendatensätze für alle EC2 Amazon-Regionen erstellen. Route 53 wählt die Region mit der besten Latenz aus den Regionen aus, für die Sie Latenz-Ressourcendatensätze erstellen.
+ Sie können keine Nicht-Latenz-Ressourcendatensätze erstellen, die die gleichen Werte für die Elemente `Name` und `Type` haben wie Latenz-Ressourcendatensätze.
*Typ:* Zeichenfolge  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft wird direkt an die `[ Region](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53-recordset-1.html#cfn-route53-recordset-region)` Eigenschaft eines `AWS::Route53::RecordSetGroup` `RecordSet` Datentyps übergeben.

`SetIdentifier`  <a name="sam-api-route53configuration-setidentifier"></a>
*Ressourcendatensätze, die eine andere Routing-Richtlinie als "einfach" haben:* Ein Bezeichner, der zwischen mehreren Ressourcendatensätzen unterscheidet, die die gleiche Kombination aus Name und Typ haben, wie beispielsweise mehrere gewichtete Ressourcendatensätze namens acme.example.com, die einen Typ A haben. In einer Gruppe von Ressourcendatensätzen, die den gleichen Namen und Typ haben, muss der Wert von `SetIdentifier` für jeden Ressourcen-Datensatz eindeutig sein.  
Informationen zu Routing-Richtlinien finden Sie unter [Auswahl einer Routing-Richtlinie](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/routing-policy.html) im *Amazon Route 53-Entwicklerhandbuch*.  
*Typ:* Zeichenfolge  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft wird direkt an die `[ SetIdentifier](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53-recordset-1.html#cfn-route53-recordset-setidentifier)` Eigenschaft eines `AWS::Route53::RecordSetGroup` `RecordSet` Datentyps übergeben.

`VpcEndpointDomainName`  <a name="sam-api-route53configuration-vpcendpointdomainname"></a>
Ein DNS-Name des VPC-Schnittstellenendpunkts, der dem API Gateway VPC-Dienst zugeordnet ist. Diese Eigenschaft ist nur für private Domänen erforderlich.  
*Typ:* Zeichenfolge  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft wird direkt an die `[DNSName](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53-recordset-aliastarget.html)` Eigenschaft eines `AWS::Route53::RecordSet` `AliasTarget` Feldes übergeben.

`VpcEndpointHostedZoneId`  <a name="sam-api-route53configuration-vpcendpointhostedzoneid"></a>
Die Hosting-Zonen-ID des VPC-Schnittstellenendpunkts, der dem API Gateway VPC-Dienst zugeordnet ist. Diese Eigenschaft ist nur für private Domänen erforderlich.  
*Typ:* Zeichenfolge  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft wird direkt an die `[HostedZoneId](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53-recordset-aliastarget.html)` Eigenschaft eines `AWS::Route53::RecordSet` `AliasTarget` Feldes übergeben.

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

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

In diesem Beispiel konfigurieren wir eine benutzerdefinierte Domain und Route 53-Datensätze für unsere API.

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

Der Endpunkttyp einer REST-API.

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

Verwenden Sie die folgende Syntax, um diese Entität in Ihrer Vorlage AWS Serverless Application Model (AWS SAM) zu deklarieren.

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

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

 `IpAddressType`   <a name="sam-api-endpointconfiguration-ipaddresstype"></a>
Die IP-Adresstypen, die eine API (RestApi) aufrufen können.  
*Zulässige Werte*: `ipv4` oder `dualstack`.  
*Typ:* Zeichenfolge  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft wird direkt an die `[IpAddressType](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigateway-restapi-endpointconfiguration.html#cfn-apigateway-restapi-endpointconfiguration-ipaddresstype)` Eigenschaft des `AWS::ApiGateway::RestApi` `EndpointConfiguration` Datentyps übergeben.

 `Type`   <a name="sam-api-endpointconfiguration-type"></a>
Der Endpunkttyp einer REST-API.  
*Gültige Werte*: `EDGE` oder `REGIONAL` oder `PRIVATE`  
*Typ:* Zeichenfolge  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft wird direkt an die `[Types](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigateway-restapi-endpointconfiguration.html#cfn-apigateway-restapi-endpointconfiguration-types)` Eigenschaft des `AWS::ApiGateway::RestApi` `EndpointConfiguration` Datentyps übergeben.

 `VPCEndpointIds`   <a name="sam-api-endpointconfiguration-vpcendpointids"></a>
Eine Liste der VPC-Endpunkte IDs einer REST-API, für die Route53-Aliase erstellt werden sollen.  
*Typ*: Liste  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft wird direkt an die `[VpcEndpointIds](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigateway-restapi-endpointconfiguration.html#cfn-apigateway-restapi-endpointconfiguration-vpcendpointids)` Eigenschaft des Datentyps übergeben. `AWS::ApiGateway::RestApi` `EndpointConfiguration`

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

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

Beispiel für eine Endpunktkonfiguration

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

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