

기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.

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

`DynamoDB` 이벤트 소스 유형을 설명하는 객체. 자세한 내용은 *AWS Lambda 개발자 안내서*의 [Amazon DynamoDB AWS Lambda 에서 사용을](https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html) 참조하세요.

AWS SAM 이 이벤트 유형이 설정되면가 [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) 리소스를 생성합니다.

## 구문
<a name="sam-property-function-dynamodb-syntax"></a>

 AWS Serverless Application Model (AWS SAM) 템플릿에서이 개체를 선언하려면 다음 구문을 사용합니다.

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

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

 `BatchSize`   <a name="sam-function-dynamodb-batchsize"></a>
한 번의 배치에서 검색하는 최대 항목 수입니다.  
*유형*: 정수  
*필수 항목 여부*: 아니요  
*기본값*: 100  
*CloudFormation 호환성*:이 속성은 `AWS::Lambda::EventSourceMapping` 리소스의 `[BatchSize](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-batchsize)` 속성으로 직접 전달됩니다.  
*최소*: `1`  
*최대*: `1000`

 `BisectBatchOnFunctionError`   <a name="sam-function-dynamodb-bisectbatchonfunctionerror"></a>
함수가 오류를 제시하면 비치를 2개로 분할해서 다시 시도합니다.  
*유형*: 부울  
*필수 항목 여부*: 아니요  
*CloudFormation 호환성*:이 속성은 `AWS::Lambda::EventSourceMapping` 리소스의 `[BisectBatchOnFunctionError](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-bisectbatchonfunctionerror)` 속성으로 직접 전달됩니다.

 `DestinationConfig`   <a name="sam-function-dynamodb-destinationconfig"></a>
폐기된 기록을 위한 Amazon Simple Queue Service(Amazon SQS) 대기열 또는 Amazon Simple Notification Service(SNS) 주제 대상입니다.  
*유형*: [DestinationConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-destinationconfig)  
*필수 항목 여부*: 아니요  
*CloudFormation 호환성*:이 속성은 `AWS::Lambda::EventSourceMapping` 리소스의 `[DestinationConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-destinationconfig)` 속성으로 직접 전달됩니다.

 `Enabled`   <a name="sam-function-dynamodb-enabled"></a>
이벤트 소스 매핑을 비활성화하여 폴링 및 간접 호출을 일시 중지합니다.  
*유형*: 부울  
*필수 항목 여부*: 아니요  
*CloudFormation 호환성*:이 속성은 `AWS::Lambda::EventSourceMapping` 리소스의 `[Enabled](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-enabled)` 속성으로 직접 전달됩니다.

 `FilterCriteria`   <a name="sam-function-dynamodb-filtercriteria"></a>
Lambda가 이벤트를 처리해야 하는지 결정하는 기준을 정의하는 객체입니다. 자세한 내용은 [AWS Lambda 개발자 가이드](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html)의 *AWS Lambda 이벤트 필터링*을 참조하세요.  
*유형*: [FilterCriteria](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-filtercriteria.html)  
*필수 항목 여부*: 아니요  
*CloudFormation 호환성*:이 속성은 `AWS::Lambda::EventSourceMapping` 리소스의 `[FilterCriteria](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-filtercriteria.html)` 속성으로 직접 전달됩니다.

 `FunctionResponseTypes`   <a name="sam-function-dynamodb-functionresponsetypes"></a>
