Update the CodeDeploy agent on Windows Server - Amazon CodeDeploy
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Update the CodeDeploy agent on Windows Server

You can enable automatic updates of the CodeDeploy agent with Amazon Systems Manager. With Systems Manager, you can configure an update schedule for your Amazon EC2 or on-premises instances by creating an association with Systems Manager State Manager. You can also manually update the CodeDeploy agent by uninstalling the current version and installing a newer one.

Set up automatic CodeDeploy agent update with Amazon Systems Manager

To configure Systems Manager and enable automatic updates of the CodeDeploy agent, follow the instructions in Install the CodeDeploy agent using Amazon Systems Manager.

Update the CodeDeploy agent manually

To update the CodeDeploy agent manually, you can install the latest version from the CLI or using Systems Manager. Follow the instructions in Install the CodeDeploy agent. It is recommended that you uninstall older versions of the CodeDeploy agent by following the instructions in Uninstall the CodeDeploy agent.

(Deprecated) Update the CodeDeploy agent with the Windows Server Updater

Note

The CodeDeploy agent updater for Windows Server is deprecated and will not update to any version after 1.0.1.1597.

To enable automatic updates of the CodeDeploy agent, install the CodeDeploy agent updater for Windows Server on new or existing instances. The updater checks periodically for new versions. When a new version is detected, the updater uninstalls 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 continues to completion. If a deployment attempts to start during the update process, the deployment fails.

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

On Windows Server instances, you can download and install the CodeDeploy agent updater by running Windows PowerShell commands, using a direct download link, or running an Amazon S3 copy command.

Use Windows PowerShell

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

Set-ExecutionPolicy RemoteSigned

If you are prompted to change the execution policy, choose Y so Windows PowerShell requires all scripts and configuration files downloaded from the internet be signed by a trusted publisher.

Import-Module AWSPowerShell
New-Item -Path "c:\temp" -ItemType "directory" -Force

For the China (Beijing) Region:

  • powershell.exe -Command Read-S3Object -BucketName aws-codedeploy-cn-north-1 -Key latest/codedeploy-agent-updater.msi -File c:\temp\codedeploy-agent-updater.msi

For the China (Ningxia) Region:

  • powershell.exe -Command Read-S3Object -BucketName aws-codedeploy-cn-northwest-1 -Key latest/codedeploy-agent-updater.msi -File c:\temp\codedeploy-agent-updater.msi
c:\temp\codedeploy-agent-updater.msi /quiet /l c:\temp\host-agent-updater-log.txt
powershell.exe -Command Get-Service -Name codedeployagent

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

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

If the browser security settings on the Windows Server instance provide the required permissions (for example, to http://*.amazonaws.com.cn), you can use a direct link to download the CodeDeploy agent updater. Then run the installer manually.

For China (Beijing) Region, use:

https://aws-codedeploy-cn-north-1.s3.cn-north-1.amazonaws.com.cn/latest/codedeploy-agent-updater.msi

For China (Ningxia) Region, use:

https://aws-codedeploy-cn-northwest-1.s3.cn-northwest-1.amazonaws.com.cn/latest/codedeploy-agent-updater.msi

Use an Amazon S3 copy command

If the Amazon CLI is installed on the instance, you can use the Amazon S3 cp command to download the CodeDeploy agent updater and then run the installer manually. For information, see Install the Amazon Command Line Interface on Microsoft Windows.

For China (Beijing) Region, use:

aws s3 cp s3://s3-cn-north-1/latest/codedeploy-agent-updater.msi codedeploy-agent-updater.msi --region cn-north-1

For China (Ningxia) Region, use:

aws s3 cp s3://s3-cn-northwest-1/latest/codedeploy-agent-updater.msi codedeploy-agent-updater.msi --region cn-northwest-1