awslabs / serverless-rules

Compilation of rules to validate infrastructure-as-code templates against recommended practices for serverless applications.
https://awslabs.github.io/serverless-rules/
MIT No Attribution
403 stars 25 forks source link

Recurring SQS Redrive rule for Terraform #83

Open nmoutschen opened 3 years ago

nmoutschen commented 3 years ago

Follow-up of https://github.com/awslabs/serverless-rules/issues/79 but for terraform

What were you trying to accomplish?

Expected Behavior

If an SQS queue is a DLQ for another queue, it should not require a redrive_policy.

Current Behavior

Right now, all SQS queues require a redrive_policy per the aws_sqs_queue_redrive_policy rule.

Possible Solution

Inspect the redrive_policy of all queues and infer is a queue is a DLQ or not, then ignore the rule for those queues.

Steps to Reproduce (for bugs)

Skipping this

Environment

N/A

nmoutschen commented 2 years ago

Won't fix for now as TFLint cannot cross-reference resources based on dynamic values. See https://github.com/awslabs/serverless-rules/issues/107