Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check that FIFO Queues end with .fifo #757

Merged
merged 1 commit into from
Jul 9, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions troposphere/sqs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The docs indicate QueueName is not required. But this code would raise an error if FifoQueue was specified without QueueName.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strangely, that's the first thing I thought too when we started using this internally. But after testing, it turns out that if you specify FifoQueue, you have to specify a QueueName, and it has to end with .fifo. It's annoying, but CF isn't smart enough to understand it has to add .fifo, which isn't all that surprising after all this time of messing w/ CF :)

raise ValueError("SQS: FIFO queues need to provide a "
"QueueName that ends with '.fifo'")


class QueuePolicy(AWSObject):
resource_type = "AWS::SQS::QueuePolicy"
Expand Down