sst / ion

SST v3
https://sst.dev
MIT License
1.88k stars 221 forks source link

Add dead letter queue for SQS. #480

Closed yyaskriloff closed 2 months ago

yyaskriloff commented 4 months ago

Adding the ability to add DLQ for SQS, SNS and I believe lambda.

const dlq = new sst.aws.Queue("DeadLetterQueue", {
  isDLQ: true // or maybe not having to set it
});

new sst.aws.Queue("MyQueue", {
  fifo: true,
  deadLetterQueue: dlq
});

new sst.aws.SnsTopic("MyTopic", {
  deadLetterQueue: dlq
});

or maybe even not having to create a new queue

new sst.aws.Queue("MyQueue", {
  fifo: true,
  deadLetterQueue: true
});
beeirl commented 4 months ago

@fwang are dlq a thing in the current version of ion? or is a custom component the only way to go about this right now?

Edit: Just stumbled across this in the pulumi docs. So I assume this should work? Haven't tested it yet though.

const dlq = new aws.sqs.Queue('DLQ')
const queue = new sst.aws.Queue('MyQueue', {
  transform: {
    queue: {
      redrivePolicy: dlq.arn.apply(arn => JSON.stringify({
        deadLetterTargetArn: arn,
        maxReceiveCount: 5
      }))
    }
  }
})
brunocleite commented 3 months ago

@yyaskriloff @beeirl Take a look at this PR, it adds Dead Letter Queue support https://github.com/sst/ion/pull/565

yyaskriloff commented 2 months ago

@yyaskriloff @beeirl Take a look at this PR, it adds Dead Letter Queue support

https://github.com/sst/ion/pull/565

Thank you.