A utility to configure the Fastly CDN from version-controllable VCL and YAML files, using Fastly's API.
To run Fastly Configure, you'll need:
- Ruby 2.0.0 or later
- Bundler 1.5.3 or later
- a Fastly account
The ability to upload custom VCL is not turned on for accounts by default. To enable it, contact Fastly's support team.
This script makes use of a few third-party Gems. Before running this script, you'll need to install the Gems listed in the Gemfile. The easiest way to do this is with Bundler:
bundle install
You need to set two environment variables to help this script connect to the Fastly API:
- FASTLY_USER
- FASTLY_PASS
Due to API restrictions, you can't currently use an account that has two-factor authentication enabled with this script.
Service configuration is passed in to the script using a YAML file, which
must live at fastly.yaml
. You can find an example in fastly.yaml
in this
repository. Additional configuration parameters can also be set in this
file to enable the use of ERB look-ups in the VCL.
Your VCL script should be stored as an ERB template in /vcl_templates
. The
VCL file should be named the same as the configuration
.
- Fork it.
- Create a feature branch.
- Commit your changes.
- Push to the new branch.
- Create a pull request.