CodeDeploy does very little by default - it grabs the code from S3 or Github, then runs your scripts per the appspec.yml
file's instructions.
If your deployments are grabbing gigabytes of data from S3, you'll find that takes some time for the data transfer (particularly on smaller EC2 instances with limited bandwidth), but other than that deployment delays are much more likely to be due to whatever you're doing in your deployment scripts.
The steps in a CodeDeploy deployment are:
- ApplicationStop - you control this hook
- DownloadBundle - CodeDeploy grabs code from S3/Github
- BeforeInstall - you control this hook
- Install - CodeDeploy copies code from a temp location to the final destination
- AfterInstall - you control this hook
- ApplicationStart - you control this hook
- ValidateService - you control this hook
The bolded ones are up to CodeDeploy, the others are up to you. If you're seeing varying delays in the bolded ones, contact AWS support, but otherwise chances are you need to investigate your hooks.