> 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/iam-suspend-users.md).

# IAM Suspend Users

Suspends every IAM user that the workflow passes to it in two steps: it deletes the user's console login profile and it sets all of the user's access keys to Inactive. The user itself, its groups and its policies are not deleted.

{% hint style="warning" %}
Deleting the login profile removes the user's console password. To let the user sign in again, someone has to create a new login profile in AWS.
{% endhint %}

### 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: `user` only.
* Required column: `Specifics.aws-iam.UserName`. Only users that have a value in this column are used; the rest are left out.
* AWS API actions the job calls: `DeleteLoginProfile`, `ListAccessKeys`, `UpdateAccessKey` (IAM).

### 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.       |

### How it works

The job reads the user name from every incoming user asset that has one. If no asset has a user name, the job fails with `IAM user usernames not found`.

The job writes a warning with the number of users to the run log, then handles each user in turn:

1. It calls `DeleteLoginProfile`. If the user has no login profile, that step is skipped.
2. It lists the access keys and sets every key that is not already Inactive to Inactive.

Any other AWS error stops the job at that user and fails it with the AWS error message. Users handled before it stay suspended.

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 (User inventory) whose saved query returns the IAM users to suspend. The job has no settings of its own besides the connection.

| 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`                  |

### Related jobs

To disable only the access keys, use [IAM Disable Access Keys](broken://pages/d078def679d63ce6fe8c6aaf1dd07bfa16595c13).

### 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>IAM Disable Access Keys</strong></td><td>A related AWS job.</td><td><a href="broken://pages/d078def679d63ce6fe8c6aaf1dd07bfa16595c13">Broken link</a></td></tr></tbody></table>

{% hint style="info" %}
Available starting from version 6.3.0.
{% endhint %}
