

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.

# DocumentDB
<a name="sam-property-function-documentdb"></a>

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

## Syntax
<a name="sam-property-function-documentdb-syntax"></a>

Verwenden Sie die folgende Syntax, um diese Entität in Ihrer AWS SAM Vorlage zu deklarieren.

### YAML
<a name="sam-property-function-documentdb-syntax-yaml"></a>

```
BatchSize: Integer
Cluster: [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-filtercriteria.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-filtercriteria.html)
CollectionName: String
DatabaseName: String
Enabled: Boolean
FilterCriteria: [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-filtercriteria.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-filtercriteria.html)
FullDocument: String
KmsKeyArn: String  
MaximumBatchingWindowInSeconds: Integer
SecretsManagerKmsKeyId: String
SourceAccessConfigurations: List
StartingPosition: String
StartingPositionTimestamp: Double
```

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

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

 `Cluster`   <a name="sam-function-documentdb-cluster"></a>
Der Amazon-Ressourcenname (ARN) des Amazon DocumentDB-Clusters.  
*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.

 `CollectionName`   <a name="sam-function-documentdb-collectionname"></a>
Der Name der Sammlung, die in der Datenbank verwendet werden soll. Wenn Sie keine Sammlung angeben, verbraucht Lambda alle Sammlungen.  
*Typ:* Zeichenfolge  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft wird direkt an die `[ CollectionName](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-documentdbeventsourceconfig.html#cfn-lambda-eventsourcemapping-documentdbeventsourceconfig-collectionname)` Eigenschaft eines `AWS::Lambda::EventSourceMapping` `DocumentDBEventSourceConfig` Datentyps übergeben.

 `DatabaseName`   <a name="sam-function-documentdb-databasename"></a>
Der Name der Datenbank, die innerhalb des Amazon DocumentDB-Clusters verwendet werden soll.  
*Typ:* Zeichenfolge  
*Erforderlich*: Ja  
*CloudFormation Kompatibilität*: Diese Eigenschaft wird direkt an die `[ DatabaseName](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-documentdbeventsourceconfig.html#cfn-lambda-eventsourcemapping-documentdbeventsourceconfig-databasename)` Eigenschaft eines `AWS::Lambda::EventSourceMapping` `DocumentDBEventSourceConfig` Datentyps übergeben.

 `Enabled`   <a name="sam-function-documentdb-enabled"></a>
Falls`true`, ist die Zuordnung der Ereignisquelle aktiv. Um die Abfrage und den Aufruf zu unterbrechen, legen Sie den Wert auf fest. `false`  
*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-documentdb-filtercriteria"></a>
Ein Objekt, das die Kriterien definiert, die bestimmen, ob Lambda ein Ereignis verarbeiten soll. Weitere Informationen finden Sie unter [Lambda-Ereignisfilterung](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html) im *AWS Lambda Developer Guide*.  
*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.

 `FullDocument`   <a name="sam-function-documentdb-fulldocument"></a>
Legt fest, was Amazon DocumentDB bei Dokumentaktualisierungen an Ihren Event-Stream sendet. Wenn auf gesetzt`UpdateLookup`, sendet Amazon DocumentDB ein Delta, das die Änderungen beschreibt, zusammen mit einer Kopie des gesamten Dokuments. Andernfalls sendet Amazon DocumentDB nur einen Teil des Dokuments, das die Änderungen enthält.  
*Typ:* Zeichenfolge  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft wird direkt an die `[ FullDocument](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-documentdbeventsourceconfig.html#cfn-lambda-eventsourcemapping-documentdbeventsourceconfig-fulldocument)` Eigenschaft eines `AWS::Lambda::EventSourceMapping` `DocumentDBEventSourceConfig` Datentyps übergeben.

 `KmsKeyArn`   <a name="sam-function-documentdb-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-documentdb-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.

 `SecretsManagerKmsKeyId`   <a name="sam-function-documentdb-secretsmanagerkmskeyid"></a>
Die AWS Key Management Service (AWS KMS) Schlüssel-ID eines vom Kunden verwalteten Schlüssels von AWS Secrets Manager. Erforderlich, wenn Sie einen vom Kunden verwalteten Schlüssel von Secrets Manager mit einer Lambda-Ausführungsrolle verwenden, die die `kms:Decrypt` Berechtigung nicht enthält.  
Der Wert dieser Eigenschaft ist eine UUID. Beispiel: `1abc23d4-567f-8ab9-cde0-1fab234c5d67`.  
*Typ:* Zeichenfolge  
*Required*: Conditional  
*CloudFormation Kompatibilität*: Diese Eigenschaft ist einzigartig für AWS SAM und hat kein CloudFormation Äquivalent.

 `SourceAccessConfigurations`   <a name="sam-function-documentdb-sourceaccessconfigurations"></a>
Ein Array des Authentifizierungsprotokolls oder des virtuellen Hosts. Geben Sie dies mithilfe des [SourceAccessConfigurations](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-sourceaccessconfiguration.html)Datentyps an.  
Für den Typ der `DocumentDB` Ereignisquelle ist der einzig gültige Konfigurationstyp`BASIC_AUTH`.  
+ `BASIC_AUTH`— Das Secrets Manager Manager-Geheimnis, in dem Ihre Broker-Anmeldeinformationen gespeichert werden. Für diesen Typ müssen die Anmeldeinformationen das folgende Format haben:`{"username": "your-username", "password": "your-password"}`. Nur ein Objekt des Typs `BASIC_AUTH` ist zulässig.
*Typ*: Liste  
*Erforderlich*: Ja  
*CloudFormation Kompatibilität*: Diese Eigenschaft wird direkt an die `[ SourceAccessConfigurations](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-sourceaccessconfigurations)` Eigenschaft einer `AWS::Lambda::EventSourceMapping` Ressource übergeben.

 `StartingPosition`   <a name="sam-function-documentdb-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.
*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-documentdb-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.

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

### Amazon DocumentDB DocumentDB-Ereignisquelle
<a name="sam-property-function-documentdb-examples-example1"></a>

```
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
...
Resources:
  MyFunction:
    Type: AWS::Serverless::Function
    Properties:
    ...
      Events:
        MyDDBEvent:
          Type: DocumentDB
          Properties:
            Cluster: "arn:aws:rds:us-west-2:123456789012:cluster:docdb-2023-01-01"
            BatchSize: 10
            MaximumBatchingWindowInSeconds: 5
            DatabaseName: "db1"
            CollectionName: "collection1"
            FullDocument: "UpdateLookup"
            SourceAccessConfigurations:
              - Type: BASIC_AUTH
                URI: "arn:aws:secretsmanager:us-west-2:123456789012:secret:doc-db"
```