From 32c046cb556df8a51266336da3c71ca633888b31 Mon Sep 17 00:00:00 2001
From: Juraj Uhlar
Date: Mon, 5 Aug 2024 14:45:01 +0100
Subject: [PATCH 1/6] docs: update readme
---
README.md | 198 ++++++++++++++----------------------------------------
1 file changed, 52 insertions(+), 146 deletions(-)
diff --git a/README.md b/README.md
index b3d50bc..de61c6a 100644
--- a/README.md
+++ b/README.md
@@ -2,7 +2,7 @@
-
+
@@ -14,148 +14,54 @@
-> **Warning**
-> This project is in the Private Beta phase. For more information, reach out
-> to [support@fingerprint.com](mailto:support@fingerprint.com).
-
-## How to Install
-
-### Using a new CloudFront distribution
-
-1. Create a new directory `mkdir fingerprint_integration` and go inside `cd fingerprint_integration`
-2. Create a file `touch fingerprint.tf` and add below content, do not forget to replace
- placeholders (`AGENT_DOWNLOAD_PATH_HERE`, `RESULT_PATH_HERE`, `PROXY_SECRET_HERE`):
- ```terraform
- module "fingerprint_cloudfront_integration" {
- source = "git@github.com:necipallef/terraform-module-proxy-lambda.git/?ref=v0.7.1"
-
- fpjs_agent_download_path = "AGENT_DOWNLOAD_PATH_HERE"
- fpjs_get_result_path = "RESULT_PATH_HERE"
- fpjs_shared_secret = "PROXY_SECRET_HERE"
- }
- ```
-3. Create a file called `cloudfront_distribution.tf` and add below content (feel free to make any changes that makes
- sense for your setup):
- ```terraform
-
- resource "aws_cloudfront_distribution" "fpjs_cloudfront_distribution" {
- comment = "Fingerprint distribution (created via Terraform)"
-
- origin {
- domain_name = module.fingerprint_cloudfront_integration.fpjs_origin_name
- origin_id = module.fingerprint_cloudfront_integration.fpjs_origin_id
- custom_origin_config {
- origin_protocol_policy = "https-only"
- http_port = 80
- https_port = 443
- origin_ssl_protocols = ["TLSv1.2"]
- }
- custom_header {
- name = "FPJS_SECRET_NAME"
- value = module.fingerprint_cloudfront_integration.fpjs_secret_manager_arn
- }
- }
-
- enabled = true
-
- http_version = "http1.1"
-
- price_class = "PriceClass_100"
-
- default_cache_behavior {
- allowed_methods = ["GET", "HEAD", "OPTIONS", "PUT", "POST", "PATCH", "DELETE"]
- cached_methods = ["GET", "HEAD"]
- cache_policy_id = module.fingerprint_cloudfront_integration.fpjs_cache_policy_id
- origin_request_policy_id = module.fingerprint_cloudfront_integration.fpjs_origin_request_policy_id
- target_origin_id = module.fingerprint_cloudfront_integration.fpjs_origin_id
- viewer_protocol_policy = "https-only"
- compress = true
-
- lambda_function_association {
- event_type = "origin-request"
- lambda_arn = module.fingerprint_cloudfront_integration.fpjs_proxy_lambda_arn
- include_body = true
- }
- }
-
- viewer_certificate {
- cloudfront_default_certificate = true
- }
-
- restrictions {
- geo_restriction {
- restriction_type = "none"
- }
- }
- }
- ```
- If you wish to connect a custom domain for first-party benefits, consider changing `viewer_certificate` field
- accordingly. Refer
- to [official documentation](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudfront_distribution)
- by HashiCorp for further customization.
-4. Run `terraform init`
-5. Run `terraform plan`, if all looks good run `terraform apply`
-
-### Using existing CloudFront distribution
-
-1. Create a file called `fingerprint.tf` and add below content, do not forget to replace
- placeholders (`AGENT_DOWNLOAD_PATH_HERE`, `RESULT_PATH_HERE`, `PROXY_SECRET_HERE`):
- ```terraform
- module "fingerprint_cloudfront_integration" {
- source = "git@github.com:necipallef/terraform-module-proxy-lambda.git/?ref=v0.7.1"
-
- fpjs_agent_download_path = "AGENT_DOWNLOAD_PATH_HERE"
- fpjs_get_result_path = "RESULT_PATH_HERE"
- fpjs_shared_secret = "PROXY_SECRET_HERE"
- }
- ```
-2. Go to your CloudFront distribution block and add below content, do not forget to replace
- placeholders (`YOUR_INTEGRATION_PATH_HERE`):
- ```terraform
- resource "aws_cloudfront_distribution" "cloudfront_dist" {
- // more code here
-
- #region fingerprint start
-
- origin {
- domain_name = module.fingerprint_cloudfront_integration.fpjs_origin_name
- origin_id = module.fingerprint_cloudfront_integration.fpjs_origin_id
- custom_origin_config {
- origin_protocol_policy = "https-only"
- http_port = 80
- https_port = 443
- origin_ssl_protocols = ["TLSv1.2"]
- }
- custom_header {
- name = "FPJS_SECRET_NAME"
- value = module.fingerprint_cloudfront_integration.fpjs_secret_manager_arn
- }
- }
-
- ordered_cache_behavior {
- path_pattern = "YOUR_INTEGRATION_PATH_HERE/*"
-
- allowed_methods = ["GET", "HEAD", "OPTIONS", "PUT", "POST", "PATCH", "DELETE"]
- cached_methods = ["GET", "HEAD"]
- cache_policy_id = module.fingerprint_cloudfront_integration.fpjs_cache_policy_id
- origin_request_policy_id = module.fingerprint_cloudfront_integration.fpjs_origin_request_policy_id
- target_origin_id = module.fingerprint_cloudfront_integration.fpjs_origin_id
- viewer_protocol_policy = "https-only"
- compress = true
-
- lambda_function_association {
- event_type = "origin-request"
- lambda_arn = module.fingerprint_cloudfront_integration.fpjs_proxy_lambda_arn
- include_body = true
- }
- }
-
- #endregion
-
- // more code here
- }
- ```
-3. Run `terraform plan`, if all looks good run `terraform apply`
-
-> [!NOTE]
-> If your project doesn't use `hashicorp/random` module, then you will need to run `terraform init -upgrade`.
+# Fingerprint Pro CloudFront Integration (Terraform module)
+
+[Fingerprint](https://fingerprint.com/) is a device intelligence platform offering 99.5% accurate visitor identification.
+
+Fingerprint Pro CloudFront Integration is responsible for
+
+- Proxying download requests of the latest Fingerprint Pro JS Agent between your site and Fingerprint CDN.
+- Proxying identification requests and responses between your site and Fingerprint Pro's APIs.
+
+This [improves](https://dev.fingerprint.com/docs/cloudfront-proxy-integration#the-benefits-of-using-the-cloudfront-integration) both accuracy and reliability of visitor identification and bot detection on your site.
+
+You can install the CloudFront proxy integration using a [CloudFormation template](https://github.com/fingerprintjs/fingerprint-pro-cloudfront-integration) or as a Terraform module included in this repository. For more details, see the [full documentation](https://dev.fingerprint.com/docs/cloudfront-proxy-integration-v2).
+
+## Requirements
+
+- AWS Account.
+- Access to an IAM role in AWS with privileges to manage IAM roles, CloudFront distributions, Secrets Manager, Lambda Functions, and S3 Read Only access.
+- Terraform project using the [AWS provider](https://registry.terraform.io/providers/hashicorp/aws/latest/docs) with the IAM role described above.
+- [Terraform CLI](https://developer.hashicorp.com/terraform/tutorials/aws-get-started/install-cli).
+
+> [!IMPORTANT]
+> The AWS CloudFront Proxy Integration is exclusively supported for customers on the Enterprise Plan. Other customers are encouraged to use [Custom subdomain setup](https://dev.fingerprint.com/docs/custom-subdomain-setup) or [Cloudflare Proxy Integration](https://dev.fingerprint.com/docs/cloudflare-integration).
+
+> [!WARNING]
+> The underlying data contract in the identification logic can change to keep up with browser updates. Using the AWS CloudFront Proxy Integration might require occasional manual updates on your side. Ignoring these updates will lead to lower accuracy or service disruption.
+
+## How to install
+
+To set up CloudFront integration using Terraform, you need to:
+
+1. Add the Fingerprint Terraform module to your Terraform project.
+2. Use the module in the configuration of your CloudFront distribution.
+3. Deploy your Terraform project.
+4. Configure the Fingerprint Pro JS Agent on your site to communicate with your created Lambda@Edge function using the [scriptUrlPattern](https://dev.fingerprint.com/docs/js-agent#scripturlpattern) and [endpoint](https://dev.fingerprint.com/docs/js-agent#endpoint) parameters.
+
+See [CloudFront Proxy Integration guide](https://dev.fingerprint.com/docs/cloudfront-proxy-integration-v2) in our documentation for step-by-step instructions and follow the [Terraform installation method](https://dev.fingerprint.com/docs/aws-cloudfront-integration-via-terraform). If you have any questions, reach out to our [support team](https://fingerprint.com/support/).
+
+## Examples
+
+This repository also includes the following Terraform project examples:
+
+- Adding the Fingerprint proxy integration to an [existing CloudFront distribution](./examples//existing-ditribution/)
+- [Creating a new CloudFront distribution](./examples/standalone-distribution/) just for the Fingerprint proxy integration
+
+## 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.
+
+## License
+
+This project is licensed under the MIT license. See the [LICENSE](/LICENSE) file for more info.
From b5a0793ca08fb81d0e8c96d037557e162dbbac7a Mon Sep 17 00:00:00 2001
From: Juraj Uhlar
Date: Mon, 5 Aug 2024 14:45:14 +0100
Subject: [PATCH 2/6] docs: add standalone distribution example
---
.gitignore | 3 +
.../cloudfront_distribution.tf | 71 +++++++++++++++++++
.../standalone-distribution/fingerprint.tf | 9 +++
examples/standalone-distribution/providers.tf | 14 ++++
examples/standalone-distribution/variables.tf | 31 ++++++++
5 files changed, 128 insertions(+)
create mode 100644 examples/standalone-distribution/cloudfront_distribution.tf
create mode 100644 examples/standalone-distribution/fingerprint.tf
create mode 100644 examples/standalone-distribution/providers.tf
create mode 100644 examples/standalone-distribution/variables.tf
diff --git a/.gitignore b/.gitignore
index bec8a46..4b7b55f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -38,3 +38,6 @@ terraform.rc
# Ignore IDE
.idea/
+
+# Ignore Terraform locks in examples folder
+examples/**/*.lock.hcl
diff --git a/examples/standalone-distribution/cloudfront_distribution.tf b/examples/standalone-distribution/cloudfront_distribution.tf
new file mode 100644
index 0000000..9814e9f
--- /dev/null
+++ b/examples/standalone-distribution/cloudfront_distribution.tf
@@ -0,0 +1,71 @@
+resource "aws_cloudfront_distribution" "fpjs_cloudfront_distribution" {
+ comment = "Fingerprint proxy integration distribution (created via Terraform)"
+
+ origin {
+ domain_name = module.fingerprint_cloudfront_integration.fpjs_origin_name
+ origin_id = module.fingerprint_cloudfront_integration.fpjs_origin_id
+ custom_origin_config {
+ origin_protocol_policy = "https-only"
+ http_port = 80
+ https_port = 443
+ origin_ssl_protocols = ["TLSv1.2"]
+ }
+ custom_header {
+ name = "FPJS_SECRET_NAME"
+ value = module.fingerprint_cloudfront_integration.fpjs_secret_manager_arn
+ }
+ }
+
+ enabled = true
+
+ http_version = "http1.1"
+
+ price_class = "PriceClass_100"
+
+ default_cache_behavior {
+ allowed_methods = ["GET", "HEAD", "OPTIONS", "PUT", "POST", "PATCH", "DELETE"]
+ cached_methods = ["GET", "HEAD"]
+ cache_policy_id = module.fingerprint_cloudfront_integration.fpjs_cache_policy_id
+ origin_request_policy_id = module.fingerprint_cloudfront_integration.fpjs_origin_request_policy_id
+ target_origin_id = module.fingerprint_cloudfront_integration.fpjs_origin_id
+ viewer_protocol_policy = "https-only"
+ compress = true
+
+ lambda_function_association {
+ event_type = "origin-request"
+ lambda_arn = module.fingerprint_cloudfront_integration.fpjs_proxy_lambda_arn
+ include_body = true
+ }
+ }
+
+
+
+ restrictions {
+ geo_restriction {
+ restriction_type = "none"
+ }
+ }
+
+ aliases = ["${var.subdomain}.${var.root_domain}"]
+ viewer_certificate {
+ acm_certificate_arn = "arn:aws:acm:us-east-1:013357491684:certificate/c3ffee8c-071b-4ff8-bec2-e222eff602bc"
+ ssl_support_method = "sni-only"
+ }
+
+ # If don't want to serve the distribution from a subdomain for now, use the default certificate instead
+ # (comment out `viewer_certificate` and `aliases` above and use the `viewer_certificate` below)
+
+ # viewer_certificate {
+ # cloudfront_default_certificate = true
+ # }
+}
+
+# You can make the distribution avaialable on a subdomain of your website
+# (comment this out if you don't want to do that for now)
+resource "aws_route53_record" "cloudfront_terraform_new_distribution_record" {
+ zone_id = var.domain_zone_id
+ name = "${var.subdomain}.${var.root_domain}"
+ type = "CNAME"
+ ttl = 300
+ records = [aws_cloudfront_distribution.fpjs_cloudfront_distribution.domain_name]
+}
diff --git a/examples/standalone-distribution/fingerprint.tf b/examples/standalone-distribution/fingerprint.tf
new file mode 100644
index 0000000..6252001
--- /dev/null
+++ b/examples/standalone-distribution/fingerprint.tf
@@ -0,0 +1,9 @@
+module "fingerprint_cloudfront_integration" {
+ source = "git@github.com:fingerprintjs/terraform-aws-fingerprint-cloudfront-proxy-integration.git"
+
+ fpjs_agent_download_path = var.fpjs_agent_download_path
+ fpjs_get_result_path = var.fpjs_get_result_path
+ fpjs_shared_secret = var.fpjs_shared_secret
+}
+
+
diff --git a/examples/standalone-distribution/providers.tf b/examples/standalone-distribution/providers.tf
new file mode 100644
index 0000000..cc51288
--- /dev/null
+++ b/examples/standalone-distribution/providers.tf
@@ -0,0 +1,14 @@
+terraform {
+ required_providers {
+ aws = {
+ source = "hashicorp/aws"
+ version = "~> 5.57"
+ }
+ }
+
+ required_version = ">= 1.2.0"
+}
+
+provider "aws" {
+ region = "us-east-1"
+}
diff --git a/examples/standalone-distribution/variables.tf b/examples/standalone-distribution/variables.tf
new file mode 100644
index 0000000..0558efa
--- /dev/null
+++ b/examples/standalone-distribution/variables.tf
@@ -0,0 +1,31 @@
+variable "fpjs_shared_secret" {
+ description = "The proxy secret for the Fingerprint proxy integration"
+ type = string
+}
+
+variable "fpjs_agent_download_path" {
+ description = "The Fingerprint agent download will be proxied through this path"
+ type = string
+}
+
+variable "fpjs_get_result_path" {
+ description = "The Fingerprint identification request will be proxied through this path"
+ type = string
+}
+
+variable "subdomain" {
+ description = "The subdomain for the CloudFront distribution"
+ type = string
+ # default = "metrics"
+}
+
+variable "root_domain" {
+ description = "The root domain for the CloudFront distribution"
+ type = string
+ # default = "yourwebsite.com"
+}
+
+variable "domain_zone_id" {
+ description = "Zone ID of the domain for the CloudFront distribution"
+ type = string
+}
From 01189f2ac2033255e713cb53ea6c54f912b38a67 Mon Sep 17 00:00:00 2001
From: Juraj Uhlar
Date: Mon, 5 Aug 2024 23:31:56 +0100
Subject: [PATCH 3/6] docs: improve standalone distribution example
---
.../cloudfront_distribution.tf | 6 +++---
examples/standalone-distribution/variables.tf | 15 +++++++--------
2 files changed, 10 insertions(+), 11 deletions(-)
diff --git a/examples/standalone-distribution/cloudfront_distribution.tf b/examples/standalone-distribution/cloudfront_distribution.tf
index 9814e9f..f6f936e 100644
--- a/examples/standalone-distribution/cloudfront_distribution.tf
+++ b/examples/standalone-distribution/cloudfront_distribution.tf
@@ -46,9 +46,9 @@ resource "aws_cloudfront_distribution" "fpjs_cloudfront_distribution" {
}
}
- aliases = ["${var.subdomain}.${var.root_domain}"]
+ aliases = [var.proxy_subdomain_domain]
viewer_certificate {
- acm_certificate_arn = "arn:aws:acm:us-east-1:013357491684:certificate/c3ffee8c-071b-4ff8-bec2-e222eff602bc"
+ acm_certificate_arn = var.certificate_arn
ssl_support_method = "sni-only"
}
@@ -64,7 +64,7 @@ resource "aws_cloudfront_distribution" "fpjs_cloudfront_distribution" {
# (comment this out if you don't want to do that for now)
resource "aws_route53_record" "cloudfront_terraform_new_distribution_record" {
zone_id = var.domain_zone_id
- name = "${var.subdomain}.${var.root_domain}"
+ name = var.proxy_subdomain_domain
type = "CNAME"
ttl = 300
records = [aws_cloudfront_distribution.fpjs_cloudfront_distribution.domain_name]
diff --git a/examples/standalone-distribution/variables.tf b/examples/standalone-distribution/variables.tf
index 0558efa..c5ae052 100644
--- a/examples/standalone-distribution/variables.tf
+++ b/examples/standalone-distribution/variables.tf
@@ -13,19 +13,18 @@ variable "fpjs_get_result_path" {
type = string
}
-variable "subdomain" {
- description = "The subdomain for the CloudFront distribution"
+variable "proxy_subdomain_domain" {
+ description = "The subdomain for the CloudFront distribution, including the root domain of your website, for example `metrics.yourwebsite.com`"
type = string
- # default = "metrics"
}
-variable "root_domain" {
- description = "The root domain for the CloudFront distribution"
- type = string
- # default = "yourwebsite.com"
-}
variable "domain_zone_id" {
description = "Zone ID of the domain for the CloudFront distribution"
type = string
}
+
+variable "certificate_arn" {
+ description = "ARN of the domain certificate for the CloudFront distribution"
+ type = string
+}
From 9f53010f72f26a8faa1d919e6038068da7b6b278 Mon Sep 17 00:00:00 2001
From: Juraj Uhlar
Date: Mon, 5 Aug 2024 23:32:36 +0100
Subject: [PATCH 4/6] docs: add existing distribution example
---
examples/existing-ditribution/fingerprint.tf | 7 ++
examples/existing-ditribution/main.tf | 98 ++++++++++++++++++++
examples/existing-ditribution/providers.tf | 14 +++
examples/existing-ditribution/variables.tf | 41 ++++++++
4 files changed, 160 insertions(+)
create mode 100644 examples/existing-ditribution/fingerprint.tf
create mode 100644 examples/existing-ditribution/main.tf
create mode 100644 examples/existing-ditribution/providers.tf
create mode 100644 examples/existing-ditribution/variables.tf
diff --git a/examples/existing-ditribution/fingerprint.tf b/examples/existing-ditribution/fingerprint.tf
new file mode 100644
index 0000000..9978f01
--- /dev/null
+++ b/examples/existing-ditribution/fingerprint.tf
@@ -0,0 +1,7 @@
+module "fingerprint_cloudfront_integration" {
+ source = "git@github.com:fingerprintjs/terraform-aws-fingerprint-cloudfront-proxy-integration.git"
+
+ fpjs_agent_download_path = var.fpjs_agent_download_path
+ fpjs_get_result_path = var.fpjs_get_result_path
+ fpjs_shared_secret = var.fpjs_shared_secret
+}
diff --git a/examples/existing-ditribution/main.tf b/examples/existing-ditribution/main.tf
new file mode 100644
index 0000000..e6b5711
--- /dev/null
+++ b/examples/existing-ditribution/main.tf
@@ -0,0 +1,98 @@
+resource "aws_cloudfront_distribution" "main_website_distribution" {
+ enabled = true
+ is_ipv6_enabled = true
+ comment = "CloudFront distribution for ${var.website_origin_domain_name}"
+ default_root_object = "index.html"
+
+ origin {
+ domain_name = var.website_origin_domain_name
+ origin_id = "your-website"
+
+ custom_origin_config {
+ http_port = 80
+ https_port = 443
+ origin_protocol_policy = "https-only"
+ origin_ssl_protocols = ["TLSv1.2"]
+ }
+ }
+
+ default_cache_behavior {
+ allowed_methods = ["GET", "HEAD"]
+ cached_methods = ["GET", "HEAD"]
+ target_origin_id = "your-website"
+
+ forwarded_values {
+ query_string = false
+ cookies {
+ forward = "none"
+ }
+ }
+
+ viewer_protocol_policy = "redirect-to-https"
+ min_ttl = 0
+ default_ttl = 3600
+ max_ttl = 86400
+ }
+
+ restrictions {
+ geo_restriction {
+ restriction_type = "none"
+ }
+ }
+
+ aliases = [var.website_domain]
+
+ viewer_certificate {
+ acm_certificate_arn = var.certificate_arn
+ ssl_support_method = "sni-only"
+ }
+
+ #region Fingerprint CloudFront Integration start
+ origin {
+ domain_name = module.fingerprint_cloudfront_integration.fpjs_origin_name
+ origin_id = module.fingerprint_cloudfront_integration.fpjs_origin_id
+ custom_origin_config {
+ origin_protocol_policy = "https-only"
+ http_port = 80
+ https_port = 443
+ origin_ssl_protocols = ["TLSv1.2"]
+ }
+ custom_header {
+ name = "FPJS_SECRET_NAME"
+ value = module.fingerprint_cloudfront_integration.fpjs_secret_manager_arn
+ }
+ }
+
+ ordered_cache_behavior {
+ path_pattern = "${var.fpjs_behavior_path}/*"
+
+ allowed_methods = ["GET", "HEAD", "OPTIONS", "PUT", "POST", "PATCH", "DELETE"]
+ cached_methods = ["GET", "HEAD"]
+ cache_policy_id = module.fingerprint_cloudfront_integration.fpjs_cache_policy_id
+ origin_request_policy_id = module.fingerprint_cloudfront_integration.fpjs_origin_request_policy_id
+ target_origin_id = module.fingerprint_cloudfront_integration.fpjs_origin_id
+ viewer_protocol_policy = "https-only"
+ compress = true
+
+ lambda_function_association {
+ event_type = "origin-request"
+ lambda_arn = module.fingerprint_cloudfront_integration.fpjs_proxy_lambda_arn
+ include_body = true
+ }
+ }
+ #endregion
+}
+
+
+resource "aws_route53_record" "apex_domain" {
+ zone_id = var.domain_zone_id
+ name = var.website_domain
+ type = "A"
+
+ alias {
+ name = aws_cloudfront_distribution.main_website_distribution.domain_name
+ zone_id = aws_cloudfront_distribution.main_website_distribution.hosted_zone_id
+ evaluate_target_health = false
+ }
+}
+
diff --git a/examples/existing-ditribution/providers.tf b/examples/existing-ditribution/providers.tf
new file mode 100644
index 0000000..cc51288
--- /dev/null
+++ b/examples/existing-ditribution/providers.tf
@@ -0,0 +1,14 @@
+terraform {
+ required_providers {
+ aws = {
+ source = "hashicorp/aws"
+ version = "~> 5.57"
+ }
+ }
+
+ required_version = ">= 1.2.0"
+}
+
+provider "aws" {
+ region = "us-east-1"
+}
diff --git a/examples/existing-ditribution/variables.tf b/examples/existing-ditribution/variables.tf
new file mode 100644
index 0000000..1699084
--- /dev/null
+++ b/examples/existing-ditribution/variables.tf
@@ -0,0 +1,41 @@
+variable "fpjs_shared_secret" {
+ description = "The proxy secret for the Fingerprint proxy integration"
+ type = string
+}
+
+variable "fpjs_behavior_path" {
+ description = "All Fingeprint requests will be proxied through this path segment"
+ type = string
+}
+
+variable "fpjs_agent_download_path" {
+ description = "The Fingerprint agent download will be proxied through this path segment"
+ type = string
+}
+
+variable "fpjs_get_result_path" {
+ description = "The Fingerprint identification request will be proxied through this path segment"
+ type = string
+}
+
+variable "website_domain" {
+ description = "The domain for your existing CloudFront distribution, like `yourwebsite.com`"
+ type = string
+}
+
+variable "website_origin_domain_name" {
+ description = "The main origin of your distribution pointing to your website, like `yourwebsite.s3.amazonaws.com`"
+ type = string
+}
+
+variable "domain_zone_id" {
+ description = "Zone ID of the domain for your existing CloudFront distribution"
+ type = string
+}
+
+variable "certificate_arn" {
+ description = "ARN of the domain certificate for your website"
+ type = string
+}
+
+
From 96130b582c4067901c5847eab2c34b9efb092a96 Mon Sep 17 00:00:00 2001
From: Juraj Uhlar
Date: Mon, 5 Aug 2024 23:40:46 +0100
Subject: [PATCH 5/6] docs: add tfvars examples
---
examples/existing-ditribution/terraform.tfvars.example | 8 ++++++++
examples/standalone-distribution/terraform.tfvars.example | 6 ++++++
2 files changed, 14 insertions(+)
create mode 100644 examples/existing-ditribution/terraform.tfvars.example
create mode 100644 examples/standalone-distribution/terraform.tfvars.example
diff --git a/examples/existing-ditribution/terraform.tfvars.example b/examples/existing-ditribution/terraform.tfvars.example
new file mode 100644
index 0000000..257f4f3
--- /dev/null
+++ b/examples/existing-ditribution/terraform.tfvars.example
@@ -0,0 +1,8 @@
+fpjs_shared_secret = "YOUR_PROXY_SECRET_CREATED_IN_FINGERPRINT_DASHBOARD"
+fpjs_agent_download_path = "463N7"
+fpjs_get_result_path = "r35U17"
+fpjs_behavior_path = "fpj5"
+domain_zone_id = "ZONE_ID_OF_YOUR_DOMAIN_IN_AWS"
+website_domain = "yourwebsite.com"
+website_origin_domain_name = "your-website-origin.s3.amazonaws.com"
+certificate_arn = "ARN_OF_THE_CERTIFICATE_OF_YOUR_DOMAIN_IN_AWS"
diff --git a/examples/standalone-distribution/terraform.tfvars.example b/examples/standalone-distribution/terraform.tfvars.example
new file mode 100644
index 0000000..2882954
--- /dev/null
+++ b/examples/standalone-distribution/terraform.tfvars.example
@@ -0,0 +1,6 @@
+fpjs_shared_secret = "YOUR_PROXY_SECRET_CREATED_IN_FINGERPRINT_DASHBOARD"
+fpjs_agent_download_path = "463N7"
+fpjs_get_result_path = "r35U17"
+domain_zone_id = "ZONE_ID_OF_YOUR_DOMAIN_IN_AWS"
+proxy_subdomain_domain = "metrics.yourwebsite.com"
+certificate_arn = "ARN_OF_THE_CERTIFICATE_OF_YOUR_DOMAIN_IN_AWS"
From 08d66140c7c2e9751403f9983f8e00c9ee23bc26 Mon Sep 17 00:00:00 2001
From: Juraj Uhlar
Date: Mon, 5 Aug 2024 23:45:52 +0100
Subject: [PATCH 6/6] docs: tweak readme
---
README.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index de61c6a..7f85036 100644
--- a/README.md
+++ b/README.md
@@ -55,8 +55,8 @@ See [CloudFront Proxy Integration guide](https://dev.fingerprint.com/docs/cloudf
This repository also includes the following Terraform project examples:
-- Adding the Fingerprint proxy integration to an [existing CloudFront distribution](./examples//existing-ditribution/)
-- [Creating a new CloudFront distribution](./examples/standalone-distribution/) just for the Fingerprint proxy integration
+- [Adding the Fingerprint proxy integration to an existing CloudFront distribution](./examples//existing-ditribution/) (recommended)
+- [Creating a new CloudFront distribution just for the Fingerprint proxy integration](./examples/standalone-distribution/)
## How to update