SaigonTech Vault
Loại: knowledge-doc 2026-09-29 active #wiki-import

CodeDeploy

  • AWS CodeDeploy is a service that automates application deployments to a variety of compute services including Amazon EC2, AWS Fargate, AWS Lambda, and on-premises instances.
  • CodeDeploy fully automates your application deployments eliminating the need for manual operations.
  • CodeDeploy protects your application from downtime during deployments through rolling updates and deployment health tracking.
  • CodeDeploy gives you centralized control of your deployments through the AWS Management Console, CLI, SDKs, or APIs allowing you to launch, control, and monitor your deployments. You can view the deployment progress down to individual setup events.
  • CodeDeploy tracks and stores the recent history of your deployments, so you can investigate the timeline and change history of past deployments.

Features:

  1. Server, serverless, and container applications: CodeDeploy lets you deploy both traditional applications on servers and applications that deploy a serverless AWS Lambda function version or an Amazon ECS application.

  2. Automated deployments: CodeDeploy fully automates your application deployments across your development, test, and production environments. CodeDeploy scales with your infrastructure so that you can deploy to one instance or thousands.

  3. Minimize downtime: If your application uses the EC2/On-Premises compute platform, CodeDeploy helps maximize your application availability. During an in-place deployment, CodeDeploy performs a rolling update across Amazon EC2 instances. You can specify the number of instances to be taken offline at a time for updates. During a blue/green deployment, the latest application revision is installed on replacement instances. Traffic is rerouted to these instances when you choose, either immediately or as soon as you are done testing the new environment. For both deployment types, CodeDeploy tracks application health according to rules you configure.

  4. Stop and roll back: You can automatically or manually stop and roll back deployments if there are errors.

  5. Centralized control: You can launch and track the status of your deployments through the CodeDeploy console or the AWS CLI. You receive a report that lists when each application revision was deployed and to which Amazon EC2 instances.

  6. Easy to adopt: CodeDeploy is platform-agnostic and works with any application. You can easily reuse your setup code. CodeDeploy can also integrate with your software release process or continuous delivery toolchain.

  7. Concurrent deployments: If you have more than one application that uses the EC2/On-Premises compute platform, CodeDeploy can deploy them concurrently to the same set of instances.

Compute platform

  1. AWS Lambda Compute Platform:

  1. Amazon ECS Compute Platform:

  1. EC2/On-Premises Compute Platform:

For CodeDeploy to work, you need:

  1. CodeDeploy AppSpec file
  2. An application specification file (AppSpec file), which is unique to CodeDeploy, is a YAML-formatted or JSON-formatted file. The AppSpec file is used to manage each deployment as a series of lifecycle event hooks, which are defined in the file.
  3. For each compute platform, it's structure will different, please reference: https://docs.aws.amazon.com/codedeploy/latest/userguide/reference-appspec-file.html
  4. CodeDeploy Agent setup in compute platform
  5. The AWS CodeDeploy agent is a software package that, when installed and configured on an instance, makes it possible for that instance to be used in CodeDeploy deployments.
  6. When the CodeDeploy agent is installed, a configuration file is placed on the instance. This configuration file specifies directory paths and other settings for CodeDeploy to use as it interacts with the instance. You can change some of the configuration options in the file.
  7. Location:
  8. Amazon Linux, Ubuntu Server, and Red Hat Enterprise Linux (RHEL) instances: /etc/codedeploy-agent/conf/codedeployagent.yml
  9. Windows Server instances: C:\ProgramData\Amazon\CodeDeploy\conf.yml

Working with CodeDeploy: https://wiki.sgt-dev.space/6580fcfda2928a2b6cc464ad

Pricing

  • For CodeDeploy on EC2, Lambda, ECS: There is no additional charge for code deployments to Amazon EC2, AWS Lambda or Amazon ECS through AWS CodeDeploy.
  • For CodeDeploy On-Premises: You pay $0.02 per on-premises instance update using AWS CodeDeploy. There are no minimum fees and no upfront commitments. For example, a deployment to three instances equals three instance updates. You will only be charged if CodeDeploy performs an update to an instance. You will not be charged for any instances skipped during the deployment.