Skip to content

Latest commit

 

History

History
65 lines (49 loc) · 3.25 KB

sam-property-function-sqs.md

File metadata and controls

65 lines (49 loc) · 3.25 KB

SQS

The object describing an SQS event source type. For more information, see Using AWS Lambda with Amazon SQS in the AWS Lambda Developer Guide.

SAM generates AWS::Lambda::EventSourceMapping resource when this event type is set

Syntax

To declare this entity in your AWS Serverless Application Model (AWS SAM) template, use the following syntax.

YAML

  [BatchSize](#sam-function-sqs-batchsize): Integer
  [Enabled](#sam-function-sqs-enabled): Boolean
  [MaximumBatchingWindowInSeconds](#sam-function-sqs-maximumbatchingwindowinseconds): Integer
  [Queue](#sam-function-sqs-queue): String

Properties

BatchSize The maximum number of items to retrieve in a single batch.
Type: Integer
Required: No
Default: 10
AWS CloudFormation compatibility: This property is passed directly to the [BatchSize](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-batchsize) property of an AWS::Lambda::EventSourceMapping resource.
Minimum: 1
Maximum: 10000

Enabled Disables the event source mapping to pause polling and invocation.
Type: Boolean
Required: No
AWS CloudFormation compatibility: This property is passed directly to the [Enabled](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-enabled) property of an AWS::Lambda::EventSourceMapping resource.

MaximumBatchingWindowInSeconds The maximum amount of time, in seconds, to gather records before invoking the function.
Type: Integer
Required: No
AWS CloudFormation compatibility: This property is passed directly to the [MaximumBatchingWindowInSeconds](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-maximumbatchingwindowinseconds) property of an AWS::Lambda::EventSourceMapping resource.

Queue The ARN of the queue.
Type: String
Required: Yes
AWS CloudFormation compatibility: This property is passed directly to the [EventSourceArn](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-eventsourcearn) property of an AWS::Lambda::EventSourceMapping resource.

Examples

SQS Event

SQS Event

YAML

Events:
  SQSEvent:
    Type: SQS
    Properties:
      Queue: arn:aws:sqs:us-west-2:012345678901:my-queue
      BatchSize: 10
      Enabled: false