From 98501ae676793e74fe20af700f320e519e0997d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristopher=20Pinz=C3=B3n?= Date: Tue, 26 Jul 2022 07:57:44 -0500 Subject: [PATCH] add subscription role arn attribute (#5303) --- moto/sns/models.py | 1 + tests/test_sns/test_subscriptions_boto3.py | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/moto/sns/models.py b/moto/sns/models.py index 7d4ff85d1..f2f417a29 100644 --- a/moto/sns/models.py +++ b/moto/sns/models.py @@ -727,6 +727,7 @@ class SNSBackend(BaseBackend): "DeliveryPolicy", "FilterPolicy", "RedrivePolicy", + "SubscriptionRoleArn", ]: raise SNSInvalidParameter("AttributeName") diff --git a/tests/test_sns/test_subscriptions_boto3.py b/tests/test_sns/test_subscriptions_boto3.py index 3b245ef4a..e5844bd4d 100644 --- a/tests/test_sns/test_subscriptions_boto3.py +++ b/tests/test_sns/test_subscriptions_boto3.py @@ -258,6 +258,8 @@ def test_creating_subscription_with_attributes(): } ) + subscription_role_arn = "arn:aws:iam:000000000:role/test-role" + conn.subscribe( TopicArn=topic_arn, Protocol="http", @@ -266,6 +268,7 @@ def test_creating_subscription_with_attributes(): "RawMessageDelivery": "true", "DeliveryPolicy": delivery_policy, "FilterPolicy": filter_policy, + "SubscriptionRoleArn": subscription_role_arn, }, ) @@ -284,6 +287,7 @@ def test_creating_subscription_with_attributes(): attrs["Attributes"]["RawMessageDelivery"].should.equal("true") attrs["Attributes"]["DeliveryPolicy"].should.equal(delivery_policy) attrs["Attributes"]["FilterPolicy"].should.equal(filter_policy) + attrs["Attributes"]["SubscriptionRoleArn"].should.equal(subscription_role_arn) # Now unsubscribe the subscription conn.unsubscribe(SubscriptionArn=subscription["SubscriptionArn"])