Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stablize default service account in plan #153

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions modules/core_project_factory/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -135,26 +135,26 @@ resource "google_compute_shared_vpc_service_project" "shared_vpc_attachment" {
/******************************************
Default compute service account retrieval
*****************************************/
data "google_compute_default_service_account" "default" {
project = "${google_project.main.id}"

depends_on = ["google_project_service.project_services"]
data "null_data_source" "default_service_account" {
inputs = {
email = "${google_project.main.number}[email protected]"
}
}

/******************************************
Default compute service account deletion
*****************************************/
resource "null_resource" "delete_default_compute_service_account" {
provisioner "local-exec" {
command = "${path.module}/scripts/delete-service-account.sh ${local.project_id} ${var.credentials_path} ${data.google_compute_default_service_account.default.id}"
command = "${path.module}/scripts/delete-service-account.sh ${local.project_id} ${var.credentials_path} ${data.null_data_source.default_service_account.outputs["email"]}"
}

triggers {
default_service_account = "${data.google_compute_default_service_account.default.id}"
default_service_account = "${data.null_data_source.default_service_account.outputs["email"]}"
activated_apis = "${join(",", var.activate_apis)}"
}

depends_on = ["google_project_service.project_services", "data.google_compute_default_service_account.default"]
depends_on = ["google_project_service.project_services"]
}

/******************************************
Expand Down