diff --git a/sns_topic.py b/sns_topic.py index 9755450c455..561c9d615c4 100644 --- a/sns_topic.py +++ b/sns_topic.py @@ -26,8 +26,11 @@ type: str topic_type: description: - - The type of topic that should be created. Either Standard for FIFO (first-in, first-out) - choices: ['standard', 'fifo'] + - The type of topic that should be created. Either Standard for FIFO (first-in, first-out). + - Some regions, including GovCloud regions do not support FIFO topics. + Use a default value of 'standard' or omit the option if the region + does not support FIFO topics. + choices: ["standard", "fifo"] default: 'standard' type: str version_added: 2.0.0 @@ -363,9 +366,11 @@ def __init__(self, self.attributes_set = [] def _create_topic(self): - attributes = {'FifoTopic': 'false'} + attributes = {} tags = [] + # NOTE: Never set FifoTopic = False. Some regions (including GovCloud) + # don't support the attribute being set, even to False. if self.topic_type == 'fifo': attributes['FifoTopic'] = 'true' if not self.name.endswith('.fifo'): @@ -373,7 +378,9 @@ def _create_topic(self): if not self.check_mode: try: - response = self.connection.create_topic(Name=self.name, Attributes=attributes, Tags=tags) + response = self.connection.create_topic(Name=self.name, + Attributes=attributes, + Tags=tags) except (botocore.exceptions.ClientError, botocore.exceptions.BotoCoreError) as e: self.module.fail_json_aws(e, msg="Couldn't create topic %s" % self.name) self.topic_arn = response['TopicArn'] @@ -506,7 +513,6 @@ def ensure_gone(self): def main(): - # We're kinda stuck with CamelCase here, it would be nice to switch to # snake_case, but we'd need to purge out the alias entries http_retry_args = dict(