/terraform-plausible-cloudfront

Terraform for setting up Plausible proxy through Cloudfront

Primary LanguageHCLMIT LicenseMIT

Terraform Plausible Setup

Terraform script to proxy Plausible through Cloudfront

Niedziela Solutions, LLC's website uses Plausible for analytics.

Requirements

Usage

  1. terraform init -backend-config="profile=YOUR_AWS_PROFILE". It will prompt you for the required information.
  2. cp environment.tfvars.example environment.tfvars and change as needed. You'll need to find the IDs for the two managed Cloudfront policies in the AWS Admin under Cloudfront -> Policies. Find CachingDisabled (Cache) and UserAgentRefererHeaders (Origin Request) then pull the ID from the URL. You can also remove the configuration for the policies in Terraform and manually set it up then find the drift for it and set the IDs that way.
  3. Verify: terraform plan -var-file=environment.tfvars
  4. Invoke: terraform apply -var-file=environment.tfvars

After the Cloudfront distribution is setup, you can change DNS to point to this Cloudfront distribution for your analytics subdomain.