> For the complete documentation index, see [llms.txt](https://docs.octoxlabs.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.octoxlabs.com/action-center/aws/ssm-install-software-on-ec2.md).

# SSM Install Software on EC2

Sends an AWS Systems Manager command that installs a Distributor package on every EC2 instance that the workflow passes to it. The job uses the AWS document `AWS-ConfigureAWSPackage` with the action Install.

### Before you begin

* AWS credentials (access key ID and secret access key) that are allowed to call the AWS API actions listed below. Enter them in the node or save them once in [Action Center Settings](broken://pages/ea41765c908dc2733f18c3a1329cd7501b60f6da) (the **AWS** group has one tab per job, so each job needs its own defaults).
* Asset type: `device` only.
* Required column: `Specifics.aws-ec2.InstanceId`. Only devices that have a value in this column are used; the rest are left out.
* AWS API actions the job calls: `SendCommand` (SSM).

### Settings

The node form shows these fields. Field labels are generated from the field names, so they appear as listed here. The AWS access key ID and secret access key are plain text fields, not masked fields.

| Setting               | Type | Required | Default | Description                                                                               |
| --------------------- | ---- | -------- | ------- | ----------------------------------------------------------------------------------------- |
| Aws access key id     | Text | Yes      | None    | AWS access key ID the job signs its requests with. Not masked in the form or in Settings. |
| Aws secret access key | Text | Yes      | None    | Secret access key for the key ID above. Not masked in the form or in Settings.            |
| Aws region            | Text | Yes      | None    | AWS region the client connects to, for example `eu-west-1`. The value may be empty.       |
| Package name          | Text | Yes      | None    | Name of the AWS Distributor package, for example `AmazonCloudWatchAgent`.                 |
| Package version       | Text | No       | None    | Version to install. If left empty, AWS installs the latest version.                       |

### How it works

The job reads the instance ID from every incoming device asset that has one and sends the IDs to AWS Systems Manager in batches of 50 instances per request.

Each batch is sent with one `SendCommand` call for the document `AWS-ConfigureAWSPackage` with the parameters action `Install`, the package name and, if you entered one, the version. The command ID is written to the run log.

The job finishes when AWS has accepted the commands. It does not wait for the installation to complete or check its result on the instance, so check the command status in AWS Systems Manager.

If no asset has an instance ID, the job fails with `EC2 instance ids not found`. If an AWS call fails, the job fails with `AWS SSM install software operation failed`; batches before the failing one already took effect and later batches are not sent.

The job does not change the asset data. It passes the incoming assets unchanged to the next node.

### Example

Put the job after a condition node whose saved query returns the instances that are missing the package.

| Setting               | Value                        |
| --------------------- | ---------------------------- |
| Aws access key id     | `YOUR_AWS_ACCESS_KEY_ID`     |
| Aws secret access key | `YOUR_AWS_SECRET_ACCESS_KEY` |
| Aws region            | `eu-west-1`                  |
| Package name          | `AmazonCloudWatchAgent`      |
| Package version       | (empty, latest)              |

### Related jobs

To apply operating system patches instead, use [SSM Patch EC2 Instance](broken://pages/e8cc4144ababae571dd2945623493c9e726ca4b4).

### What's next?

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>About Action Center</strong></td><td>Workflows, triggers, conditions and job nodes.</td><td><a href="broken://pages/94a9962c87c4d45ae1ec3bb263b516656f67490d">Broken link</a></td></tr><tr><td><strong>Action Center Settings</strong></td><td>Save the AWS connection values as job defaults.</td><td><a href="broken://pages/ea41765c908dc2733f18c3a1329cd7501b60f6da">Broken link</a></td></tr><tr><td><strong>SSM Patch EC2 Instance</strong></td><td>A related AWS job.</td><td><a href="broken://pages/e8cc4144ababae571dd2945623493c9e726ca4b4">Broken link</a></td></tr></tbody></table>
