CodeDeploy

AppSpec file structure | Update Lambda with CodeDeploy | Deployment type | Deployment configuration | CodeDeploy |

Overview

Deploy your src to EC2/on-prem, Lambda or ECS.

Features

AppSpec.yml

AppSpec file is a YAML/JSON file used to manage each deployment.

version

required. do not change. The only allow value is 0.0

os

operation system.

  • Linux

  • Windows

resources

hooks

what need to do in what sequence

ApplicationStop, DownloadBundle, BeforeInstall, Install, AfterInstall, ApplicationStart, ValidationService, BeforeBlockTraffic

AfterBlockTraffic, BeforeAllowTraffic, AllowTraffic

permissions (EC2/on-prem only)

Deployment group

  • IAM role

  • Deployment style

    • In-place: will replace application on your instance

    • Blue/green: create new green instance for your application.

  • Only deployments that use the EC2/On-Premises compute platform can use in-place deployments.

  • If you use an EC2/On-Premises compute platform, be aware that blue/green deployments work with Amazon EC2 instances only.

  • Deployment configuration

    • Canary: shift traffic to 2 increments. Specify a small % of traffic shifted to updated deployment.

      • Canary10Percent10Minutes then 10 percent of your customer traffic is immediately shifted to your new version. After 10 minutes, all traffic is shifted to the new version.

      • CodeDeployDefault.LambdaCanary10Percent5Minutes: 10 percent of your traffic is immediately shifted to your new version. After 5 minutes, all traffic is shifted.

    • Linear: shift traffic in equal %

      • CodeDeployDefault.LambdaLinear10PercentEvery1Minute: it will add 10 percent of the traffic linearly to the new version every minute -> need 10 minutes.

    • AllAtOnce: shift all the traffic to updated deployment.

CodeDeploy agent

  • When you work with EC2 or on-premises servers.

  • The agent is managed by a configuration file that specifies the directory paths and other settings to use when it interacts with the platform.

  • The CodeDeploy agent is not used in an Lambda or an ECS deployment.

Concepts

  • AppSpec file: application specific file. Is used to manage each deployment as a series of lifecycle event hooks, which are defined in the file.

Last updated