Amazon web services 为amazon SAM yaml中的lambda队列配置死信队列

Amazon web services 为amazon SAM yaml中的lambda队列配置死信队列,amazon-web-services,aws-lambda,Amazon Web Services,Aws Lambda,试图得到一个SAM YAML脚本来正确设置我的lambda。我创建了一个连接到aqueue的lambda,这只是一个简单的过程 myQueue: Type: AWS::SQS:Queue myLambda: Type: AWS::Serverless::Function Properties: Events: myQueueEvent: Type: SQS Properties: Queue

试图得到一个SAM YAML脚本来正确设置我的lambda。我创建了一个连接到aqueue的lambda,这只是一个简单的过程

myQueue:
   Type: AWS::SQS:Queue

myLambda:
  Type: AWS::Serverless::Function
  Properties:
     Events:
        myQueueEvent:
          Type: SQS
          Properties:
            Queue: !GetAtt myQueue.arn
还有一堆其他的东西被拿走了。。。据我所知,看起来我应该能够添加一个DeadLetterConfig并将其指向另一个队列-但无论我尝试将其放置在何处,它都不起作用


本质上,我要寻找的行为是,如果我将一个值放入队列,那么它会自动从队列中弹出到lambda中。如果反正lambda出错,例如抛出异常-该项最终进入死信队列-否则它将被消耗并消失。我只是误解了,这是不可能的吗?

我想出来了-你实际上把它放在了队列中-例如:

  RedrivePolicy:
    deadLetterTargetArn: !GetAtt deadLetterQueue.Arn
    maxReceiveCount: 2

我想出来了-你真的把它放在队列上了-例如:

  RedrivePolicy:
    deadLetterTargetArn: !GetAtt deadLetterQueue.Arn
    maxReceiveCount: 2