Skip to content

Commit

Permalink
add gcp service account email as gh repo secret
Browse files Browse the repository at this point in the history
  • Loading branch information
epiccoolguy committed Feb 9, 2024
1 parent 3fbaa30 commit 82fc18a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -108,5 +108,6 @@ module "gh_secrets" {
gcp_billing_account_id = var.gcp_billing_account_id
gcp_project_id = module.project.project_id
gcp_tfstate_bucket_name = module.bucket.names["${var.gcp_tfstate_bucket_name}"]
gcp_service_account_email = module.project.service_account_email
gcp_workload_identity_provider = module.workload_identity.provider.name
}
6 changes: 6 additions & 0 deletions modules/gh/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ resource "github_actions_secret" "gcp_tfstate_bucket_name" {
repository = var.gh_repository
}

resource "github_actions_secret" "gcp_service_account_email" {
secret_name = "GCP_SERVICE_ACCOUNT_EMAIL"
plaintext_value = var.gcp_service_account_email
repository = var.gh_repository
}

resource "github_actions_secret" "gcp_workload_identity_provider" {
secret_name = "GCP_WORKLOAD_IDENTITY_PROVIDER"
plaintext_value = var.gcp_workload_identity_provider
Expand Down
4 changes: 4 additions & 0 deletions modules/gh/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ variable "gcp_tfstate_bucket_name" {
type = string
}

variable "gcp_service_account_email" {
type = string
}

variable "gcp_workload_identity_provider" {
type = string
}

0 comments on commit 82fc18a

Please sign in to comment.