I have a lambda configured to be triggered when messages are published to SQS queue. Here is the SAM template for deployment.
MyQueue:
Type: AWS::SQS::Queue
Properties:
VisibilityTimeout: 180
DelaySeconds: 90
MyLambda:
Type: AWS::Serverless::Function
Properties:
CodeUri: ../pathToCode
Handler: index.handler
Events:
MySQSEvent:
Type: SQS
Properties:
Queue: !GetAtt MyQueue.Arn
I am using DelaySeconds
property of AWS::SQS::QUEUE
which apparently doesn't work. My lambda get executed as soon as the message is published to queue. How can I put delay in it?