sns_topic boto3 port (#39292)

* Port sns_topic to boto3 and add tests
This commit is contained in:
Will Thames 2018-08-24 11:04:18 +10:00 committed by Sloane Hertel
commit 60e3af42d5
13 changed files with 676 additions and 154 deletions

View file

@ -552,6 +552,9 @@ def _hashable_policy(policy, policy_list):
tupleified = tuple(tupleified)
policy_list.append(tupleified)
elif isinstance(policy, string_types) or isinstance(policy, binary_type):
# convert root account ARNs to just account IDs
if policy.startswith('arn:aws:iam::') and policy.endswith(':root'):
policy = policy.split(':')[4]
return [(to_text(policy))]
elif isinstance(policy, dict):
sorted_keys = list(policy.keys())