

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.

# DynamoDB
<a name="sam-property-function-dynamodb"></a>

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

AWS SAM generiert eine [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)Ressource, wenn dieser Ereignistyp festgelegt ist.

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

```
  [BatchSize](#sam-function-dynamodb-batchsize): Integer
  [BisectBatchOnFunctionError](#sam-function-dynamodb-bisectbatchonfunctionerror): Boolean
  [DestinationConfig](#sam-function-dynamodb-destinationconfig): [DestinationConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-destinationconfig)
  [Enabled](#sam-function-dynamodb-enabled): Boolean
  [FilterCriteria](#sam-function-dynamodb-filtercriteria): [FilterCriteria](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-filtercriteria.html)
  [FunctionResponseTypes](#sam-function-dynamodb-functionresponsetypes): List
  KmsKeyArn: String          
  [MaximumBatchingWindowInSeconds](#sam-function-dynamodb-maximumbatchingwindowinseconds): Integer
  [MaximumRecordAgeInSeconds](#sam-function-dynamodb-maximumrecordageinseconds): Integer
  [MaximumRetryAttempts](#sam-function-dynamodb-maximumretryattempts): Integer
  [MetricsConfig](#sam-function-dynamodb-metricsconfig): [MetricsConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-metricsconfig)
  [ParallelizationFactor](#sam-function-dynamodb-parallelizationfactor): Integer
  [StartingPosition](#sam-function-dynamodb-startingposition): String
  StartingPositionTimestamp: Double
  [Stream](#sam-function-dynamodb-stream): String
  [TumblingWindowInSeconds](#sam-function-dynamodb-tumblingwindowinseconds): Integer
```

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

 `BatchSize`   <a name="sam-function-dynamodb-batchsize"></a>
Gibt die maximale Anzahl der Elemente an, die in einem einzigen Stapel zurückzugeben werden.  
*Typ*: Ganzzahl  
*Required*: No  
*Standard*: 100  
*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*: `1000`

 `BisectBatchOnFunctionError`   <a name="sam-function-dynamodb-bisectbatchonfunctionerror"></a>
Wenn die Funktion einen Fehler zurückgibt, teilen Sie den Stapel in zwei Teile auf und versuchen Sie es erneut.  
*Typ*: Boolesch  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft wird direkt an die `[BisectBatchOnFunctionError](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-bisectbatchonfunctionerror)` Eigenschaft einer `AWS::Lambda::EventSourceMapping` Ressource übergeben.

 `DestinationConfig`   <a name="sam-function-dynamodb-destinationconfig"></a>
Eine Amazon Simple Queue Service (Amazon SQS) -Warteschlange oder ein Amazon Simple Notification Service (Amazon SNS) -Themenziel für verworfene Datensätze.  
*Typ:* [DestinationConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-destinationconfig)  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft wird direkt an die `[DestinationConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-destinationconfig)` Eigenschaft einer Ressource übergeben. `AWS::Lambda::EventSourceMapping`

 `Enabled`   <a name="sam-function-dynamodb-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-dynamodb-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-dynamodb-functionresponsetypes"></a>
