Skip to content

fingerprintjs/terraform-fastly-vcl-fingerprint-proxy-integration

Repository files navigation

Fingerprint logo

Current version Current version MIT license Discord server

Fingerprint Fastly VCL Integration (Terraform module)

Fingerprint is a device intelligence platform offering industry-leading accuracy.

Fingerprint Fastly VCL Integration is responsible for

  • Proxying download requests of the latest Fingerprint JS Agent between your site and Fingerprint CDN.
  • Proxying identification requests and responses between your site and Fingerprint's APIs.

This improves both accuracy and reliability of visitor identification and bot detection on your site.

You can install the Fastly VCL proxy integration manually or as a Terraform module included in this repository. For more details, see the full documentation.

Requirements

Important

The Fastly VCL Proxy Integration is exclusively supported for customers on the Enterprise Plan. Other customers are encouraged to use Custom subdomain setup or Cloudflare Proxy Integration.

Warning

The underlying data contract in the identification logic can change to keep up with browser updates. Using the Fastly VCL Proxy Integration might require occasional manual updates on your side. Ignoring these updates will lead to lower accuracy or service disruption.

1. Install the Terraform module

  1. Add the module to your Terraform file (for example, main.tf).
  2. Configure it with your Fastly API token, Fingerprint proxy secret, integration domain, and other required values.
terraform {
  required_version = ">=1.5"
}

module "fingerprint_fastly_vcl_integration" {
  source                     = "github.com/fingerprintjs/temp-fastly-vcl-terraform"
  fastly_api_token           = "FASTLY_API_TOKEN"
  proxy_secret               = "FINGERPRINT_PROXY_SECRET"
  integration_path           = "INTEGRATION_PATH"
  agent_script_download_path = "AGENT_SCRIPT_DOWNLOAD_PATH"
  get_result_path            = "GET_RESULT_PATH"
  integration_domain         = "metrics.yourwebsite.com"
  main_host                  = "yourwebsite.com"
}

You can see the full list of the Terraform module's variables below:

Variable Description Required Example
fastly_api_token Your Fastly API token Required "ABC123...xyz"
proxy_secret Your Fingerprint proxy secret Required "9h7jk2s1"
integration_path Path prefix for proxy requests Required "kyfy7t0a"
agent_script_download_path Path for serving the JavaScript agent Required "cc7bu2o8"
get_result_path Path for identification requests Required "sy5k3279"
integration_domain Domain used for the proxy integration Required "metrics.yourwebsite.com"
main_host Your origin server domain Required "yourwebsite.com"
dictionary_name Name of the Fastly Dictionary for config values Optional "fingerprint_config"
integration_name Name of the Fastly CDN service Optional "fingerprint-fastly-vcl-proxy-integration"
download_asset Whether to auto-download the latest VCL release Optional true
vcl_asset_name Custom VCL asset file if not downloading the official one Optional "fingerprint-pro-fastly-vcl-integration.vcl"
asset_version GitHub release version used for the VCL asset Optional "latest"

2. Deploy your Terraform changes

  1. Initialize the Terraform module:

    terraform init
  2. Apply the VCL asset:

    terraform apply -target=module.fingerprint_fastly_vcl_integration.module.vcl_asset
  3. Apply the changes to your Fastly service:

    terraform apply

Using a custom VCL asset (optional)

You can use your own VCL asset instead of downloading the official one:

  1. Place your custom asset in <your_module_root>/assets/custom-asset.vcl

  2. In your main.tf file, add these 2 variables to the module configuration:

    module "fingerprint_fastly_vcl_integration" {
      # ...
    + download_asset = false
    + vcl_asset_name = "custom-asset.vcl"
    }
  3. Run terraform init.

  4. Run terraform apply.

Examples

This repository also includes an example Terraform project. Use this example only as a reference, and make sure to follow best practices when provisioning Fastly services:

How to update

The Terraform module does include any mechanism for automatic updates. To keep your integration up to date, please run terraform apply regularly.

More resources

License

This project is licensed under the MIT license. See the LICENSE file for more info.