Menu
Amazon Elastic Compute Cloud
User Guide for Linux Instances

Updating the Amazon SSM Agent with SSM Run Command

You can use the AWS-UpdateSSMAgent command document to update the Amazon SSM agent running on your instances. You can update to either the latest version or downgrade to an older version. When you execute the command, the system downloads the version from AWS, installs it, and then uninstalls the version that existed before the command was run. If an error occurs during this process, the system rolls back to the version on the server before the command was run and the command status shows that the command failed.

Tip

The Commands page in the EC2 console includes a section called AWS Command Line Interface command. This section displays a usable CLI script that is generated based on the parameters you enter.

To update the Amazon SSM Agent using Run Command

  1. Open the Amazon EC2 console and choose Commands in the navigation pane.

  2. Choose Run a Command.

  3. In the Command document list, choose AWS-UpdateSSMAgent.

  4. Choose Select target instances to select the instances where you want the command to run. If you do not see a complete list of instances, the missing instances might not be configured properly for Run Command. For more information, see SSM Run Command Prerequisites.

  5. (Optional) In the Version field, type a specific version of the Amazon SSM agent to install. You can install older versions of the agent. If you do not specify a version, the service will be updated to the latest version.

  6. (Optional) In the Allow downgrade list, choose True if you want to install an earlier version of the Amazon SSM agent. If you choose this option, you must specify the earlier version number. Choose False if you want the system to install only the newest version of the service.

  7. (Optional) In the Comment field, type information you want to provide about this command. Comments are stored in the log file and appear in the Command Invocation List in the Amazon EC2 console.

    Tip

    We recommend that you enter specific comments about each command you run. The list of commands that you send can grow quickly, and the Comment field can help you identify commands that you want to monitor.

  8. In the Timeout (seconds) field, type the number of seconds Run Command should attempt to reach instances before an instance is considered unreachable and the command execution fails. The minimum is 30 seconds. The maximum is 30 days. The default value is 10 minutes.

  9. In the S3 bucket field type the name of an Amazon S3 bucket where you want to store the output of the command.

    Important

    The Run Command Output page in the Amazon EC2 console truncates output after 2500 characters. Configure an Amazon S3 bucket before executing commands with Run Command. If your command output was longer than 2500 characters, you can view the full output in your Amazon S3 bucket. For more information, see Create a Bucket.

  10. In the S3 key prefix, field enter the name of a subfolder in the Amazon S3 bucket. This subfolder can help you organize Run Command output.

For information about how to view the results of your command, see Viewing Command Output in the Amazon EC2 Console.

For information about how to run commands using the AWS CLI, see the SSM CLI Reference.