Eine Liste der Antworttypen, die derzeit auf die Ereignisquellenzuordnung angewendet werden. Weitere Informationen finden Sie unter [Melden von Batch-Elementen](https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html#services-ddb-batchfailurereporting) im *AWS Lambda -Leitfaden für Entwickler*.  
*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-dynamodb-kmskeyarn"></a>
Der Amazon-Ressourcenname (ARN) des Schlüssels zur Verschlüsselung von Informationen im Zusammenhang mit 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-dynamodb-maximumbatchingwindowinseconds"></a>
Die maximale Zeitspanne zur Erfassung von Datensätzen vor dem Aufruf der Funktion in Sekunden.  
*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.

 `MaximumRecordAgeInSeconds`   <a name="sam-function-dynamodb-maximumrecordageinseconds"></a>
Das maximale Alter eines Datensatzes, den Lambda zur Verarbeitung an eine Funktion sendet.  
*Typ*: Ganzzahl  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft wird direkt an die `[MaximumRecordAgeInSeconds](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-maximumrecordageinseconds)` Eigenschaft einer `AWS::Lambda::EventSourceMapping` Ressource übergeben.

 `MaximumRetryAttempts`   <a name="sam-function-dynamodb-maximumretryattempts"></a>
Die maximale Anzahl der Wiederholungen, wenn die Funktion einen Fehler zurückgibt.  
*Typ*: Ganzzahl  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft wird direkt an die `[MaximumRetryAttempts](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-maximumretryattempts)` Eigenschaft einer `AWS::Lambda::EventSourceMapping` Ressource übergeben.

 `MetricsConfig`   <a name="sam-function-dynamodb-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-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`

 `ParallelizationFactor`   <a name="sam-function-dynamodb-parallelizationfactor"></a>
Die Anzahl der Batches, die von jedem Shard gleichzeitig verarbeitet werden sollen.  
*Typ*: Ganzzahl  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft wird direkt an die `[ParallelizationFactor](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-parallelizationfactor)` Eigenschaft einer Ressource übergeben. `AWS::Lambda::EventSourceMapping`

 `StartingPosition`   <a name="sam-function-dynamodb-startingposition"></a>
Die Position im Stream, an der mit dem Lesen begonnen wird.  
+ `AT_TIMESTAMP`— Geben Sie einen Zeitpunkt an, ab dem mit dem Lesen von Datensätzen begonnen werden soll.
+ `LATEST`— Nur neue Datensätze lesen.
+ `TRIM_HORIZON`— Verarbeitet alle verfügbaren Datensätze.
*Zulässige Werte*: `AT_TIMESTAMP` \$1 `LATEST` \$1 `TRIM_HORIZON`  
*Typ:* Zeichenfolge  
*Erforderlich*: Ja  
*CloudFormation Kompatibilität*: Diese Eigenschaft wird direkt an die `[StartingPosition](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-startingposition)` Eigenschaft einer `AWS::Lambda::EventSourceMapping` Ressource übergeben.

 `StartingPositionTimestamp`   <a name="sam-function-dynamodb-startingpositiontimestamp"></a>
Die Zeit, ab der mit dem Lesen begonnen werden soll, in Unix-Zeitsekunden. Definiert`StartingPositionTimestamp`, wann als angegeben `StartingPosition` ist`AT_TIMESTAMP`.  
*Type*: Double  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft wird direkt an die `[StartingPositionTimestamp](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-startingpositiontimestamp)` Eigenschaft einer `AWS::Lambda::EventSourceMapping` Ressource übergeben.

 `Stream`   <a name="sam-function-dynamodb-stream"></a>
Der Amazon-Ressourcenname (ARN) des DynamoDB-Streams.  
*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.

 `TumblingWindowInSeconds`   <a name="sam-function-dynamodb-tumblingwindowinseconds"></a>
Die Dauer eines Verarbeitungsfensters in Sekunden. Der gültige Bereich liegt zwischen 1 und 900 (15 Minuten).  
Weitere Informationen finden Sie unter [Tumbling windows](https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html#streams-tumbling) im *AWS Lambda Entwicklerhandbuch*.  
*Typ*: Ganzzahl  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft wird direkt an die `[TumblingWindowInSeconds](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-tumblingwindowinseconds)` Eigenschaft einer `AWS::Lambda::EventSourceMapping` Ressource übergeben.

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

### MetricsConfig Ereignis
<a name="sam-property-function-dynamodb-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
```

### DynamoDB-Ereignisquelle für bestehende DynamoDB-Tabelle
<a name="sam-property-function-dynamodb--examples--dynamodb-event-source-for-existing-dynamodb-table"></a>

DynamoDB-Ereignisquelle für eine DynamoDB-Tabelle, die bereits in einem Konto vorhanden ist. AWS 

#### YAML
<a name="sam-property-function-dynamodb--examples--dynamodb-event-source-for-existing-dynamodb-table--yaml"></a>

```
Events:
  DDBEvent:
    Type: DynamoDB
    Properties:
      Stream: arn:aws:dynamodb:us-east-1:123456789012:table/TestTable/stream/2016-08-11T21:21:33.291
      StartingPosition: TRIM_HORIZON
      BatchSize: 10
      Enabled: false
```

### DynamoDB-Ereignis für in der Vorlage deklarierte DynamoDB-Tabelle
<a name="sam-property-function-dynamodb--examples--dynamodb-event-for-dynamodb-table-declared-in-template"></a>

DynamoDB-Ereignis für eine DynamoDB-Tabelle, die in derselben Vorlagendatei deklariert ist.

#### YAML
<a name="sam-property-function-dynamodb--examples--dynamodb-event-for-dynamodb-table-declared-in-template--yaml"></a>

```
Events:
  DDBEvent:
    Type: DynamoDB
    Properties:
      Stream: 
        !GetAtt MyDynamoDBTable.StreamArn   # This must be the name of a DynamoDB table declared in the same template file
      StartingPosition: TRIM_HORIZON
      BatchSize: 10
      Enabled: false
```