I am trying to use CodeDeploy to effectively restart my service for me (with the correct interactions with the load balancer). To do this, I copy a previous deployment and re-deploy.
Unfortunately, as part of the re-deployment, CodeDeploy re-downloads the bundle from the S3 bucket even though the contents were already on the host machine.
Is there a way to instruct CodeDeploy to not re-download the bucket and just use the existing revision bundle on the machine?
If there isn't, then what is the benefit of keeping more than the most recent revision on the host machine at all?
Is there a way to instruct CodeDeploy to not re-download the bucket and just use the existing revision bundle on the machine?
AFAIK, this is not possible. Every time CodeDeploy deploys, it will create a DeploymentId. This is immutable.
If there isn't, then what is the benefit of keeping more than the most recent revision on the host machine at all?
The previous revision is used to run the ApplicationStop lifecycle hook scripts. Other than that you are not required to keep older revisions. The ":max_revisions:" property can be configured in CodeDeploy agent config file [1] to specify how many revisions to store (default is 5). This value needs to be >=1.
[1] https://docs.aws.amazon.com/codedeploy/latest/userguide/reference-agent-configuration.html