This module sets IAM policy to support exporting data from Worklytics to a pre-existing GCS bucket and provisions instructions for doing so.
It is published in the Terraform Registry.
It is arguably too minimal to be its own module, but we did so to make it analogous to AWS case and provide for potential future provisioning of the connection from the Worklytics side.
from Terraform registry:
resource "google_storage_bucket" "worklytics_export" {
name = "worklytics-export"
# customize as needed; see https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/storage_bucket#argument-reference
}
module "worklytics-export" {
source = "terraform-gcp-worklytics-export"
version = "~> 0.2.0"
# email address of your Worklytics Tenant's Service Account (obtain from Worklytics)
worklytics_tenant_sa_email = "YOUR_SA_EMAIL@YOUR_PROJECT_ID.iam.gserviceaccount.com"
bucket_name = google_storage_bucket.worklytics_export.name
}
via GitHub:
module "worklytics-export" {
source = "git::https://github.com/worklytics/terraform-gcp-worklytics-export/?ref=v0.1.0"
# email address of your Worklytics Tenant's Service Account (obtain from Worklytics)
worklytics_tenant_sa_email = "YOUR_SA_EMAIL@YOUR_PROJECT_ID.iam.gserviceaccount.com"
bucket_name = google_storage_bucket.worklytics_export.name
}
If todo_as_outputs
is set to true, this will be a markdown-formatted string of TODOs for you to
complete outside of Terraform.
This module is meant for use with Terraform 1.1+. If you find incompatibilities using Terraform >= 1.1, please open an issue.
As of August 2024, we run integration tests on the latest Terraform versions 1.6-1.9 (everything released within the past year).
If you wish to export Worklytics data to an existing bucket, use a Terraform import as follows:
terraform import module.worklytics_export.google_storage_bucket.worklytics_export <bucket_name>
This module is written and maintained by Worklytics, Co. and intended to guide our customers in setting up their own infra to export data from Worklytics to AWS.
As this is published as a Terraform module, we will strive to follow standard Terraform module structure and style conventions.
See examples/basic/ for a simple example of how to use this module.
Developing:
- branch from
main
; open a PR tomain
when ready for review. - releases will be periodically cut from
main
by tagging with semantic version (v{MAJOR}.{MINOR}.{PATCH}), push to origin (GitHub), and create a release (hopefully automatic via GitHub Actions; via GitHub UI if not). - releases should be automatically picked up by Terraform Registry (some lag here)
If you don't wish to use Terraform to prepare your infrastructure for receiving exports from Worklytics, you can do the following.
- Create a GCS bucket or choose a preexisting one that you wish to export to. (GCP Console or CLI)
- Grant the
roles/storage.objectAdmin
IAM role to your Worklytics Tenant's Service Account (obtain from Worklytics) on the bucket. - Create an Export connection via the Worklytics web app.