CodeDeploy

  • A fully managed deploy service in the cloud
  • Can deploy EC2, On-Premise, Lambda or ECS
  • Rapidly release new features
  • Update AWS Lambda function versions.
  • Avoid downtime during application deployment
  • Perform In-Place or Blue/Green deployments
  • Integrates with existing CI/CD tools e.g. Jenkins, CodePipeline
  • Integrates with existing config management tools e.g. Pupper, Chef, Ansible

Core Components

Application The unique identifier for the application being deployed. Ensures the correct combination of revision, deployment config, and group are referenced during deployment.

Deployment Groups A set of EC2 instances or Lambda Functions where the new revision is deployed to

Deployment This is the process and components used to apply a new application revision

Deployment Configuration A set of deployment ruels used during deployment - with success / failure conditions included

AppSpec File Contains the deployment actions that CodeDeploy should execute during deployment

Revision This is everything required to deploy a new version: AppSpec file, application files, config files, executables

In-Place Deployments

  • The app on each instance in the deployment group is stopped
  • The latest app revision is installed, and the new version of the application is started and validated.
  • You can use a load balancer so that each instance is deregistered during its deployment and then restored to service after the deployment is complete.
  • Only deployments that use the EC2/On-Premises compute platform can use in-place deployments

Blue-Green Deployments

  • Instances are provisioned for the replacement environment.
  • The latest application revision is installed on the replacement instances.
  • An optional wait time occurs for activities such as application testing and system verification.
  • Instances in the replacement environment are registered with an ELB, causing traffic to be rerouted to them.
  • Instances in the original environment are deregistered and can be terminated or kept running for other uses.

Appspec.yaml

  • Responsible for saying where the code should be installed and how to get the new piece of code running

CodeDeploy Agent and ServiceRole

You will need to install the CodeDeploy agent so the EC2 instance can report back to CodeDeploy

You mad eneed to create a CodeDeploy Service Role based on your deployment strategy