Demo repository for the talk Building a continuous deployment pipeline with Terraform and Fastly, first presented at Altitude Trek SF 2019.
In this session, you’ll walk through the process of creating a continuous deployment pipeline using Travis, Terraform, Fastly, and GitHub. We’ll introduce you to the core concepts needed to deploy a new version of your Fastly service via the API, as well as the benefits of automating this process. Along the way, you’ll gain practical, implementable tips and tricks for managing your infrastructure as code.
- Terraform (>= 0.11.13)
- Git
- Travis CI account
- Google Cloud Platform (GCP) account
- Fastly account
Fork this repository and clone to a local directory.
You will need a terraform.tfvars
file containing the following access token variables:
FASTLY_API_TOKEN = "<YOUR FASTLY API TOKEN>"
GCP_PROJECT_ID = "<YOUR GCP PROJECT ID>"
GCS_ACCESS_KEY = "<YOUR GCP ACCESS KEY>"
GCS_SECRET_KEY = "<YOUR GCP SECRET KEY>"
You will also need a .google.json
file containing the IAM credentials for a service account that has storage write acccess permissions.
terraform workspace new staging
terraform plan
terraform apply
- Make a change to
fastly_service_v1
resource inmain.tf
git commit -am "Details of your change"
git push origin master