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

Removes token usage to native impersonation #656

Merged
Show file tree
Hide file tree
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
21 changes: 2 additions & 19 deletions 1-org/envs/shared/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,30 +18,13 @@ locals {
tf_sa = var.terraform_service_account
}

provider "google" {
alias = "impersonate"

scopes = [
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/userinfo.email",
]
}

data "google_service_account_access_token" "default" {
provider = google.impersonate
target_service_account = local.tf_sa
scopes = ["userinfo-email", "cloud-platform"]
lifetime = "600s"
}

/******************************************
Provider credential configuration
*****************************************/
provider "google" {
access_token = data.google_service_account_access_token.default.access_token
impersonate_service_account = local.tf_sa
}

provider "google-beta" {
access_token = data.google_service_account_access_token.default.access_token
impersonate_service_account = local.tf_sa
}

21 changes: 2 additions & 19 deletions 2-environments/envs/development/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,30 +18,13 @@ locals {
tf_sa = var.terraform_service_account
}

provider "google" {
alias = "impersonate"

scopes = [
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/userinfo.email",
]
}

data "google_service_account_access_token" "default" {
provider = google.impersonate
target_service_account = local.tf_sa
scopes = ["userinfo-email", "cloud-platform"]
lifetime = "600s"
}

/******************************************
Provider credential configuration
*****************************************/
provider "google" {
access_token = data.google_service_account_access_token.default.access_token
impersonate_service_account = local.tf_sa
}

provider "google-beta" {
access_token = data.google_service_account_access_token.default.access_token
impersonate_service_account = local.tf_sa
}

21 changes: 2 additions & 19 deletions 2-environments/envs/non-production/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,30 +18,13 @@ locals {
tf_sa = var.terraform_service_account
}

provider "google" {
alias = "impersonate"

scopes = [
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/userinfo.email",
]
}

data "google_service_account_access_token" "default" {
provider = google.impersonate
target_service_account = local.tf_sa
scopes = ["userinfo-email", "cloud-platform"]
lifetime = "600s"
}

/******************************************
Provider credential configuration
*****************************************/
provider "google" {
access_token = data.google_service_account_access_token.default.access_token
impersonate_service_account = local.tf_sa
}

provider "google-beta" {
access_token = data.google_service_account_access_token.default.access_token
impersonate_service_account = local.tf_sa
}

21 changes: 2 additions & 19 deletions 2-environments/envs/production/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,30 +18,13 @@ locals {
tf_sa = var.terraform_service_account
}

provider "google" {
alias = "impersonate"

scopes = [
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/userinfo.email",
]
}

data "google_service_account_access_token" "default" {
provider = google.impersonate
target_service_account = local.tf_sa
scopes = ["userinfo-email", "cloud-platform"]
lifetime = "600s"
}

/******************************************
Provider credential configuration
*****************************************/
provider "google" {
access_token = data.google_service_account_access_token.default.access_token
impersonate_service_account = local.tf_sa
}

provider "google-beta" {
access_token = data.google_service_account_access_token.default.access_token
impersonate_service_account = local.tf_sa
}

24 changes: 4 additions & 20 deletions 3-networks/envs/development/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,32 +18,16 @@ locals {
tf_sa = var.terraform_service_account
}

provider "google" {
alias = "impersonate"

scopes = [
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/userinfo.email",
]
}

data "google_service_account_access_token" "default" {
provider = google.impersonate
target_service_account = local.tf_sa
scopes = ["userinfo-email", "cloud-platform"]
lifetime = "1200s"
}

/******************************************
Provider credential configuration
*****************************************/
provider "google" {
access_token = data.google_service_account_access_token.default.access_token
request_timeout = "60s"
impersonate_service_account = local.tf_sa
request_timeout = "60s"
}

provider "google-beta" {
access_token = data.google_service_account_access_token.default.access_token
request_timeout = "60s"
impersonate_service_account = local.tf_sa
request_timeout = "60s"
}

24 changes: 4 additions & 20 deletions 3-networks/envs/non-production/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,32 +18,16 @@ locals {
tf_sa = var.terraform_service_account
}

provider "google" {
alias = "impersonate"

scopes = [
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/userinfo.email",
]
}

data "google_service_account_access_token" "default" {
provider = google.impersonate
target_service_account = local.tf_sa
scopes = ["userinfo-email", "cloud-platform"]
lifetime = "1200s"
}

/******************************************
Provider credential configuration
*****************************************/
provider "google" {
access_token = data.google_service_account_access_token.default.access_token
request_timeout = "60s"
impersonate_service_account = local.tf_sa
request_timeout = "60s"
}

provider "google-beta" {
access_token = data.google_service_account_access_token.default.access_token
request_timeout = "60s"
impersonate_service_account = local.tf_sa
request_timeout = "60s"
}

24 changes: 4 additions & 20 deletions 3-networks/envs/production/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,32 +18,16 @@ locals {
tf_sa = var.terraform_service_account
}

provider "google" {
alias = "impersonate"

scopes = [
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/userinfo.email",
]
}

data "google_service_account_access_token" "default" {
provider = google.impersonate
target_service_account = local.tf_sa
scopes = ["userinfo-email", "cloud-platform"]
lifetime = "1200s"
}

/******************************************
Provider credential configuration
*****************************************/
provider "google" {
access_token = data.google_service_account_access_token.default.access_token
request_timeout = "60s"
impersonate_service_account = local.tf_sa
request_timeout = "60s"
}

provider "google-beta" {
access_token = data.google_service_account_access_token.default.access_token
request_timeout = "60s"
impersonate_service_account = local.tf_sa
request_timeout = "60s"
}

24 changes: 4 additions & 20 deletions 3-networks/envs/shared/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,32 +18,16 @@ locals {
tf_sa = var.terraform_service_account
}

provider "google" {
alias = "impersonate"

scopes = [
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/userinfo.email",
]
}

data "google_service_account_access_token" "default" {
provider = google.impersonate
target_service_account = local.tf_sa
scopes = ["userinfo-email", "cloud-platform"]
lifetime = "1200s"
}

/******************************************
Provider credential configuration
*****************************************/
provider "google" {
access_token = data.google_service_account_access_token.default.access_token
request_timeout = "60s"
impersonate_service_account = local.tf_sa
request_timeout = "60s"
}

provider "google-beta" {
access_token = data.google_service_account_access_token.default.access_token
request_timeout = "60s"
impersonate_service_account = local.tf_sa
request_timeout = "60s"
}

19 changes: 2 additions & 17 deletions 4-projects/business_unit_1/development/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,29 +18,14 @@ locals {
tf_sa = var.terraform_service_account
}

provider "google" {
alias = "impersonate"

scopes = [
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/userinfo.email",
]
}

data "google_service_account_access_token" "default" {
provider = google.impersonate
target_service_account = local.tf_sa
scopes = ["userinfo-email", "cloud-platform"]
lifetime = "1200s"
}

/******************************************
Provider credential configuration
*****************************************/
provider "google" {
access_token = data.google_service_account_access_token.default.access_token
impersonate_service_account = local.tf_sa
}

provider "google-beta" {
access_token = data.google_service_account_access_token.default.access_token
impersonate_service_account = local.tf_sa
}
20 changes: 2 additions & 18 deletions 4-projects/business_unit_1/non-production/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,29 +18,13 @@ locals {
tf_sa = var.terraform_service_account
}

provider "google" {
alias = "impersonate"

scopes = [
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/userinfo.email",
]
}

data "google_service_account_access_token" "default" {
provider = google.impersonate
target_service_account = local.tf_sa
scopes = ["userinfo-email", "cloud-platform"]
lifetime = "1200s"
}

/******************************************
Provider credential configuration
*****************************************/
provider "google" {
access_token = data.google_service_account_access_token.default.access_token
impersonate_service_account = local.tf_sa
}

provider "google-beta" {
access_token = data.google_service_account_access_token.default.access_token
impersonate_service_account = local.tf_sa
}
19 changes: 2 additions & 17 deletions 4-projects/business_unit_1/production/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,29 +18,14 @@ locals {
tf_sa = var.terraform_service_account
}

provider "google" {
alias = "impersonate"

scopes = [
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/userinfo.email",
]
}

data "google_service_account_access_token" "default" {
provider = google.impersonate
target_service_account = local.tf_sa
scopes = ["userinfo-email", "cloud-platform"]
lifetime = "1200s"
}

/******************************************
Provider credential configuration
*****************************************/
provider "google" {
access_token = data.google_service_account_access_token.default.access_token
impersonate_service_account = local.tf_sa
}

provider "google-beta" {
access_token = data.google_service_account_access_token.default.access_token
impersonate_service_account = local.tf_sa
}
Loading