CodeDeploy

Icon

CodeDeploy Icon

About

  • A deployment service that automates application deployment.

  • This service can automatically initiate rollback in case of failed deployments or trigger CloudWatch Alarm.

  • appsec.yml file defines how deployments happens.

  • Provides gradual control on deployments.

CodeDeploy Agent

  • The agent is responsible to deploy artifacts onto servers like EC2 instances.

  • As a prerequisite this agent should be installed in EC2 instance.

  • The EC2 instance must have sufficient permissions to access S3 to get deployment bundles.

Deployment Group

  • Deployment Group allows to group deployments settings in one place.

  • It consists of multiple deployments.

Rollbacks and Redeploys

  • Rollback is a redeploy a previously deployed revision of your application.

  • This can be done automatically i.e., when a failure occurs based on some CloudWatch Alarm or Manually.

  • Disable rollbacks - Do not perform rollbacks for this deployment.

  • When rollback is performed, CodeDeploy performs a new deployment with last known good revision i.e., its not a restored version.

appSec.yml

  • This YAML file consists of all the deployment instruction needed to deploy the application using CodeDeploy.

  • This file should be present in the root of project.

  • Life cycle hooks based on type of deployment can be configured in this file.

  • This life cycle hooks provides a way to verify deployment after each deployment phase.

Integrations

EC2/On-premises platform

  • CodeDeploy allows to deploy to EC2 instances & on-premises servers.

  • It allows to perform in-place deployments (for EC2 instances or ASG deployments) or blue-green deployments (for ASG deployments, must be using an ELB).

  • This requires CodeDeploy Agent to run on target instances.

  • Deployment speed could be defined.

    Deployment Strategy
    Description

    AllAtOnce

    Will have most downtime

    HalfAtATime

    Reduces capacity by 50% and does in-place deployments

    OneAtATime

    Slowest, lowest availability impact

    Custom

    Define your own rate of deployment

Lambda Platform

  • CodeDeploy helps to automate traffic shifts for Lambda aliases.

  • Feature is integrated with SAM framework.

  • This traffic shift can be done using different strategies.

    Strategy Type
    Strategy Names
    Description

    Linear

    LambdaLinear10PercentEvery3Minutes LambdaLinear10PercentEvery10Minutes

    Grow traffic every N minutes untill 100%

    Canary

    LambdaCanary10Percent5Minutes LambdaCanary10Percent30Minutes

    Try X percent for N minutes then 100%

    AllAtOnce

    -

    No time to test the updated version, directly switch all traffic to specified version

ECS Platform

  • This platform helps to automate the deployment of new ECS task definition.

  • Supports only Blue/Green deployments.

  • Application load balancer is required to do the traffic shift.

  • The traffic shift strategy is same as strategies mentioned for Lambda Platform.

Last updated