Can we publish SNS PushNotification to crossaccount endpoints?

0

We have Mobile PlatformApplication arns in AWS account-1, and we can publish PNs to endpoint arns with our java-service in the same account. But when trying to publish PNs with our java-service in different AWS accounts, we get com.amazonaws.services.sns.model.AuthorizationErrorException.

For Example: My PlatformApplication arn => arn:aws:sns:<region>:<account-id>:app/GCM/my-mobile-app-name

Once user register his device against this PlatfromApplication arn, a device endpoint will be created as => arn:aws:sns:<region>:<account-id>:endpoint/GCM/my-mobile-app-name/<uuid>

So, while publishing message to above endpoint arn from different AWS account resulting in AuthorizationErrorException

There seems no option to provide a resource-based policy for these SNS PlatformApplications (SNS PlatformApplications are not regular SNS topics). How can we solve this?

Thanks in Advance!

1 個回答
0

Hello,

You need to create an IAM role in the source account to allow publish message to the SNS topic in the target account. In the target account, create a SNS resource based policy to allow access to the IAM role which was created in the source account. Please refer the below doc if it helps.

https://aws.amazon.com/premiumsupport/knowledge-center/sns-cross-account-ec2-instance-iam-role/

profile pictureAWS
已回答 1 年前
  • These are SNS Mobile PlatformApplication arn, and these doesn't has a resource-based policy as far as I can see in AWS Console! I updated my question with more details.

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南