Menu
AWS CodeDeploy
User Guide (API Version 2014-10-06)

Update the AWS CodeDeploy Agent

For the Amazon Linux, RHEL, and Ubuntu Server operating systems, the AWS CodeDeploy agent is updated automatically when a new version is released. For Windows Server, you can install the AWS CodeDeploy agent updater for Windows Server after or instead of the AWS CodeDeploy agent. The agent will be updated whenever a new version is detected. You can also force updates on all supported operating systems by running a command on an instance.

Update the AWS CodeDeploy Agent on Amazon Linux or RHEL

After the AWS CodeDeploy agent (codedeploy-agent.noarch.rpm) is installed on an instance, it will be updated automatically within 24 hours of the release of a new version. The update time cannot be easily cancelled or rescheduled. If a deployment is in progress during the update, the current deployment lifecycle event will finish first. After the update is complete, the deployment will resume with the next deployment lifecycle event.

If you want to force an update of the AWS CodeDeploy agent, sign in to the instance, and run the following command:

Copy
sudo /opt/codedeploy-agent/bin/install auto

Update the AWS CodeDeploy Agent on Ubuntu Server

After the AWS CodeDeploy agent (codedeploy-agent_all.deb) is installed on an instance, it will be updated automatically within 24 hours of the release of a new version. The update time cannot be easily cancelled or rescheduled. If a deployment is in progress during the update, the current deployment lifecycle event will finish first. After the update is complete, the deployment will resume with the next deployment lifecycle event.

If you want to force an update of the AWS CodeDeploy agent, sign in to the instance, and run the following command:

Copy
sudo /opt/codedeploy-agent/bin/install auto

Update the AWS CodeDeploy Agent on Windows Server

To enable automatic updates of the AWS CodeDeploy agent whenever a new version is released, install the AWS CodeDeploy agent updater for Windows Server on new or existing instances. The updater will check periodically for new versions. When a new version is detected, the updater will uninstall the current version of the agent, if one is installed, before installing the newest version.

If a deployment is already underway when the updater detects a new version, the deployment will continue to completion; however, if a deployment attempts to start during the update process, the deployment will fail.

Sign in to the instance, and run the following commands in Windows PowerShell, one at a time:

Note

As an alternative to running the fifth command, you can double-click the MSI file if you are using a remote desktop client to connect to the instance.

Copy
Set-ExecutionPolicy RemoteSigned
Copy
Import-Module AWSPowerShell
Copy
New-Item –Path "c:\temp" –ItemType "directory" -Force
Copy
powershell.exe -Command Read-S3Object -BucketName bucket-name -Key latest/codedeploy-agent-updater.msi -File c:\temp\codedeploy-agent-updater.msi
Copy
c:\temp\codedeploy-agent-updater.msi /quiet /l c:\temp\host-agent-updater-log.txt
Copy
powershell.exe -Command Get-Service -Name codedeployagent

bucket-name represents one of the following:

  • aws-codedeploy-us-east-1 for instances in the US East (N. Virginia) region

  • aws-codedeploy-us-east-2 for instances in the US East (Ohio) region

  • aws-codedeploy-us-west-1 for instances in the US West (N. California) region

  • aws-codedeploy-us-west-2 for instances in the US West (Oregon) region

  • aws-codedeploy-ca-central-1 for instances in the Canada (Central) region

  • aws-codedeploy-eu-west-1 for instances in the EU (Ireland) region

  • aws-codedeploy-eu-west-2 for instances in the EU (London) region

  • aws-codedeploy-eu-central-1 for instances in the EU (Frankfurt) region

  • aws-codedeploy-ap-northeast-1 for instances in the Asia Pacific (Tokyo) region

  • aws-codedeploy-ap-northeast-2 for instances in the Asia Pacific (Seoul) region

  • aws-codedeploy-ap-southeast-1 for instances in the Asia Pacific (Singapore) region

  • aws-codedeploy-ap-southeast-2 for instances in the Asia Pacific (Sydney) region

  • aws-codedeploy-ap-south-1 for instances in the Asia Pacific (Mumbai) region

  • aws-codedeploy-sa-east-1 for instances in the South America (São Paulo) region

  • aws-codedeploy-cn-north-1 for instances in the China (Beijing) region

If you need to troubleshoot an update process error, type the following command to open the AWS CodeDeploy agent updater log file:

Copy
notepad C:\ProgramData\Amazon\CodeDeployUpdater\log\codedeploy-agent.updater.log

If you want to force an update of the AWS CodeDeploy agent, follow the instructions in Install or reinstall the AWS CodeDeploy agent for Windows Server.