Terraform cross account - retrieve SNS topic id from target account to source account

I am trying to achieve a multi-account architecture provisioning through terraform.
Account - A (user John)
Account - B (having a role name admin which has the policy to SNS service)

Cross account has been setup and John is able to switch to Account-B through crossaccount role.

Terraform Provider

provider “aws” {

region = “us-east-2”

profile = “John”

assume_role {

role_arn  = "arn:aws:iam::<Account-B-id>:role/cross-account-role"

session_name = "Terraform"



now I need to create a SNS topic in the Account-B and need the topic ARN to update a resource in Account-A(user: John).

Could you please suggest a terraformic :wink: way to create the resource in target account and get the value of that resource to perform further action in source account.