CodeDeploy

AWS CodeDeploy is a cross-platform, managed deployments service.

Concepts

  • Applications are the root of the CodeDeploy configuration.
  • Deployment Groups are individual deployable environments within an Application.
  • Deployments are individual rollouts.
  • Deployment Type specifies the rollout strategy, and can be in-place or blue-green.
  • Deployment configuration specifies the rate of rollout, either "all at once", "one at a time", or a percentage of the fleet.
  • Revisions define the version of the application that will be deployed. These can be archive file URLs or commit IDs.

Supported platforms

Compute platform support is available for:

PlatformDeployment group specificationRevision specification
On-premisesN/AGit commit, archive file URL
EC2Auto scaling groups, instance tagsGit commit, archive file URL
ECSECS cluster, service, load balancer, and target groupsAppSpec file, ECS task definition version, container name, and container port
LambdaFunction nameAppSpec file, function name, function alias and source version

AppSpec files

AppSpec files (appspec.yml) specify the source and destination of the application's files, and a series of hooks to execute at different stages of the deployment process:

version: 0.0
os: linux
files:
  - source: /src
    destination: /opt/app
permissions:
  - object: /opt/app/etc
    pattern: credentials.ini
    owner: app
    mode: 644
    type:
      - file
hooks:
  BeforeInstall:
    - location: hooks/before-install.sh
      timeout: 300
      runas: root

The lifecycle event hooks available:

  • BeforeInstall
  • AfterInstall
  • AfterAllowTestTraffic
  • BeforeAllowTraffic
  • AfterAllowTraffic

The permissions key can be used to specify the filesystem permissions of the extracted files.

Agent

The codedeploy-agent is the Ruby (Private) agent responsible for executing the instructions defined in the AppSpec file. It's not bundled in the Amazon Linux AMI and must be installed manually.

Pricing

The CodeDeploy service is free for use within AWS. On-premises usage is charged per-instance update.

Monitoring

CodeDeploy Triggers allow deployment events to be sent to an SNS topic, allowing for automation and notification delivery.


Backlinks