Skip to content

Resource: awsSqsQueueRedriveAllowPolicy

Provides a SQS Queue Redrive Allow Policy resource.

Example Usage

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as aws from "./.gen/providers/aws";
const awsSqsQueueExample = new aws.sqsQueue.SqsQueue(this, "example", {
  name: "examplequeue",
});
new aws.sqsQueue.SqsQueue(this, "src", {
  name: "srcqueue",
  redrivePolicy:
    "${jsonencode({\n    deadLetterTargetArn = aws_sqs_queue.example.arn\n    maxReceiveCount     = 4\n  })}",
});
const awsSqsQueueRedriveAllowPolicyExample =
  new aws.sqsQueueRedriveAllowPolicy.SqsQueueRedriveAllowPolicy(
    this,
    "example_2",
    {
      queueUrl: awsSqsQueueExample.id,
      redriveAllowPolicy:
        '${jsonencode({\n    redrivePermission = "byQueue",\n    sourceQueueArns   = [aws_sqs_queue.src.arn]\n  })}',
    }
  );
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
awsSqsQueueRedriveAllowPolicyExample.overrideLogicalId("example");

Argument Reference

The following arguments are supported:

  • queueUrl - (Required) The URL of the SQS Queue to which to attach the policy
  • redriveAllowPolicy - (Required) The JSON redrive allow policy for the SQS queue. Learn more in the Amazon SQS dead-letter queues documentation.

Attributes Reference

No additional attributes are exported.

Import

SQS Queue Redrive Allow Policies can be imported using the queue URL, e.g.,

$ terraform import aws_sqs_queue_redrive_allow_policy.test https://queue.amazonaws.com/0123456789012/myqueue