

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.

# SQS
<a name="sam-property-function-sqs"></a>

Das Objekt, das einen `SQS` Ereignisquellentyp beschreibt. Weitere Informationen finden Sie unter [Using AWS Lambda with Amazon SQS](https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html) im *AWS Lambda Developer Guide*.

SAM generiert [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html)Ressourcen, wenn dieser Ereignistyp festgelegt ist

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

```
  [BatchSize](#sam-function-sqs-batchsize): Integer
  [Enabled](#sam-function-sqs-enabled): Boolean
  [FilterCriteria](#sam-function-sqs-filtercriteria): [FilterCriteria](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-filtercriteria.html)
  [FunctionResponseTypes](#sam-function-sqs-functionresponsetypes): List
  KmsKeyArn: String
  [MaximumBatchingWindowInSeconds](#sam-function-sqs-maximumbatchingwindowinseconds): Integer
  [MetricsConfig](#sam-function-sqs-metricsconfig): [MetricsConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-metricsconfig)
  [ProvisionedPollerConfig](#sam-function-sqs-provisionedpollerconfig): [ProvisionedPollerConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-provisionedpollerconfig)
  [Queue](#sam-function-sqs-queue): String
  ScalingConfig: [ScalingConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-scalingconfig.html)
```

## Eigenschaften
<a name="sam-property-function-sqs-properties"></a>

 `BatchSize`   <a name="sam-function-sqs-batchsize"></a>
Gibt die maximale Anzahl der Elemente an, die in einem einzigen Stapel zurückzugeben werden.  
*Typ*: Ganzzahl  
*Required*: No  
*Standard*: 10  
*CloudFormation Kompatibilität*: Diese Eigenschaft wird direkt an die `[BatchSize](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-batchsize)` Eigenschaft einer `AWS::Lambda::EventSourceMapping` Ressource übergeben.  
*Minimum*: `1`  
*Maximum*: `10000`

 `Enabled`   <a name="sam-function-sqs-enabled"></a>
Deaktiviert den Ereignis-Quellzuweisung zum Anhalten und Aufrufen von Abfragen.  
*Typ*: Boolesch  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft wird direkt an die `[Enabled](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-enabled)` Eigenschaft einer `AWS::Lambda::EventSourceMapping` Ressource übergeben.

 `FilterCriteria`   <a name="sam-function-sqs-filtercriteria"></a>
Ein Objekt, das die Kriterien definiert, anhand derer bestimmt wird, ob Lambda ein Ereignis verarbeiten soll. Weitere Informationen finden Sie unter [AWS Lambda Ereignisfilterung](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html) im *AWS Lambda Entwicklerhandbuch*.  
*Typ:* [FilterCriteria](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-filtercriteria.html)  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft wird direkt an die `[FilterCriteria](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-filtercriteria.html)` Eigenschaft einer `AWS::Lambda::EventSourceMapping` Ressource übergeben.

 `FunctionResponseTypes`   <a name="sam-function-sqs-functionresponsetypes"></a>
 Eine Liste der Antworttypen, die derzeit auf die Ereignisquellenzuordnung angewendet werden. Weitere Informationen finden Sie im *AWS Lambda Entwicklerhandbuch* unter [Melden von Fehlern bei Batch-Elementen](https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#services-sqs-batchfailurereporting).   
 *Gültige Werte*: `ReportBatchItemFailures`   
 *Typ*: Liste   
 *Required*: No   
 *CloudFormation Kompatibilität*: Diese Eigenschaft wird direkt an die `[FunctionResponseTypes](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-functionresponsetypes)` Eigenschaft einer `AWS::Lambda::EventSourceMapping` Ressource übergeben. 

 `KmsKeyArn`   <a name="sam-function-sqs-kmskeyarn"></a>
Der Amazon-Ressourcenname (ARN) des Schlüssels zur Verschlüsselung von Informationen zu diesem Ereignis.  
*Typ:* Zeichenfolge  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft wird direkt an die `[KmsKeyArn](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-kmskeyarn)` Eigenschaft einer `AWS::Lambda::EventSourceMapping` Ressource übergeben.

 `MaximumBatchingWindowInSeconds`   <a name="sam-function-sqs-maximumbatchingwindowinseconds"></a>
Die maximale Zeit in Sekunden für das Sammeln von Datensätzen vor dem Aufrufen der Funktion.  
*Typ*: Ganzzahl  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft wird direkt an die `[MaximumBatchingWindowInSeconds](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-maximumbatchingwindowinseconds)` Eigenschaft einer `AWS::Lambda::EventSourceMapping` Ressource übergeben.

 `MetricsConfig`   <a name="sam-function-sqs-metricsconfig"></a>
Eine optionale Konfiguration, um erweiterte Metriken für Zuordnungen von Ereignisquellen zu erhalten, die jede Phase der Verarbeitung erfassen. Ein Beispiel finden Sie unter [MetricsConfig Ereignis](sam-property-function-dynamodb.md#sam-property-function-dynamodb-example-metricsconfigevent).  
*Typ:* [MetricsConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-metricsconfig)  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft wird direkt an die `[MetricsConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-metricsconfig)` Eigenschaft einer Ressource übergeben. `AWS::Lambda::EventSourceMapping`

 `ProvisionedPollerConfig`   <a name="sam-function-sqs-provisionedpollerconfig"></a>
Konfiguration zur Erhöhung der Anzahl von Pollern, die zur Berechnung von Ereignisquellenzuordnungen verwendet werden. Diese Konfiguration ermöglicht ein Minimum von 2 Pollern und ein Maximum von 2000 Pollern. Ein Beispiel finden Sie unter. [ProvisionedPollerConfig Beispiel](#sam-property-function-sqs-example-provisionedpollerconfig)  
*Typ:* [ProvisionedPollerConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-provisionedpollerconfig)  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft wird direkt an die `[ProvisionedPollerConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-provisionedpollerconfig)` Eigenschaft einer `AWS::Lambda::EventSourceMapping` Ressource übergeben.

 `Queue`   <a name="sam-function-sqs-queue"></a>
Der ARN der Warteschlange.  
*Typ:* Zeichenfolge  
*Erforderlich*: Ja  
*CloudFormation Kompatibilität*: Diese Eigenschaft wird direkt an die `[EventSourceArn](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-eventsourcearn)` Eigenschaft einer `AWS::Lambda::EventSourceMapping` Ressource übergeben.

 `ScalingConfig`   <a name="sam-function-sqs-scalingconfig"></a>
Skalierung der Konfiguration von SQS-Pollern zur Steuerung der Aufrufrate und zur Festlegung der maximalen Anzahl gleichzeitiger Aufrufe.  
*Typ:* `[ScalingConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-scalingconfig.html)`  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft wird direkt an die `[ ScalingConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-scalingconfig.html)` Eigenschaft einer Ressource übergeben. `AWS::Lambda::EventSourceMapping`

## Beispiele
<a name="sam-property-function-sqs--examples"></a>

### MetricsConfig Ereignis
<a name="sam-property-function-sqs-example-metricsconfigevent"></a>

Im Folgenden finden Sie ein Beispiel für eine Ressource, die die `MetricsConfig` Eigenschaft verwendet, um jede Phase der Verarbeitung ihrer Ereignisquellenzuordnungen zu erfassen.

```
Resources:
  FilteredEventsFunction:
    Type: AWS::Serverless::Function
    Properties:
      CodeUri: s3://sam-demo-bucket/metricsConfig.zip
      Handler: index.handler
      Runtime: nodejs16.x
      Events:
        KinesisStream:
          Type: Kinesis
          Properties:
            Stream: !GetAtt KinesisStream.Arn
            StartingPosition: LATEST
            MetricsConfig:
              Metrics:
              - EventCount
```

### Einfaches SQS-Ereignis
<a name="sam-property-function-sqs--examples--sqs-event"></a>

```
Events:
  SQSEvent:
    Type: SQS
    Properties:
      Queue: arn:aws:sqs:us-west-2:012345678901:my-queue
      BatchSize: 10
      Enabled: false
      FilterCriteria:
        Filters:
          - Pattern: '{"key": ["val1", "val2"]}'
```

### Konfigurieren Sie die teilweise Batch-Berichterstattung für Ihre SQS-Warteschlange
<a name="sam-property-function-sqs--examples--sqs-partial-batch"></a>

```
Events:
  SQSEvent:
    Type: SQS
    Properties:
      Enabled: true
      FunctionResponseTypes:
        - ReportBatchItemFailures
      Queue: !GetAtt MySqsQueue.Arn
      BatchSize: 10
```

### Lambda-Funktion mit einem SQS-Ereignis, für das die Skalierung konfiguriert ist
<a name="sam-property-function-sqs--examples--sqs-event-scaling"></a>

```
MyFunction:
  Type: AWS::Serverless::Function
  Properties:
    ...
    Events:
      MySQSEvent:
        Type: SQS
        Properties:
          ...
          ScalingConfig:
            MaximumConcurrency: 10
```

### ProvisionedPollerConfig Beispiel
<a name="sam-property-function-sqs-example-provisionedpollerconfig"></a>

```
MyFunction:
  Type: AWS::Serverless::Function
  Properties:
    Handler: index.handler
    Runtime: nodejs18.x
    Timeout: 30
    Events:
      SQSEvent:
        Type: SQS
        Properties:
          Queue: !GetAtt MyQueue.Arn
          BatchSize: 10
          Enabled: True
          ProvisionedPollerConfig:
            MaximumPollers: 300
            MinimumPollers: 10
```