Specifies an SQS queue or SNS topic that AWS Lambda (Lambda) sends events to when it can't process them. For more information about dead letter queue functionality, see AWS Lambda Function Dead Letter Queues.
SAM will automatically add appropriate permission to your Lambda function execution role to give Lambda service access to the resource. sqs:SendMessage will be added for SQS queues and sns:Publish for SNS topics.
To declare this entity in your AWS Serverless Application Model (AWS SAM) template, use the following syntax.
[TargetArn](#sam-function-deadletterqueue-targetarn): String
[Type](#sam-function-deadletterqueue-type): String
TargetArn
The Amazon Resource Name (ARN) of an Amazon SQS queue or Amazon SNS topic.
Type: String
Required: Yes
AWS CloudFormation compatibility: This property is passed directly to the [TargetArn](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-deadletterconfig.html#cfn-lambda-function-deadletterconfig-targetarn)
property of the AWS::Lambda::Function
DeadLetterConfig
data type.
Type
The type of dead letter queue.
Valid values: SNS
, SQS
Type: String
Required: Yes
AWS CloudFormation compatibility: This property is unique to AWS SAM and doesn't have an AWS CloudFormation equivalent.
Dead Letter Queue example for an SNS topic.
DeadLetterQueue:
Type: SNS
TargetArn: arn:aws:sns:us-east-2:123456789012:my-topic