In the first part of this workshop, we’ll introduce you to the core concepts needed to deploy a new version of your Fastly service via the API and the benefits of automating this process.
We’ll then advance together building a continuous deployment pipeline around an example Fastly config. Combining Fastly’s 5-second deploys, API control, and some open-source tooling (Travis, Terraform), attendees will contribute live changes and see their results in the demo. We’ll also gain some tips and tricks on along the way, such as how to manage multiple environments (staging, prod), Custom VCL, and secrets.
5. • Configuration drift
• Manual deployment
• Not reproducible
• Can’t see outcomes ahead of time
• Changes can’t be traced
• Can’t easily rollback state
The problem?
6. • Services can be easily reproduced
• Services are consistent
• Processes are repeatable & predictable
• Configuration is continuously tested
• Visibility and actionability
The goal
7. • Declare our service configuration in code
• Configuration is maintained in VCS
• Small changes get tested and continuously integrated
• Deployment is automated on every change
How?
14. • How to apply changes to your services via the CLI
• What is Terraform?
• How we can define our Fastly configuration as code
• How to use CI to automate the application of your changes
• How to manage multiple environments*
What we'll learn today
17. • Find the active version of service
• Clone the active version
• Delete all the existing VCL files
• Upload the new VCL files
• Define the main VCL
• Validate the newly cloned version
• Activate version
Manually deploying a new version
24. • Unify the view of resources using infrastructure as code
• Support the modern data center (IaaS, PaaS, SaaS)
• Expose a way to safely and predictably change infrastructure
• Provide a workflow that is technology agnostic
• Manage anything with an API
Terraform's Goals
25. • Provides a high-level abstraction of infrastructure (IaC)
• Allows for composition and combination
• Supports parallel management of resources (graph, fast)
• Separates planning from execution (dry-run)
Terraform vs. Other Tools
26. • Human-readable configuration (HCL) is designed for human
consumption so users can quickly interpret and understand their
infrastructure configuration.
• HCL includes a full JSON parser for machine-generated
configurations.
Infrastructure as Code (Terraform)