GCP service account

I have service account which exists in project A and wanted to add to another project B with some roles. is it possible to do it? I tried via GCP IAM on project B - Add member and assigned roles. but is that possible to do via terraform ??