From 59bdebe73acb2c4f919f6df55a6dc92ed3e93d17 Mon Sep 17 00:00:00 2001 From: Ignacio Nin Date: Fri, 30 Jun 2017 19:23:18 -0300 Subject: [PATCH] Check that FIFO Queues end with .fifo Add a validate() method in sqs.py that checks that FIFO queues (*) have a QueueName parameter and (*) QueueName ends with '.fifo' as required by AWS: http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html --- troposphere/sqs.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/troposphere/sqs.py b/troposphere/sqs.py index 13051bf2c..99257f9ed 100644 --- a/troposphere/sqs.py +++ b/troposphere/sqs.py @@ -34,6 +34,12 @@ class Queue(AWSObject): 'VisibilityTimeout': (integer, False), } + def validate(self): + if self.properties.get('FifoQueue'): + if not self.properties.get('QueueName', '').endswith('.fifo'): + raise ValueError("SQS: FIFO queues need to provide a " + "QueueName that ends with '.fifo'") + class QueuePolicy(AWSObject): resource_type = "AWS::SQS::QueuePolicy"