Skip to content

Commit

Permalink
refactor: remove writting password to file, add gcloud command to get…
Browse files Browse the repository at this point in the history
… secret value
  • Loading branch information
denise89p committed Aug 17, 2022
1 parent ab398e6 commit e9fe208
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
11 changes: 0 additions & 11 deletions modules/deploy_weka/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,3 @@ resource "google_compute_instance_group" "instance_group" {
ignore_changes = [network]
}
}


# ======================== install-weka ============================
resource "null_resource" "write_weka_password_to_local_file" {
provisioner "local-exec" {
command = <<-EOT
echo "${random_password.password.result}" > weka_cluster_admin_password
EOT
interpreter = ["bash", "-ce"]
}
}
5 changes: 5 additions & 0 deletions modules/deploy_weka/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,10 @@ curl -m 70 -X POST ${google_cloudfunctions_function.terminate_cluster_function.h
-H "Authorization:bearer $(gcloud auth print-identity-token)" \
-H "Content-Type:application/json" \
-d '{"name":"CLUSTER_NAME"}'
################################# get weka password secret login ############################################
gcloud secrets versions access 1 --secret=${google_secret_manager_secret.secret_weka_password.secret_id} --format='get(payload.data)' | base64 -d
EOT
}

0 comments on commit e9fe208

Please sign in to comment.