Search code examples
amazon-web-servicesvarnishautoscalingaws-code-deploy

How to restart Varnish service on another Auto scaling group after Code deploy


Our Application architecture contain two auto scaling group

  1. Varnish instances
  2. App instance

We use AWS Code deploy to deploy to App instance , after every deployment we need to restart or run some commands on varnish instances for clearing the cache.

Can anyone help me to solve the question.?

The Solution should be automated, no manual effort!!


Solution

  • You can create a Lambda function to execute those commands on Varnish ASG instances and invoke the Lambda function if Code Deploy is successful. We can invoke Lambda functions as part of Code Pipeline.