This is a template repo for a Terraform configuration that deploys the Worklytics pseudonymization proxy (psoxy) on GCP.
You'll need:
- a Bash-like shell environment on Linux, MacOS, or WSL on Windows.
gitinstalled, although it is usually included on those platforms (check withgit --version).- an GCP project account and credentials, as described in Psoxy's Getting Started - GCP docs
- the prerequisites for Psoxy itself, although this example will attempt to help you check those
See GitHub's documentation for more details.
- Click the 'Use this template' button in the upper right corner of this page.
- choose a name for your copy of this repo
- leave "Include all branches" unchecked
Clone the resulting repo to your machine. Example command below, just fill in your org and repo names.
git clone https://github.com/{{YOUR_ORG_ID}}/{{YOUR_REPO_NAME}}.git-
Alternatively use template outside GitHub (if you cannot 'Use this template', perhaps because your organization doesn't use GitHub or you need to use a different git host, you can manually create a copy:
- Clone this repository to your local machine:
git clone https://github.com/Worklytics/psoxy-example-gcp.git cd psoxy-example-gcp - Remove the existing git history to start fresh:
rm -rf .git
- Initialize a new git repository:
git init git add . git commit -m "Initial commit from psoxy-example-gcp template"
- Create a new repository on your preferred git hosting service (GitLab, Bitbucket, etc.)
- Add your new repository as the remote origin:
git remote add origin https://your-git-host.com/your-org/your-repo-name.git git branch -M main git push -u origin main
- Clone this repository to your local machine:
-
Alternatively, use this in a monorepo (eg, you maintain have a monorepo with lots of terraform configurations, and you want to add this to those)
- Clone this repository to your local machine and copy its contents (excluding hidden stuff like
.gitfiles into your monorepo)git clone https://github.com/Worklytics/psoxy-example-gcp.git rm -rf psoxy-example-gcp/.git cp -r psoxy-example-gcp ${PATH_TO_MONO_REPO}/
- Clone this repository to your local machine and copy its contents (excluding hidden stuff like
- Check your prereqs. Review versions and install anything needed.
./check-prereqs- Authenticate your tools as needed:
- auth GCloud CLI -
gcloud auth loginto authenticate, thengcloud auth listto verify you have the expected account/user - auth Azure CLI if using Microsoft 365 data sources -
az login --allow-no-subscriptionto authenticate, thenaz account listto verify you have the expected account/user
- Initialize your configuration using our helper script. Follow the prompts.
./init-
Review your
terraform.tfvarsfile andmain.tf; customize as needed (eg, comment out datasources you don't need).In particular, if you're NOT using Google Workspace as a data source, remove (delete) the
.tffiles namedgoogle-*.tfAND references to values from those files from themain.tffile. (Our./initscript should have removed these for you)Similiarly, if you're NOT using Microsoft 365 as a data source, remove (delete) the
.tffiles namedmsft-365-*.tfAND references to values from those files from themain.tffile. (Our./initscript should have removed these for you) -
Run
terraform planand review results to understand what will be created. Customize yourterraform.tfvarsormain.tffile if needed. (or push to your CI/CD system, if not running locally)
terraform plan- Run
terraform applyto create the resources. (or push to your CI/CD system to do this automatically)
terraform apply- The above steps have created or modified various files that you should commit a code repository or otherwise preserve. In particular
terraform.tfvars,main.tf,terraform.tfstate(if you ranterraformlocally) and.terraform.lock.hclshould be preserved. Please dogit addfor each and thengit committo save your changes.
The source code contained in this repo is licensed under the Apache License, Version 2.0.
Usage of terraform, psoxy, or other tooling invoked by scripts in this repo or described in the example tutorials it contains are each subject to their own license terms.
This example repo is maintained by Worklytics. Paid support is available. Please contact [email protected].