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
답변함 2년 전
  • 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.

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