Search code examples
amazon-web-servicesamazon-ec2aws-code-deploy-appspec

Codedeploy rollback not picking the previous successful build version


For some reason AWS Codedeploy rollback seems to always pick up the latest version and fails

Deployment 1 is success and a revision is created in S3 bucket.

Deployment 2 is failure and Codedeploy rollback kicks in which is Automatic

Deployment 3 also fails for the same reason as Deployment 2

Expected Codedeploy behaviour is for Deployment 3 it should pick up the Deployment 1 S3 build version.

I am not sure if there are any missing links in S3 bucket with Codedeploy. Any thoughts much appreciated.

Thank you


Solution

  • Not sure if this applies to your situation specifically, but "strange" rollback behavior of CodeDeploy is documented:

    However, if the deployment that failed was configured to overwrite, instead of retain files, an unexpected result can occur during the rollback.

    Thus it is possible that you are observing these "unexpected results" that can occur when you deploy and fail with an existing content.

    You can read up more on that in: