Skip to content

Commit

Permalink
Updating the way Forseti Server Configuration is retrieved from GCS
Browse files Browse the repository at this point in the history
Moved away from `google_storage_object_signed_url` as it requires
a local json keyfile and I am deploying using service account
impersonation.

hashicorp/terraform-provider-google#3558
  • Loading branch information
hiloboy0119 committed Feb 1, 2020
1 parent 9303f2a commit 7744d2b
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions modules/on_gke/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -124,20 +124,20 @@ data "tls_public_key" "git_sync_public_ssh_key" {
// Obtain Forseti Server Configuration
//*****************************************

data "google_storage_object_signed_url" "file_url" {
bucket = module.server_gcs.forseti-server-storage-bucket
path = "configs/forseti_conf_server.yaml"
content_md5 = module.server_config.forseti-server-config-md5
data "google_storage_bucket_object" "server_config_contents" {
bucket = module.server_gcs.forseti-server-storage-bucket
name = "configs/forseti_conf_server.yaml"
}

data "google_client_config" "current" {}

data "http" "server_config_contents" {
url = data.google_storage_object_signed_url.file_url.signed_url
url = format("%s?alt=media", data.google_storage_bucket_object.server_config_contents.self_link)

# Optional request headers
request_headers = {
"Content-MD5" = module.server_config.forseti-server-config-md5
"Authorization" = "Bearer ${data.google_client_config.current.access_token}"
}

depends_on = ["data.google_storage_object_signed_url.file_url"]
}

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

0 comments on commit 7744d2b

Please sign in to comment.