

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::HttpApi
<a name="sam-resource-httpapi"></a>

Erstellt eine Amazon API Gateway Gateway-HTTP-API, mit der Sie RESTful APIs mit geringerer Latenz und geringeren Kosten als REST erstellen können APIs. Weitere Informationen finden Sie unter [Working with HTTP APIs](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api.html) im *API Gateway Developer Guide*.

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-httpapi-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-resource-httpapi-syntax.yaml"></a>

```
Type: AWS::Serverless::HttpApi
Properties:
  [AccessLogSettings](#sam-httpapi-accesslogsettings): [AccessLogSettings](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigatewayv2-stage.html#cfn-apigatewayv2-stage-accesslogsettings)
  [Auth](#sam-httpapi-auth): HttpApiAuth
  [CorsConfiguration](#sam-httpapi-corsconfiguration): String | HttpApiCorsConfiguration
  [DefaultRouteSettings](#sam-httpapi-defaultroutesettings): [RouteSettings](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigatewayv2-stage.html#cfn-apigatewayv2-stage-routesettings)
  [DefinitionBody](#sam-httpapi-definitionbody): JSON
  [DefinitionUri](#sam-httpapi-definitionuri): String | HttpApiDefinition
  [Description](#sam-httpapi-description): String
  [DisableExecuteApiEndpoint](#sam-httpapi-disableexecuteapiendpoint): Boolean
  [Domain](#sam-httpapi-domain): HttpApiDomainConfiguration
  [FailOnWarnings](#sam-httpapi-failonwarnings): Boolean
  Name: String
  PropagateTags: Boolean
  [RouteSettings](#sam-httpapi-routesettings): [RouteSettings](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigatewayv2-stage.html#cfn-apigatewayv2-stage-routesettings)
  [StageName](#sam-httpapi-stagename): String
  [StageVariables](#sam-httpapi-stagevariables): [Json](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigatewayv2-stage.html#cfn-apigatewayv2-stage-stagevariables)
  [Tags](#sam-httpapi-tags): Map
```

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

 `AccessLogSettings`   <a name="sam-httpapi-accesslogsettings"></a>
