Difference between revisions of "RedrivePolicy"

From wikieduonline
Jump to navigation Jump to search
(Created page with " aws sns set-subscription-attributes \ --subscription-arn arn:aws:sns:us-east-2:123456789012:MyEndpoint:1234a567-bc89-012d-3e45-6fg7h890123i --attribute-name RedrivePo...")
 
 
(3 intermediate revisions by the same user not shown)
Line 6: Line 6:
 
  --attribute-value "{\"deadLetterTargetArn\": \"arn:aws:sqs:us-east-2:123456789012:MyDeadLetterQueue\"}"
 
  --attribute-value "{\"deadLetterTargetArn\": \"arn:aws:sqs:us-east-2:123456789012:MyDeadLetterQueue\"}"
  
 +
 +
* [[Configuring an Amazon SNS dead-letter queue for a subscription]]
 +
 +
 +
# SNS Topic Subscription with DLQ
 +
resource "aws_sns_topic_subscription" "main_order" {
 +
  topic_arn = aws_sns_topic.main_order.arn
 +
  protocol  = "sqs"
 +
  endpoint  = aws_sqs_queue.main_queue.arn
 +
 +
  # Configure the redrive policy to point to the DLQ
 +
  redrive_policy = jsonencode({
 +
    deadLetterTargetArn = aws_sqs_queue.dlq.arn
 +
  })
 +
}
 +
 +
 +
* [[redrive_policy]] in [[aws_sns_topic_subscription]] resource [https://github.com/hashicorp/terraform-provider-aws/pull/11770 ref]
  
 
{{aws sns set-subscription-attributes}}
 
{{aws sns set-subscription-attributes}}

Latest revision as of 11:08, 13 March 2025


aws sns set-subscription-attributes \
--subscription-arn arn:aws:sns:us-east-2:123456789012:MyEndpoint:1234a567-bc89-012d-3e45-6fg7h890123i
--attribute-name RedrivePolicy
--attribute-value "{\"deadLetterTargetArn\": \"arn:aws:sqs:us-east-2:123456789012:MyDeadLetterQueue\"}"



# SNS Topic Subscription with DLQ
resource "aws_sns_topic_subscription" "main_order" {
  topic_arn = aws_sns_topic.main_order.arn
  protocol  = "sqs"
  endpoint  = aws_sqs_queue.main_queue.arn

  # Configure the redrive policy to point to the DLQ
  redrive_policy = jsonencode({
    deadLetterTargetArn = aws_sqs_queue.dlq.arn
  })
}


aws sns set-subscription-attributes

Advertising: