Skip to content

fullstorydev/terraform-google-fullstory-bigquery-setup

Repository files navigation

terraform-google-fullstory-bigquery-setup

GitHub release

This module creates all the proper permissions and service accounts so that Fullstory can connect to the dataset and load data. For more information checkout this KB article.

Requirements

Name Version
terraform >= 0.13
google >= 5.0.0

Inputs

Name Description Type Default Required
dataset_id The dataset that Fullstory will use to sync data. string n/a yes
project The target GCP project that will be used for all resources. string n/a yes
service_account_name The name of the service account to use with Fullstory string "fullstory-bigquery-setup" no

Outputs

Name Description
service_account The Fullstory service account that Fullstory will use to load data.
service_account_private_key The private key that can be used in the Fullstory app when configuring the BigQuery integration.

Usage

resource "google_bigquery_dataset" "main" {
  dataset_id                  = "fullstory"
  friendly_name               = "Fullstory"
  description                 = "This the dataset for all Fullstory data to live in."
  location                    = "US"
  default_table_expiration_ms = 3600000

  labels = {
    env = "default"
  }

  access {
    role   = "READER"
    domain = "my-company.com"
  }
}

module "fullstory_bigquery_setup" {
  source     = "fullstorydev/fullstory-bigquery-setup/google"
  dataset_id = google_bigquery_dataset.main.dataset_id
  project    = "my-project-id"
}

# This block is important so that the value can be viewed with `terraform output`.
#
# The secret can be copied to your clipboard with:
# terraform output -raw fullstory_bigquery_setup_service_account_private_key | base64 -d | pbcopy
output "fullstory_bigquery_setup_service_account_private_key" {
  value     = module.fullstory_bigquery_setup.service_account_private_key
  sensitive = true
}

Obtaining the private key

This module outputs the private key that can be pasted into Fullstory in order for Fullstory to connect to your database. After using this module, you must output the value of the private in your root module (see above example). Once that is done, you should be able to access the private key value using the following command:

terraform output -raw <name of your output varible > | base64 -d | pbcopy

Alternatively, you can generate a key from the service account section of the IAM console in GCP.

Contributing

See CONTRIBUTING.md for best practices and instructions on setting up your dev environment.