Die Einstellungen für die Zugriffsprotokollierung in einer Phase.  
*Typ:* [AccessLogSettings](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigatewayv2-stage.html#cfn-apigatewayv2-stage-accesslogsettings)  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft wird direkt an die `[AccessLogSettings](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigatewayv2-stage.html#cfn-apigatewayv2-stage-accesslogsettings)` Eigenschaft einer `AWS::ApiGatewayV2::Stage` Ressource übergeben.

 `Auth`   <a name="sam-httpapi-auth"></a>
Konfiguriert die Autorisierung für die Steuerung des Zugriffs auf Ihre API Gateway Gateway-HTTP-API.  
Weitere Informationen finden Sie unter [Steuern des Zugriffs auf HTTP APIs mit JWT-Autorisierern](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-jwt-authorizer.html) im *API Gateway* Developer Guide.  
*Typ:* [HttpApiAuth](sam-property-httpapi-httpapiauth.md)  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft ist einzigartig für AWS SAM und hat kein Äquivalent. CloudFormation 

 `CorsConfiguration`   <a name="sam-httpapi-corsconfiguration"></a>
Verwaltet Cross-Origin Resource Sharing (CORS) für Ihr gesamtes API-Gateway-HTTP. APIs Geben Sie die Domäne, die zugelassen werden soll, als Zeichenfolge an, oder geben Sie ein Objekt an`HttpApiCorsConfiguration`. Beachten Sie, dass CORS Ihre OpenAPI-Definition ändern muss AWS SAM , sodass CORS nur funktioniert, wenn die `DefinitionBody` Eigenschaft angegeben ist.  
Weitere Informationen finden Sie unter [Konfiguration von CORS für eine HTTP-API im API](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-cors.html) *Gateway Developer Guide*.  
Wenn sowohl in einer OpenAPI-Definition als auch auf Eigenschaftsebene festgelegt `CorsConfiguration` ist, werden beide Konfigurationsquellen AWS SAM zusammengeführt, wobei die Eigenschaften Vorrang haben. Wenn diese Eigenschaft auf gesetzt ist`true`, sind alle Ursprünge zulässig.
*Typ*: Zeichenfolge \$1 [HttpApiCorsConfiguration](sam-property-httpapi-httpapicorsconfiguration.md)  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft ist einzigartig für AWS SAM und hat kein CloudFormation Äquivalent.

 `DefaultRouteSettings`   <a name="sam-httpapi-defaultroutesettings"></a>
Die Standardrouteneinstellungen für diese HTTP-API. Diese Einstellungen gelten für alle Routen, sofern sie nicht durch die `RouteSettings` Eigenschaft für bestimmte Routen außer Kraft gesetzt werden.  
*Typ:* [RouteSettings](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigatewayv2-stage.html#cfn-apigatewayv2-stage-routesettings)  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft wird direkt an die `[RouteSettings](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigatewayv2-stage.html#cfn-apigatewayv2-stage-routesettings)` Eigenschaft einer `AWS::ApiGatewayV2::Stage` Ressource übergeben.

 `DefinitionBody`   <a name="sam-httpapi-definitionbody"></a>
Die OpenAPI-Definition, die Ihre HTTP-API beschreibt. Wenn Sie a `DefinitionUri` oder a nicht angeben`DefinitionBody`, AWS SAM generiert es auf der Grundlage Ihrer Vorlagenkonfiguration eine `DefinitionBody` für Sie.  
*Type*: JSON  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft ähnelt der `[Body](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigatewayv2-api.html#cfn-apigatewayv2-api-body)` Eigenschaft einer `AWS::ApiGatewayV2::Api` Ressource. Wenn bestimmte Eigenschaften angegeben sind, AWS SAM kann Inhalt in die Datei eingefügt oder geändert werden, `DefinitionBody` bevor sie an sie übergeben CloudFormation werden. Zu den Eigenschaften gehören ein `EventSource` Typ `Auth` und ein Typ HttpApi für eine entsprechende `AWS::Serverless::Function` Ressource.

 `DefinitionUri`   <a name="sam-httpapi-definitionuri"></a>
Der Amazon Simple Storage Service (Amazon S3) -URI, der lokale Dateipfad oder das Speicherortobjekt der OpenAPI-Definition, die die HTTP-API definiert. Das Amazon S3 S3-Objekt, auf das diese Eigenschaft verweist, muss eine gültige OpenAPI-Definitionsdatei sein. Wenn Sie a nicht angeben `DefinitionUri` oder a angegeben `DefinitionBody` sind, AWS SAM generiert es eine `DefinitionBody` für Sie auf der Grundlage Ihrer Vorlagenkonfiguration.  
Wenn Sie einen lokalen Dateipfad angeben, 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 Definitionsdateien, auf die Sie verweisen, nicht unterstützt. `DefinitionUri` [Um eine OpenApi Definition in die Vorlage zu importieren, verwenden Sie die `DefinitionBody` Eigenschaft zusammen 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)  
*Typ*: Zeichenfolge \$1 [HttpApiDefinition](sam-property-httpapi-httpapidefinition.md)  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft ähnelt der `[BodyS3Location](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigatewayv2-api.html#cfn-apigatewayv2-api-bodys3location)` Eigenschaft einer `AWS::ApiGatewayV2::Api` Ressource. Die verschachtelten Amazon S3 S3-Eigenschaften sind unterschiedlich benannt.

 `Description`   <a name="sam-httpapi-description"></a>
Die Beschreibung der HTTP-API-Ressource.  
Wenn Sie angeben`Description`, AWS SAM wird die OpenApi Definition der HTTP-API-Ressource geändert, indem das `description` Feld festgelegt wird. Die folgenden Szenarien führen zu einem Fehler:  
+ Die `DefinitionBody` Eigenschaft wird mit dem in der Open API-Definition festgelegten `description` Feld angegeben. Dies führt zu einem Konflikt im `description` Feld, der AWS SAM nicht gelöst werden kann.
+ Die `DefinitionUri` Eigenschaft ist angegeben — ändert AWS SAM keine Open-API-Definition, die von Amazon S3 abgerufen wird.
*Typ:* Zeichenfolge  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft ist einzigartig für AWS SAM und hat kein CloudFormation Äquivalent.

 `DisableExecuteApiEndpoint`   <a name="sam-httpapi-disableexecuteapiendpoint"></a>
Gibt an, ob Clients Ihre HTTP-API mithilfe des `execute-api` Standardendpunkts `https://{api_id}.execute-api.{region}.amazonaws.com` aufrufen können. Standardmäßig können Kunden Ihre API mit dem standardmäßigen -Endpunkt aufrufen. Um zu verlangen, dass Clients nur einen benutzerdefinierten Domainnamen verwenden, um Ihre API aufzurufen, deaktivieren Sie den Standardendpunkt.  
Um diese Eigenschaft zu verwenden, müssen Sie `disableExecuteApiEndpoint` in Ihrer OpenAPI-Definition die `DefinitionBody` `DefinitionUri` Eigenschaft anstelle der Eigenschaft angeben oder `x-amazon-apigateway-endpoint-configuration` mit definieren.  
*Typ*: Boolesch  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft ähnelt der `[ DisableExecuteApiEndpoint](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigatewayv2-api.html#cfn-apigatewayv2-api-disableexecuteapiendpoint)` Eigenschaft einer `AWS::ApiGatewayV2::Api` 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-apigatewayv2-api.html#cfn-apigatewayv2-api-body)` Eigenschaft einer `AWS::ApiGatewayV2::Api` Ressource hinzugefügt wird.

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

 `FailOnWarnings`   <a name="sam-httpapi-failonwarnings"></a>
Gibt an, ob die HTTP-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-apigatewayv2-api.html#cfn-apigatewayv2-api-failonwarnings)` Eigenschaft einer `AWS::ApiGatewayV2::Api` Ressource übergeben.

`Name`  <a name="sam-httpapi-name"></a>
Der Name der HTTP-API-Ressource.  
Wenn Sie angeben`Name`, AWS SAM wird die OpenAPI-Definition der HTTP-API-Ressource geändert, indem das `title` Feld festgelegt wird. Die folgenden Szenarien führen zu einem Fehler:  
+ Die `DefinitionBody` Eigenschaft wird mit dem in der Open API-Definition festgelegten `title` Feld angegeben. Dies führt zu einem Konflikt im `title` Feld, der AWS SAM nicht gelöst werden kann.
+ Die `DefinitionUri` Eigenschaft ist angegeben — ändert AWS SAM keine Open-API-Definition, die von Amazon S3 abgerufen wird.
*Typ:* Zeichenfolge  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft ist einzigartig für AWS SAM und hat kein CloudFormation Äquivalent.

`PropagateTags`  <a name="sam-httpapi-propagatetags"></a>
Geben Sie an, ob Tags von der `Tags` Eigenschaft an Ihre [AWS::Serverless::HttpApi](sam-specification-generated-resources-httpapi.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.

 `RouteSettings`   <a name="sam-httpapi-routesettings"></a>
Die Routeneinstellungen pro Route für diese HTTP-API. Weitere Informationen finden Sie unter [Working with routes for HTTP APIs](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-routes.html) im *API Gateway Developer Guide*.  
*Typ:* [RouteSettings](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigatewayv2-stage.html#cfn-apigatewayv2-stage-routesettings)  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft wird direkt an die `[RouteSettings](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigatewayv2-stage.html#cfn-apigatewayv2-stage-routesettings)` Eigenschaft einer `AWS::ApiGatewayV2::Stage` Ressource übergeben.

 `StageName`   <a name="sam-httpapi-stagename"></a>
Der Name der API-Stufe. Wenn kein Name angegeben ist, wird der `$default` Stagingbereich von API Gateway AWS SAM verwendet.  
*Typ:* Zeichenfolge  
*Required*: No  
*Standard*: \$1default  
*CloudFormation Kompatibilität*: Diese Eigenschaft wird direkt an die `[StageName](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigatewayv2-stage.html#cfn-apigatewayv2-stage-stagename)` Eigenschaft einer `AWS::ApiGatewayV2::Stage` Ressource übergeben.

 `StageVariables`   <a name="sam-httpapi-stagevariables"></a>
Eine Zuweisung, welche die Stufenvariablen definiert. Variablennamen können alphanumerische Zeichen und Unterstriche enthalten. Die Werte müssen mit [a-Za-Z0-9-.\$1\$1:/? \$1&=,] \$1.  
*Type*: [Json](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigatewayv2-stage.html#cfn-apigatewayv2-stage-stagevariables)  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft wird direkt an die `[StageVariables](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigatewayv2-stage.html#cfn-apigatewayv2-stage-stagevariables)` Eigenschaft einer `AWS::ApiGatewayV2::Stage` Ressource übergeben.

 `Tags`   <a name="sam-httpapi-tags"></a>
Eine Zuordnung (Zeichenfolge zu Zeichenfolge), die die Tags angibt, die zu diesem API-Gateway-Schritt hinzugefügt werden sollen. Schlüssel können 1 bis 128 Unicode-Zeichen lang sein und dürfen das Präfix nicht enthalten`aws:`. Sie können eines der folgenden Zeichen verwenden: Unicode-Zeichen, Ziffern, Leerraum, `_`, `.`, `/`, `=`, `+` und `-`. Werte können 1 bis 256 Unicode-Zeichen lang sein.  
*Typ*: Karte  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft ist einzigartig für AWS SAM und hat kein CloudFormation Äquivalent.  
*Zusätzliche Hinweise*: Die `Tags` Eigenschaft erfordert eine AWS SAM Änderung Ihrer OpenAPI-Definition, sodass Tags nur hinzugefügt werden, wenn die `DefinitionBody` Eigenschaft angegeben ist — es werden keine Tags hinzugefügt, wenn die Eigenschaft angegeben ist. `DefinitionUri` AWS SAM fügt automatisch ein Tag hinzu. `httpapi:createdBy:SAM` Der `AWS::ApiGatewayV2::Stage` Ressource und der `AWS::ApiGatewayV2::DomainName` Ressource (falls `DomainName` angegeben) werden auch Tags hinzugefügt.

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

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

Wenn Sie die logische ID dieser Ressource an die systeminterne `Ref` Funktion übergeben, wird die API-ID der zugrunde liegenden `AWS::ApiGatewayV2::Api` Ressource `Ref` zurückgegeben, zum Beispiel. `a1bcdef2gh`

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*. 

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

### Einfach HttpApi
<a name="sam-resource-httpapi--examples--simple-httpapi"></a>

Das folgende Beispiel zeigt das Minimum, das für die Einrichtung eines HTTP-API-Endpunkts erforderlich ist, der von einer Lambda-Funktion unterstützt wird. In diesem Beispiel wird die standardmäßige HTTP-API verwendet, die AWS SAM erstellt.

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

```
AWSTemplateFormatVersion: '2010-09-09'
Description: AWS SAM template with a simple API definition
Resources:
  ApiFunction:
    Type: AWS::Serverless::Function
    Properties:
      Events:
        ApiEvent:
          Type: HttpApi
      Handler: index.handler
      InlineCode: |
        def handler(event, context):
            return {'body': 'Hello World!', 'statusCode': 200}
      Runtime: python3.7
Transform: AWS::Serverless-2016-10-31
```

### HttpApi mit Auth
<a name="sam-resource-httpapi--examples--httpapi-with-auth"></a>

Das folgende Beispiel zeigt, wie die Autorisierung auf HTTP-API-Endpunkten eingerichtet wird.

#### YAML
<a name="sam-resource-httpapi--examples--httpapi-with-auth--yaml"></a>

```
Properties:
  FailOnWarnings: true
  Auth:
    DefaultAuthorizer: OAuth2
    Authorizers:
      OAuth2:
        AuthorizationScopes:
          - scope4
        JwtConfiguration:
          issuer: "https://www.example.com/v1/connect/oauth2"
          audience:
            - MyApi
        IdentitySource: "$request.querystring.param"
```

### HttpApi mit OpenAPI-Definition
<a name="sam-resource-httpapi--examples--httpapi-with-openapi-definition"></a>

Das folgende Beispiel zeigt, wie Sie der Vorlage eine OpenAPI-Definition hinzufügen.

Beachten Sie, dass alle fehlenden Lambda-Integrationen für HttpApi Ereignisse, die auf diese HTTP-API verweisen, AWS SAM ausgefüllt werden. AWS SAM fügt auch alle fehlenden Pfade hinzu, auf die HttpApi Ereignisse verweisen.

#### YAML
<a name="sam-resource-httpapi--examples--httpapi-with-openapi-definition--yaml"></a>

```
Properties:
  FailOnWarnings: true
  DefinitionBody:
    info:
      version: '1.0'
      title:
        Ref: AWS::StackName
    paths:
      "/":
        get:
          security:
          - OpenIdAuth:
            - scope1
            - scope2
          responses: {}
    openapi: 3.0.1
    securitySchemes:
      OpenIdAuth:
        type: openIdConnect
        x-amazon-apigateway-authorizer:
          identitySource: "$request.querystring.param"
          type: jwt
          jwtConfiguration:
            audience:
            - MyApi
            issuer: https://www.example.com/v1/connect/oidc
          openIdConnectUrl: https://www.example.com/v1/connect/oidc/.well-known/openid-configuration
```

### HttpApi mit Konfigurationseinstellungen
<a name="sam-resource-httpapi--examples--httpapi-with-configuration-settings"></a>

Das folgende Beispiel zeigt, wie HTTP-API- und Staging-Konfigurationen zur Vorlage hinzugefügt werden.

#### YAML
<a name="sam-resource-httpapi--examples--httpapi-with-configuration-settings--yaml"></a>

```
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Parameters:
  StageName:
    Type: String
    Default: Prod
    
Resources:
  HttpApiFunction:
    Type: AWS::Serverless::Function
    Properties:
      InlineCode: |
          def handler(event, context):
              import json
              return {
                  "statusCode": 200,
                  "body": json.dumps(event),
              }
      Handler: index.handler
      Runtime: python3.7
      Events:
        ExplicitApi: # warning: creates a public endpoint
          Type: HttpApi
          Properties:
            ApiId: !Ref HttpApi
            Method: GET
            Path: /path
            TimeoutInMillis: 15000
            PayloadFormatVersion: "2.0"
            RouteSettings:
              ThrottlingBurstLimit: 600

  HttpApi:
    Type: AWS::Serverless::HttpApi
    Properties:
      StageName: !Ref StageName
      Tags:
        Tag: Value
      AccessLogSettings:
        DestinationArn: !GetAtt AccessLogs.Arn
        Format: $context.requestId
      DefaultRouteSettings:
        ThrottlingBurstLimit: 200
      RouteSettings:
        "GET /path":
          ThrottlingBurstLimit: 500 # overridden in HttpApi Event
      StageVariables:
        StageVar: Value
      FailOnWarnings: true

  AccessLogs:
    Type: AWS::Logs::LogGroup

Outputs:
  HttpApiUrl:
    Description: URL of your API endpoint
    Value:
      Fn::Sub: 'https://${HttpApi}.execute-api.${AWS::Region}.${AWS::URLSuffix}/${StageName}/'
  HttpApiId:
    Description: Api id of HttpApi
    Value:
      Ref: HttpApi
```

# HttpApiAuth
<a name="sam-property-httpapi-httpapiauth"></a>

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

Weitere Informationen zur Konfiguration des Zugriffs auf HTTP APIs finden Sie unter [Steuern und Verwalten des Zugriffs auf eine HTTP-API in API Gateway](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-access-control.html) im *API Gateway Developer Guide*.

## Syntax
<a name="sam-property-httpapi-httpapiauth-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-httpapi-httpapiauth-syntax.yaml"></a>

```
  [Authorizers](#sam-httpapi-httpapiauth-authorizers): OAuth2Authorizer | LambdaAuthorizer
  [DefaultAuthorizer](#sam-httpapi-httpapiauth-defaultauthorizer): String
  [EnableIamAuthorizer](#sam-httpapi-httpapiauth-enableiamauthorizer): Boolean
```

## Eigenschaften
<a name="sam-property-httpapi-httpapiauth-properties"></a>

 `Authorizers`   <a name="sam-httpapi-httpapiauth-authorizers"></a>
Der Autorisierer, der zur Steuerung des Zugriffs auf Ihre API-Gateway-API verwendet wird.  
*Typ*: [OAuth2Authorizer \$1 [LambdaAuthorizer](sam-property-httpapi-lambdaauthorizer.md)](sam-property-httpapi-oauth2authorizer.md)  
*Required*: No  
*Standard*: Keiner  
*CloudFormation Kompatibilität*: Diese Eigenschaft ist einzigartig für AWS SAM und hat kein CloudFormation Äquivalent.  
*Zusätzliche Hinweise*: AWS SAM Fügt die Autorisierer zur OpenAPI-Definition hinzu.

 `DefaultAuthorizer`   <a name="sam-httpapi-httpapiauth-defaultauthorizer"></a>
Geben Sie den Standard-Authorizer an, der für die Autorisierung von API-Aufrufen an Ihre API-Gateway-API verwendet werden soll. Sie können ihn `AWS_IAM` als Standardautorisierer angeben, wenn er auf gesetzt `EnableIamAuthorizer` ist. `true` Geben Sie andernfalls einen Autorisierer an, den Sie in definiert haben. `Authorizers`  
*Typ:* Zeichenfolge  
*Required*: No  
*Standard*: Keiner  
*CloudFormation Kompatibilität*: Diese Eigenschaft ist einzigartig für AWS SAM und hat kein CloudFormation Äquivalent.

 `EnableIamAuthorizer`   <a name="sam-httpapi-httpapiauth-enableiamauthorizer"></a>
Geben Sie an, ob die IAM-Autorisierung für die API-Route verwendet werden soll.  
*Typ*: Boolesch  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft ist einzigartig für AWS SAM und hat kein CloudFormation Äquivalent.

## Beispiele
<a name="sam-property-httpapi-httpapiauth--examples"></a>

### OAuth 2.0 Autorisierer
<a name="sam-property-httpapi-httpapiauth--examples--oauth-2.0-authorizer"></a>

OAuth Beispiel für einen 2.0-Authorizer

#### YAML
<a name="sam-property-httpapi-httpapiauth--examples--oauth-2.0-authorizer--yaml"></a>

```
Auth:
  Authorizers:
    OAuth2Authorizer:
      AuthorizationScopes:
        - scope1
        - scope2
      JwtConfiguration:
        issuer: "https://www.example.com/v1/connect/oauth2"
        audience:
          - MyApi
      IdentitySource: "$request.querystring.param"
  DefaultAuthorizer: OAuth2Authorizer
```

### Ein IAM-Autorisierer
<a name="sam-property-httpapi-httpapiauth--examples--iam-authorizer"></a>

Beispiel für einen IAM-Autorisierer

#### YAML
<a name="sam-property-httpapi-httpapiauth--examples--iam-authorizer--yaml"></a>

```
Auth:
  EnableIamAuthorizer: true
  DefaultAuthorizer: AWS_IAM
```

# LambdaAuthorizer
<a name="sam-property-httpapi-lambdaauthorizer"></a>

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

Weitere Informationen und Beispiele finden Sie unter [Arbeiten mit AWS Lambda Autorisierern für HTTP APIs](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-lambda-authorizer.html) im *API Gateway Developer Guide*.

## Syntax
<a name="sam-property-httpapi-lambdaauthorizer-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-httpapi-lambdaauthorizer-syntax.yaml"></a>

```
  [AuthorizerPayloadFormatVersion](#sam-httpapi-lambdaauthorizer-authorizerpayloadformatversion): String
  EnableFunctionDefaultPermissions: Boolean
  [EnableSimpleResponses](#sam-httpapi-lambdaauthorizer-enablesimpleresponses): Boolean
  [FunctionArn](#sam-httpapi-lambdaauthorizer-functionarn): String
  [FunctionInvokeRole](#sam-httpapi-lambdaauthorizer-functioninvokerole): String
  [Identity](#sam-httpapi-lambdaauthorizer-identity): LambdaAuthorizationIdentity
```

## Eigenschaften
<a name="sam-property-httpapi-lambdaauthorizer-properties"></a>

 `AuthorizerPayloadFormatVersion`   <a name="sam-httpapi-lambdaauthorizer-authorizerpayloadformatversion"></a>
Gibt das Format der Nutzlast an, die an einen HTTP-API-Lambda-Genehmiger gesendet wird. Für HTTP-API-Lambda-Genehmiger erforderlich.  
Dies wird an den `authorizerPayloadFormatVersion` Abschnitt von und `x-amazon-apigateway-authorizer` im `securitySchemes` Abschnitt einer OpenAPI-Definition weitergegeben.  
*Zulässige Werte*: `1.0` oder `2.0`.  
*Typ:* Zeichenfolge  
*Erforderlich*: Ja  
*CloudFormation Kompatibilität*: Diese Eigenschaft ist einzigartig für AWS SAM und hat kein CloudFormation Äquivalent.

 `EnableFunctionDefaultPermissions`   <a name="sam-httpapi-lambdaauthorizer-enablefunctiondefaultpermissions"></a>
Standardmäßig wird der HTTP-API-Ressource keine Berechtigung zum Aufrufen des Lambda-Autorisierers erteilt. Geben Sie diese Eigenschaft an`true`, um automatisch Berechtigungen zwischen Ihrer HTTP-API-Ressource und Ihrem Lambda-Authorizer zu erstellen.  
*Typ*: Boolesch  
*Required*: No  
*Standardwert*: `false`  
*CloudFormation Kompatibilität*: Diese Eigenschaft ist einzigartig für AWS SAM und hat kein CloudFormation Äquivalent.

 `EnableSimpleResponses`   <a name="sam-httpapi-lambdaauthorizer-enablesimpleresponses"></a>
Gibt an, ob ein Lambda-Genehmiger eine Antwort in einem einfachen Format zurückgibt. Standardmäßig muss ein Lambda-Autorisierer eine AWS Identity and Access Management (IAM-) Richtlinie zurückgeben. Wenn diese Option aktiviert ist, kann der Lambda-Genehmiger anstelle einer IAM-Richtlinie einen booleschen Wert zurückgeben.  
Dies wird an den `enableSimpleResponses` Abschnitt von und `x-amazon-apigateway-authorizer` im `securitySchemes` Abschnitt einer OpenAPI-Definition weitergegeben.  
*Typ*: Boolesch  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft ist einzigartig für AWS SAM und hat kein CloudFormation Äquivalent.

 `FunctionArn`   <a name="sam-httpapi-lambdaauthorizer-functionarn"></a>
Der Amazon-Ressourcenname (ARN) der Lambda-Funktion, die die Autorisierung für die API bereitstellt.  
Dies wird an den `authorizerUri` Abschnitt von und `x-amazon-apigateway-authorizer` im `securitySchemes` Abschnitt einer OpenAPI-Definition weitergegeben.  
*Typ:* Zeichenfolge  
*Erforderlich*: Ja  
*CloudFormation Kompatibilität*: Diese Eigenschaft ist einzigartig für AWS SAM und hat kein CloudFormation Äquivalent.

 `FunctionInvokeRole`   <a name="sam-httpapi-lambdaauthorizer-functioninvokerole"></a>
Der ARN der IAM-Rolle, die über die Anmeldeinformationen verfügt, die API Gateway benötigt, um die Autorisierungsfunktion aufzurufen. Geben Sie diesen Parameter an, wenn die ressourcenbasierte Richtlinie Ihrer Funktion keine `lambda:InvokeFunction` API-Gateway-Berechtigung gewährt.  
Dies wird an den `authorizerCredentials` Abschnitt von und `x-amazon-apigateway-authorizer` im `securitySchemes` Abschnitt einer OpenAPI-Definition weitergegeben.  
Weitere Informationen finden Sie unter [Create a Lambda Authorizer](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-lambda-authorizer.html#http-api-lambda-authorizer.example-create) im *API Gateway Developer Guide*.  
*Typ:* Zeichenfolge  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft ist einzigartig für AWS SAM und hat kein CloudFormation Äquivalent.

 `Identity`   <a name="sam-httpapi-lambdaauthorizer-identity"></a>
Gibt `IdentitySource` in einer eingehenden Anfrage nach einem Autorisierer ein an.  
Dies wird an den `identitySource` Abschnitt von und `x-amazon-apigateway-authorizer` im `securitySchemes` Abschnitt einer OpenAPI-Definition weitergegeben.  
*Typ:* [LambdaAuthorizationIdentity](sam-property-httpapi-lambdaauthorizationidentity.md)  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft ist einzigartig für AWS SAM und hat kein CloudFormation Äquivalent.

## Beispiele
<a name="sam-property-httpapi-lambdaauthorizer--examples"></a>

### LambdaAuthorizer
<a name="sam-property-httpapi-lambdaauthorizer--examples--lambdaauthorizer"></a>

LambdaAuthorizer Beispiel

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

```
Auth:
  Authorizers:
    MyLambdaAuthorizer:
      AuthorizerPayloadFormatVersion: 2.0
      FunctionArn:
        Fn::GetAtt:
          - MyAuthFunction
          - Arn
      FunctionInvokeRole:
        Fn::GetAtt:
          - LambdaAuthInvokeRole
          - Arn
      Identity:
        Headers:
          - Authorization
```

# LambdaAuthorizationIdentity
<a name="sam-property-httpapi-lambdaauthorizationidentity"></a>

Die Use-Eigenschaft kann verwendet werden, um IdentitySource in einer eingehenden Anfrage für einen Lambda-Autorisierer einen anzugeben. Weitere Informationen zu Identitätsquellen finden Sie unter [Identitätsquellen](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-lambda-authorizer.html#http-api-lambda-authorizer.identity-sources) im *API Gateway Developer Guide*.

## Syntax
<a name="sam-property-httpapi-lambdaauthorizationidentity-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-httpapi-lambdaauthorizationidentity-syntax.yaml"></a>

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

## Eigenschaften
<a name="sam-property-httpapi-lambdaauthorizationidentity-properties"></a>

 `Context`   <a name="sam-httpapi-lambdaauthorizationidentity-context"></a>
Konvertiert die angegebenen Kontextzeichenfolgen in eine Liste von Mapping-Ausdrücken im Format`$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-httpapi-lambdaauthorizationidentity-headers"></a>
Konvertiert die Header in eine Liste von Zuordnungsausdrücken im Format`$request.header.name`.  
*Typ*: Liste  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft ist einzigartig für AWS SAM und hat kein CloudFormation Äquivalent.

 `QueryStrings`   <a name="sam-httpapi-lambdaauthorizationidentity-querystrings"></a>
Konvertiert die angegebenen Abfragezeichenfolgen in eine Liste von Zuordnungsausdrücken im Format`$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-httpapi-lambdaauthorizationidentity-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. Der maximale Wert ist 3600, oder 1 Stunde.  
*Typ*: Ganzzahl  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft ist einzigartig für AWS SAM und hat kein Äquivalent. CloudFormation 

 `StageVariables`   <a name="sam-httpapi-lambdaauthorizationidentity-stagevariables"></a>
Konvertiert die angegebenen Stufenvariablen in eine Liste von Mapping-Ausdrücken im Format`$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-httpapi-lambdaauthorizationidentity--examples"></a>

### LambdaRequestIdentity
<a name="sam-property-httpapi-lambdaauthorizationidentity--examples--lambdarequestidentity"></a>

Beispiel für eine Lambda-Anfrage

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

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

# OAuth2Authorizer
<a name="sam-property-httpapi-oauth2authorizer"></a>

Definition für einen OAuth 2.0-Authorizer, auch bekannt als JSON Web Token (JWT) -Authorizer.

Weitere Informationen finden Sie unter [Steuern des Zugriffs auf HTTP APIs mit JWT-Autorisierern](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-jwt-authorizer.html) im *API Gateway* Developer Guide.

## Syntax
<a name="sam-property-httpapi-oauth2authorizer-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-httpapi-oauth2authorizer-syntax.yaml"></a>

```
  [AuthorizationScopes](#sam-httpapi-oauth2authorizer-authorizationscopes): List
  [IdentitySource](#sam-httpapi-oauth2authorizer-identitysource): String
  [JwtConfiguration](#sam-httpapi-oauth2authorizer-jwtconfiguration): Map
```

## Eigenschaften
<a name="sam-property-httpapi-oauth2authorizer-properties"></a>

 `AuthorizationScopes`   <a name="sam-httpapi-oauth2authorizer-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.

 `IdentitySource`   <a name="sam-httpapi-oauth2authorizer-identitysource"></a>
Ausdruck der Identitätsquelle für diesen Autorisierer.  
*Typ:* Zeichenfolge  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft ist einzigartig für AWS SAM und hat kein CloudFormation Äquivalent.

 `JwtConfiguration`   <a name="sam-httpapi-oauth2authorizer-jwtconfiguration"></a>
JWT-Konfiguration für diesen Autorisierer.  
Dies wird an den `jwtConfiguration` Abschnitt von und `x-amazon-apigateway-authorizer` im `securitySchemes` Abschnitt einer OpenAPI-Definition weitergegeben.  
Eigenschaften `issuer` und `audience` unterscheiden nicht zwischen Groß- und Kleinschreibung und können entweder in Kleinbuchstaben wie in OpenAPI oder in Großbuchstaben `Issuer` und wie in verwendet werden. `Audience` [AWS::ApiGatewayV2::Authorizer](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigatewayv2-authorizer-jwtconfiguration.html) 
*Typ: Karte*  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft ist einzigartig AWS SAM und hat kein CloudFormation Äquivalent.

## Beispiele
<a name="sam-property-httpapi-oauth2authorizer--examples"></a>

### OAuth 2.0-Autorisierer
<a name="sam-property-httpapi-oauth2authorizer--examples--oauth-2.0-authorizer"></a>

OAuth Beispiel für einen 2.0-Authorizer

#### YAML
<a name="sam-property-httpapi-oauth2authorizer--examples--oauth-2.0-authorizer--yaml"></a>

```
Auth:
  Authorizers:
    OAuth2Authorizer:
      AuthorizationScopes:
        - scope1
      JwtConfiguration:
        issuer: "https://www.example.com/v1/connect/oauth2"
        audience:
          - MyApi
      IdentitySource: "$request.querystring.param"
  DefaultAuthorizer: OAuth2Authorizer
```

# HttpApiCorsConfiguration
<a name="sam-property-httpapi-httpapicorsconfiguration"></a>

Verwalte Cross-Origin Resource Sharing (CORS) für dein HTTP. APIs Geben Sie die Domain, die zugelassen werden soll, als Zeichenfolge an oder geben Sie ein Wörterbuch mit zusätzlicher Cors-Konfiguration an. HINWEIS: Cors benötigt SAM, um Ihre OpenAPI-Definition zu ändern, sodass es nur mit Inline funktioniert, die in der OpenApi `DefinitionBody` Eigenschaft definiert ist.

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

Hinweis: Wenn sowohl in OpenAPI als auch auf Eigenschaftenebene gesetzt HttpApiCorsConfiguration ist, werden sie mit den AWS SAM Eigenschaften zusammengeführt, die Vorrang haben.

## Syntax
<a name="sam-property-httpapi-httpapicorsconfiguration-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-httpapi-httpapicorsconfiguration-syntax.yaml"></a>

```
  [AllowCredentials](#sam-httpapi-httpapicorsconfiguration-allowcredentials): Boolean
  [AllowHeaders](#sam-httpapi-httpapicorsconfiguration-allowheaders): List
  [AllowMethods](#sam-httpapi-httpapicorsconfiguration-allowmethods): List
  [AllowOrigins](#sam-httpapi-httpapicorsconfiguration-alloworigins): List
  [ExposeHeaders](#sam-httpapi-httpapicorsconfiguration-exposeheaders): List
  [MaxAge](#sam-httpapi-httpapicorsconfiguration-maxage): Integer
```

## Eigenschaften
<a name="sam-property-httpapi-httpapicorsconfiguration-properties"></a>

 `AllowCredentials`   <a name="sam-httpapi-httpapicorsconfiguration-allowcredentials"></a>
Gibt an, ob Anmeldeinformationen in der CORS-Anforderung enthalten sind.  
*Typ*: Boolesch  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft ist einzigartig für AWS SAM und hat kein CloudFormation Äquivalent.

 `AllowHeaders`   <a name="sam-httpapi-httpapicorsconfiguration-allowheaders"></a>
Stellt eine Sammlung zulässiger Header dar.  
*Typ*: Liste  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft ist einzigartig für AWS SAM und hat kein CloudFormation Äquivalent.

 `AllowMethods`   <a name="sam-httpapi-httpapicorsconfiguration-allowmethods"></a>
Stellt eine Sammlung zulässiger HTTP-Methoden dar.  
*Typ*: Liste  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft ist einzigartig für AWS SAM und hat kein CloudFormation Äquivalent.

 `AllowOrigins`   <a name="sam-httpapi-httpapicorsconfiguration-alloworigins"></a>
Stellt eine Sammlung zulässiger Ursprünge dar.  
*Typ*: Liste  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft ist einzigartig für AWS SAM und hat kein CloudFormation Äquivalent.

 `ExposeHeaders`   <a name="sam-httpapi-httpapicorsconfiguration-exposeheaders"></a>
Stellt eine Sammlung exponierter Header dar.  
*Typ*: Liste  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft ist einzigartig für AWS SAM und hat kein CloudFormation Äquivalent.

 `MaxAge`   <a name="sam-httpapi-httpapicorsconfiguration-maxage"></a>
Die Anzahl der Sekunden, während der der Browser Preflight-Anforderungsergebnisse zwischenspeichern soll.  
*Typ*: Ganzzahl  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft ist einzigartig für AWS SAM und hat kein CloudFormation Äquivalent.

## Beispiele
<a name="sam-property-httpapi-httpapicorsconfiguration--examples"></a>

### HttpApiCorsConfiguration
<a name="sam-property-httpapi-httpapicorsconfiguration--examples--httpapicorsconfiguration"></a>

Beispiel für eine HTTP-API-Cors-Konfiguration.

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

```
CorsConfiguration:
  AllowOrigins:
    - "https://example.com"
  AllowHeaders:
    - x-apigateway-header
  AllowMethods:
    - GET
  MaxAge: 600
  AllowCredentials: true
```

# HttpApiDefinition
<a name="sam-property-httpapi-httpapidefinition"></a>

Ein OpenAPI-Dokument, das die API definiert.

## Syntax
<a name="sam-property-httpapi-httpapidefinition-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-httpapi-httpapidefinition-syntax.yaml"></a>

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

## Eigenschaften
<a name="sam-property-httpapi-httpapidefinition-properties"></a>

 `Bucket`   <a name="sam-httpapi-httpapidefinition-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-apigatewayv2-api-bodys3location.html#cfn-apigatewayv2-api-bodys3location-bucket)` Eigenschaft des `AWS::ApiGatewayV2::Api` `BodyS3Location` Datentyps übergeben.

 `Key`   <a name="sam-httpapi-httpapidefinition-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-apigatewayv2-api-bodys3location.html#cfn-apigatewayv2-api-bodys3location-key)` Eigenschaft des `AWS::ApiGatewayV2::Api` `BodyS3Location` Datentyps übergeben.

 `Version`   <a name="sam-httpapi-httpapidefinition-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-apigatewayv2-api-bodys3location.html#cfn-apigatewayv2-api-bodys3location-version)` Eigenschaft des `AWS::ApiGatewayV2::Api` `BodyS3Location` Datentyps übergeben.

## Beispiele
<a name="sam-property-httpapi-httpapidefinition--examples"></a>

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

Beispiel für eine API-Definition

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

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

# HttpApiDomainConfiguration
<a name="sam-property-httpapi-httpapidomainconfiguration"></a>

Konfiguriert eine benutzerdefinierte Domain für eine API.

## Syntax
<a name="sam-property-httpapi-httpapidomainconfiguration-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-httpapi-httpapidomainconfiguration-syntax.yaml"></a>

```
  [BasePath](#sam-httpapi-httpapidomainconfiguration-basepath): List
  [CertificateArn](#sam-httpapi-httpapidomainconfiguration-certificatearn): String
  [DomainName](#sam-httpapi-httpapidomainconfiguration-domainname): String
  [EndpointConfiguration](#sam-httpapi-httpapidomainconfiguration-endpointconfiguration): String
  [MutualTlsAuthentication](#sam-httpapi-httpapidomainconfiguration-mutualtlsauthentication): [MutualTlsAuthentication](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigatewayv2-domainname.html#cfn-apigatewayv2-domainname-mutualtlsauthentication)
  [OwnershipVerificationCertificateArn](#sam-httpapi-httpapidomainconfiguration-ownershipverificationcertificatearn): String
  [Route53](#sam-httpapi-httpapidomainconfiguration-route53): Route53Configuration
  [SecurityPolicy](#sam-httpapi-httpapidomainconfiguration-securitypolicy): String
```

## Eigenschaften
<a name="sam-property-httpapi-httpapidomainconfiguration-properties"></a>

 `BasePath`   <a name="sam-httpapi-httpapidomainconfiguration-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 `[ApiMappingKey](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigatewayv2-apimapping.html#cfn-apigatewayv2-apimapping-apimappingkey)` Eigenschaft einer `AWS::ApiGatewayV2::ApiMapping` Ressource. AWS SAM erstellt mehrere `AWS::ApiGatewayV2::ApiMapping` Ressourcen, eine pro Wert, der in dieser Eigenschaft angegeben ist.

 `CertificateArn`   <a name="sam-httpapi-httpapidomainconfiguration-certificatearn"></a>
Der Amazon-Ressourcenname (ARN) eines AWS verwalteten Zertifikats für den Endpunkt dieses Domainnamens. AWS Certificate Manager ist die einzige unterstützte Quelle.  
*Typ:* Zeichenfolge  
*Erforderlich*: Ja  
*CloudFormation Kompatibilität*: Diese Eigenschaft wird direkt an die `[CertificateArn](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigatewayv2-domainname-domainnameconfiguration.html#cfn-apigatewayv2-domainname-domainnameconfiguration-certificatearn)` Eigenschaft einer `AWS::ApiGateway2::DomainName DomainNameConfiguration` Ressource übergeben.

 `DomainName`   <a name="sam-httpapi-httpapidomainconfiguration-domainname"></a>
Der benutzerdefinierte Domainname für Ihre API-Gateway-API. Großbuchstaben werden nicht unterstützt.  
AWS SAM generiert eine `AWS::ApiGatewayV2::DomainName` Ressource, wenn diese Eigenschaft festgelegt ist. Hinweise zu diesem Szenario finden Sie unter[DomainName Eigenschaft ist spezifiziert](sam-specification-generated-resources-httpapi.md#sam-specification-generated-resources-httpapi-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-apigatewayv2-domainname.html#cfn-apigatewayv2-domainname-domainname)` Eigenschaft einer `AWS::ApiGateway2::DomainName` Ressource übergeben.

 `EndpointConfiguration`   <a name="sam-httpapi-httpapidomainconfiguration-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  
Der einzig gültige Wert für HTTP APIs ist`REGIONAL`.  
*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-httpapi-httpapidomainconfiguration-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-apigatewayv2-domainname.html#cfn-apigatewayv2-domainname-mutualtlsauthentication)  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft wird direkt an die `[MutualTlsAuthentication](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigatewayv2-domainname.html#cfn-apigatewayv2-domainname-mutualtlsauthentication)` Eigenschaft einer `AWS::ApiGatewayV2::DomainName` Ressource übergeben.

 `OwnershipVerificationCertificateArn`   <a name="sam-httpapi-httpapidomainconfiguration-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-properties-apigatewayv2-domainname-domainnameconfiguration.html#cfn-apigatewayv2-domainname-domainnameconfiguration-ownershipverificationcertificatearn)` Eigenschaft des `AWS::ApiGatewayV2::DomainName` `DomainNameConfiguration` Datentyps übergeben.

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

 `SecurityPolicy`   <a name="sam-httpapi-httpapidomainconfiguration-securitypolicy"></a>
Die TLS-Version der Sicherheitsrichtlinie für diesen Domainnamen.  
Der einzig gültige Wert für HTTP APIs ist`TLS_1_2`.  
*Typ:* Zeichenfolge  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft wird direkt an die `[SecurityPolicy](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigatewayv2-domainname-domainnameconfiguration.html#cfn-apigatewayv2-domainname-domainnameconfiguration-securitypolicy)` Eigenschaft des `AWS::ApiGatewayV2::DomainName` `DomainNameConfiguration` Datentyps übergeben.

## Beispiele
<a name="sam-property-httpapi-httpapidomainconfiguration--examples"></a>

### DomainName
<a name="sam-property-httpapi-httpapidomainconfiguration--examples--domainname"></a>

DomainName Beispiel

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

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

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

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

## Syntax
<a name="sam-property-httpapi-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-httpapi-route53configuration-syntax.yaml"></a>

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

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

 `DistributionDomainName`   <a name="sam-httpapi-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-httpapi-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-httpapi-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-httpapi-route53configuration-hostedzonename"></a>
Der Name der gehosteten Zone, in der Sie Datensätze erstellen möchten. Sie müssen einen abschließenden Punkt (z. B. `www.example.com.`) als Teil des `HostedZoneName` angeben.  
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-httpapi-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-httpapi-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-httpapi-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.

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

### Konfigurationsbeispiel für Route 53
<a name="sam-property-httpapi-route53configuration--examples--route-53-configuration-example"></a>

Dieses Beispiel zeigt, wie Route 53 konfiguriert wird.

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

```
Domain:
  DomainName: www.example.com
  CertificateArn: arn-example
  EndpointConfiguration: EDGE
  Route53:
    HostedZoneId: Z1PA6795UKMFR9
    EvaluateTargetHealth: true
    DistributionDomainName: xyz
```