Update attributes more aggressively on faked subscriptions
@@ -869,6 +869,7 @@ class AWSSNSSQSTransport(Invoker):
TopicArn=topic_arn, Protocol="sqs", Endpoint=queue_arn, Attributes=attributes
)
subscription_arn = response.get("SubscriptionArn")
+ if subscription_arn and "000000000000" not in subscription_arn:
update_attributes = False
except botocore.exceptions.ClientError as e:
error_message = str(e)
@@ -904,6 +905,7 @@ class AWSSNSSQSTransport(Invoker):
if update_attributes and attributes:
for attribute_name, attribute_value in attributes.items():
try:
+ if "000000000000" not in subscription_arn:
logging.getLogger("transport.aws_sns_sqs").info(
"Updating '{}' attribute on subscription for topic ARN '{}' and queue ARN '{}' - changes can take several minutes to propagate".format(
attribute_name, topic_arn, queue_arn
