Skip to content

Commit fc79676

Browse files
feat: add example
1 parent e051835 commit fc79676

File tree

5 files changed

+93
-0
lines changed

5 files changed

+93
-0
lines changed

examples/main/README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
## Main example for Fingerprint Fastly VCL Proxy Integration
2+
3+
This project is an example of how to create a Fastly VCL service for the [Fingerprint Fastly VCL proxy integration Terraform module](https://github.com/fingerprintjs/terraform-fastly-fingerprint-vcl-proxy-integration).
4+
Learn more in the [Fastly VCL Proxy Terraform installation guide](https://dev.fingerprint.com/docs/deploy-fastly-vcl-using-terraform).
5+
6+
### Running the example
7+
8+
To quickly run the example for testing purposes, you can:
9+
10+
1. Copy the [terraform.tfvars.example](./terraform.tfvars.example) file into a new `terraform.tfvars` file and replace the values with your own. The variables are defined and described in the [variables.tf](./variables.tf) file.
11+
2. Copy your Fastly API token
12+
4. Run `terraform init`.
13+
5. Run `terraform apply -target=module.fingerprint_fastly_vcl_integration.module.compute_asset`
14+
7. Run `terraform plan`.
15+
8. Run `terraform apply`.
16+
17+
### Using in production
18+
19+
This is a simplified example. Use it as a reference but make sure to **adjust the code to your needs and security practices** before deploying it to production environments.
20+
21+
### Additional resources
22+
23+
- [Fingerprint Fastly VCL Proxy Integration documentation](https://dev.fingerprint.com/docs/fastly-vcl-proxy-integration)

examples/main/fingerprint.tf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
module "fingerprint_fastly_vcl_integration" {
2+
source = "../.."
3+
agent_script_download_path = var.agent_script_download_path
4+
get_result_path = var.get_result_path
5+
integration_domain = var.integration_domain
6+
integration_path = var.integration_path
7+
main_host = var.main_host
8+
proxy_secret = var.proxy_secret
9+
fastly_api_token = var.fastly_api_token
10+
}

examples/main/providers.tf

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
terraform {
2+
required_version = ">= 1.5"
3+
required_providers {
4+
fastly = {
5+
source = "fastly/fastly"
6+
version = ">= 7.1.0"
7+
}
8+
github = {
9+
source = "integrations/github"
10+
version = "6.2.2"
11+
}
12+
}
13+
}
14+
15+
provider "fastly" {
16+
api_key = var.fastly_api_token
17+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
agent_script_download_path = "463N7"
2+
get_result_path = "r35U17"
3+
integration_path = "zyk12Xc"
4+
proxy_secret = "YOUR_PROXY_SECRET_KEY_CREATED_IN_FINGERPRINT_DASHBOARD"
5+
fastly_api_token = "YOUR_API_TOKEN_CREATED_IN_FASTLY_DASHBOARD"
6+
integration_domain = "metrics.yourwebsite.com"
7+
main_host = "origin.yourwebsite.com"

examples/main/variables.tf

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
variable "agent_script_download_path" {
2+
description = "The Fingerprint agent download will be proxied through this path"
3+
type = string
4+
default = "agent"
5+
}
6+
7+
variable "get_result_path" {
8+
description = "The Fingerprint agent download will be proxied through this path"
9+
type = string
10+
default = "result"
11+
}
12+
13+
variable "integration_path" {
14+
description = "The Fingerprint integration will be proxied through this path prefix"
15+
type = string
16+
default = "integration"
17+
}
18+
19+
variable "integration_domain" {
20+
description = "Domain used for your proxy integration"
21+
type = string
22+
}
23+
24+
variable "main_host" {
25+
description = "Your origin server domain"
26+
type = string
27+
}
28+
29+
variable "proxy_secret" {
30+
description = "Your Fingerprint proxy secret"
31+
type = string
32+
}
33+
34+
variable "fastly_api_token" {
35+
type = string
36+
}

0 commit comments

Comments
 (0)