AWS Blue Green Deployment: Possible Errors and Solutions

This is mostly meant to serve as troubleshooting notes to my future self.

Image for post
Image for post
Memento

Error 1: The deployment failed because no instances were found in your blue fleet

Image for post
Image for post

This might happen if a previous deployment failed. Whenever CodeDeploy tries to deploy your application, it creates a new Auto-Scaling Group. It will then add the name of the new auto scaling group to the environment config of your deployment group. The new auto scaling group is used as your BLUE group in future deployments.

Image for post
Image for post

But if the current deployment fails, the new auto scaling group might be discarded or be left empty. So the next time CodeDeploy tries to deploy your application it will fail with the error: “The deployment failed because no instances were found in your blue fleet”

Solution:

  • Edit your deployment group
  • Scroll down to the Environment Configuration section (see screenshot above 👆)
  • Change the Auto Scaling Group back to the correct one (the last successfully deployed Auto Scaling Group)
  • Save and go back to your pipeline and then click on retry. Voila!

Written by

Software Developer at Accounteer.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store