이벤트 소스 매핑에 현재 적용된 응답 유형의 목록입니다. 자세한 내용은 *AWS Lambda Developer Guide의* [ Reporting batch item failures](https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html#services-ddb-batchfailurereporting)를 참조하세요.  
*유효한 값*: `ReportBatchItemFailures`  
*유형*: 목록  
*필수 항목 여부*: 아니요  
*CloudFormation 호환성*:이 속성은 `AWS::Lambda::EventSourceMapping` 리소스의 `[FunctionResponseTypes](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-functionresponsetypes)` 속성으로 직접 전달됩니다.

 `KmsKeyArn`   <a name="sam-function-dynamodb-kmskeyarn"></a>
이 이벤트와 관련된 정보를 암호화하는 키의 Amazon 리소스 이름(ARN)입니다.  
*유형*: 문자열  
*필수 항목 여부*: 아니요  
*CloudFormation 호환성*:이 속성은 `AWS::Lambda::EventSourceMapping` 리소스의 `[KmsKeyArn](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-kmskeyarn)` 속성으로 직접 전달됩니다.

 `MaximumBatchingWindowInSeconds`   <a name="sam-function-dynamodb-maximumbatchingwindowinseconds"></a>
함수를 호출하기 전에 기록을 수집할 최대 기간(단위: 초)입니다.  
*유형*: 정수  
*필수 항목 여부*: 아니요  
*CloudFormation 호환성*:이 속성은 `AWS::Lambda::EventSourceMapping` 리소스의 `[MaximumBatchingWindowInSeconds](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-maximumbatchingwindowinseconds)` 속성으로 직접 전달됩니다.

 `MaximumRecordAgeInSeconds`   <a name="sam-function-dynamodb-maximumrecordageinseconds"></a>
Lambda가 처리를 위해 함수에 보내는 기록의 최대 사용 기간입니다.  
*유형*: 정수  
*필수 항목 여부*: 아니요  
*CloudFormation 호환성*:이 속성은 `AWS::Lambda::EventSourceMapping` 리소스의 `[MaximumRecordAgeInSeconds](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-maximumrecordageinseconds)` 속성으로 직접 전달됩니다.

 `MaximumRetryAttempts`   <a name="sam-function-dynamodb-maximumretryattempts"></a>
함수가 오류를 반환할 때 재시도하는 최대 횟수입니다.  
*유형*: 정수  
*필수 항목 여부*: 아니요  
*CloudFormation 호환성*:이 속성은 `AWS::Lambda::EventSourceMapping` 리소스의 `[MaximumRetryAttempts](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-maximumretryattempts)` 속성으로 직접 전달됩니다.

 `MetricsConfig`   <a name="sam-function-dynamodb-metricsconfig"></a>
처리 단계별로 캡처하는 이벤트 소스 매핑에 대한 향상된 지표를 얻기 위한 옵트인 구성입니다. 예제는 [MetricsConfig 이벤트](#sam-property-function-dynamodb-example-metricsconfigevent) 섹션을 참조하세요.  
*유형*: [MetricsConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-metricsconfig)  
*필수 항목 여부*: 아니요  
*CloudFormation 호환성*:이 속성은 `AWS::Lambda::EventSourceMapping` 리소스의 `[MetricsConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-metricsconfig)` 속성으로 직접 전달됩니다.

 `ParallelizationFactor`   <a name="sam-function-dynamodb-parallelizationfactor"></a>
각 샤드에서 동시에 처리할 배치의 수입니다.  
*유형*: 정수  
*필수 항목 여부*: 아니요  
*CloudFormation 호환성*:이 속성은 `AWS::Lambda::EventSourceMapping` 리소스의 `[ParallelizationFactor](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-parallelizationfactor)` 속성으로 직접 전달됩니다.

 `StartingPosition`   <a name="sam-function-dynamodb-startingposition"></a>
읽기를 시작하는 스트림 내의 위치입니다.  
+ `AT_TIMESTAMP` - 기록 읽기를 시작할 시간을 지정합니다.
+ `LATEST` – 새 기록만 읽습니다.
+ `TRIM_HORIZON` – 사용 가능한 모든 기록을 처리합니다.
*유효한 값*: `AT_TIMESTAMP` \$1 `LATEST` \$1 `TRIM_HORIZON`  
*유형*: 문자열  
*필수 항목 여부:* 예  
*CloudFormation 호환성*:이 속성은 `AWS::Lambda::EventSourceMapping` 리소스의 `[StartingPosition](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-startingposition)` 속성으로 직접 전달됩니다.

 `StartingPositionTimestamp`   <a name="sam-function-dynamodb-startingpositiontimestamp"></a>
읽기를 시작하는 시간(유닉스 시간 초 단위)입니다. `StartingPositionTimestamp` 언제 `StartingPosition`를 `AT_TIMESTAMP`으로 지정할지 정의합니다.  
*유형*: Double  
*필수 항목 여부*: 아니요  
*CloudFormation 호환성*:이 속성은 `AWS::Lambda::EventSourceMapping` 리소스의 `[StartingPositionTimestamp](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-startingpositiontimestamp)` 속성으로 직접 전달됩니다.

 `Stream`   <a name="sam-function-dynamodb-stream"></a>
DynamoDB 스트림의 Amazon 리소스 이름(ARN)입니다.  
*유형*: 문자열  
*필수 항목 여부:* 예  
*CloudFormation 호환성*:이 속성은 `AWS::Lambda::EventSourceMapping` 리소스의 `[EventSourceArn](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-eventsourcearn)` 속성으로 직접 전달됩니다.

 `TumblingWindowInSeconds`   <a name="sam-function-dynamodb-tumblingwindowinseconds"></a>
처리 윈도우 기간(초 단위). 유효한 범위는 1 \$1 900입니다(15분).  
자세한 내용은 [ 개발자 가이드](https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html#streams-tumbling)의 *AWS Lambda Tumbling windows*를 참조하세요.  
*유형*: 정수  
*필수 항목 여부*: 아니요  
*CloudFormation 호환성*:이 속성은 `AWS::Lambda::EventSourceMapping` 리소스의 `[TumblingWindowInSeconds](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-tumblingwindowinseconds)` 속성으로 직접 전달됩니다.

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

### MetricsConfig 이벤트
<a name="sam-property-function-dynamodb-example-metricsconfigevent"></a>

다음은 이벤트 소스 매핑에 대한 처리 단계별 캡처를 위해 `MetricsConfig` 속성을 사용하는 리소스의 예시입니다.

```
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 테이블의 DynamoDB 이벤트 소스
<a name="sam-property-function-dynamodb--examples--dynamodb-event-source-for-existing-dynamodb-table"></a>

 AWS 계정에 이미 있는 DynamoDB 테이블의 DynamoDB 이벤트 소스입니다.

#### 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 테이블에 대한 DynamoDB 이벤트
<a name="sam-property-function-dynamodb--examples--dynamodb-event-for-dynamodb-table-declared-in-template"></a>

동일한 템플릿 파일에 선언된 DynamoDB 테이블에 대한 DynamoDB 이벤트입니다.

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