Commit 5918acbe authored by Adam Robinson's avatar Adam Robinson
Browse files

call cloud function to write to customer db

parent be8a92a2
......@@ -101,9 +101,23 @@ resource "google_storage_bucket_iam_policy" "customer_bucket_policy" {
policy_data = data.google_iam_policy.customer_bucket_policy.policy_data
}
// Need to make a customer Git repo
data "google_service_account_id_token" "customer_db_token" {
target_audience = "https://us-central1-gcp-at-um-db.cloudfunctions.net/customer_db"
}
resource "null_resource" "customer_database" {
triggers = {
billing_contact = var.billing_contact
mcomm_group_email = var.mcomm_group_email
shortcode = var.shortcode
}
// Need to write to a customer database
provisioner "local-exec" {
command = "curl https://us-central1-gcp-at-um-db.cloudfunctions.net/customer_db -H \"Authorization: Bearer ${data.google_service_account_id_token.customer_db_token.id_token}\" -H \"Content-Type: application/json\" -d '{\"kind\": \"billing\", \"billingAccountId\": \"asdf\"}'"
}
}
// Need to make a customer Git repo
# resource "google_billing_subaccount" "customer_subaccount" {
# display_name = "${local.short_mcomm}"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment