Skip to content

Support redriveAllowPolicy for SQS DeadLetterQueues #1806

@guitarrapc

Description

@guitarrapc

Is your feature request related to a problem?
There are no CRD field, api/Queue.go and pkg/resource/queue/sdk.go to accpect redriveAllowPolicy for DeadLetterQueue, which permit source queues to allow sending DLQ message to.

see: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_SetQueueAttributes.html

There is redrivePolicy, so I can set queue to indicate where is DLQ, but I cannot allow DLQ for source queues.

Describe the solution you'd like
Support of redriveAllowPolicy.

apiVersion: sqs.services.k8s.aws/v1alpha1
kind: Queue
metadata:
  name: test-queue
  annotations:
    services.k8s.aws/region: ap-northeast-1
spec:
  queueName: test-queue
  policy: |
    {
     // .. omit
    }
  redrivePolicy: |
    {
      "deadLetterTargetArn": "arn:aws:sqs:ap-northeast-1:111111111111:test-dead-letter-queue", # <-- How can we handle circular reference?
      "maxReceiveCount": 10
    }
---
apiVersion: sqs.services.k8s.aws/v1alpha1
kind: Queue
metadata:
  name: test-dead-letter-queue
  namespace: default
  annotations:
    services.k8s.aws/region: ap-northeast-1
spec:
  queueName: test-dead-letter-queue
  policy: |
    {
     // .. omit
    }
  redriveAllowPolicy: | # <---- Missing this field!!
    {
      redrivePermission = "byQueue",
      sourceQueueArns   = ["arn:aws:sqs:ap-northeast-1:111111111111:test-queue"] # <-- How can we handle circular reference?
    }

However, how can I control dependency order when redriveAllowPolicy is comming? DQL require redriveAllowPolicy and Queue require redrivePolicy, it's circular reference. Terraform offers aws_sqs_queue_redrive_allow_policy to set policy after queue and DLQ has beed created..

Describe alternatives you've considered
A description of any alternative solutions or features you've considered.

None.

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.kind/featureCategorizes issue or PR as related to a new feature.service/sqsIndicates issues or PRs that are related to sqs-controller.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions