Skip to content

ses1er/varnish-ec2-autoscaling

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 

Repository files navigation

Summary

This script will generate a round-robin backend director based on EC2 tag name and value, useful for backends in an austoscaling group. If the newly generated vcl is different than the current running one, the old one will be overwritten and varnish_reload_vcl will be executed.

Dependencies

  1. aws-cli - environment variables must be set for AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY, or have IAM role with the following permission: "ec2:Describe*"
  2. md5sum - can easily be installed via system package management, yum or apt-get
  3. varnish 4.0 - this is obvious, but make sure it is working without this script first.
  4. RELOAD_VCL=1 - ensure RELOAD_VCL=1 exists in your varnish.params file.

Usage

This script should be ran as a cron job. Ensure you include the following to your default vcl:

 vcl 4.0
 import directors;
 include "<value of $VCL>";

 sub vcl_init {
   call <value of $SUBNAME>;
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages