Use this data source to retrieve default service account for this project
data "google_compute_default_service_account" "default" { } output "default_account" { value = "${data.google_compute_default_service_account.default.email}" }
The following arguments are supported:
project
- (Optional) The project ID. If it is not provided, the provider project is used. The following attributes are exported:
email
- Email address of the default service account used by VMs running in this project
© 2018 HashiCorpLicensed under the MPL 2.0 License.
https://www.terraform.io/docs/providers/google/d/google_compute_default_service_account.html