This repository contains Terraform code to deploy GOV.UK CDN services to Fastly. The VCL templates in this repository depend on secrets set in govuk-fastly-secrets to render correctly.
- Ensure you have Terraform Cloud access
- Make changes to the templates or other configuration
- Open a PR and wait for Terraform Cloud to run a plan against your changes
- Terraform Cloud's VCL diff display is pretty poor. To see a better diff, check the
fastly-vcl-diff
post-plan task on your run page
- If you are happy with the plan, merge your PR
- Watch the apply on the Terraform Cloud UI
- Ensure you have terraform installed (tfenv is preferable)
- Log in to your Terraform Cloud account with
terraform login
cd
to the service module in which you wish to make changes- Run
terraform init
and pick an environment to run the plan in - Run
terraform plan
to run plans with your local copy of the config
diff-generator/
- contains source code for diff generator Lambda functionshared/
- contains common files that are used by multiple serviceswww/ab_tests.yaml
- list of AB test variantsdictionaries.yaml
- non-secret Fastly dictionaries (e.g. AB test expiry times)
Each other directory in the root of this repo is a Fastly service.
Terraform Cloud uses Google SSO for login. To create your account, go to the SSO login page and use the organisation name govuk
. Your permissions are determined by which Google groups you are a member of.
- If you update secrets in the govuk-fastly-secrets repository, you may need to also run an apply on this repository after for your changes to take effect
- All environments for a given service share a common VCL template. If you need to make changes to the VCL, you may want to wrap your changes in an
if
statement, or specifyvcl_template_file
ingovuk-fastly-secrets
to temporarily use a different template file for a given environment.