> For the complete documentation index, see [llms.txt](https://docs.keeper.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.keeper.io/keeperpam/privileged-access-manager/just-in-time-access-jit/keeper-privileged-cloud/using-privileged-cloud-to-generate-aws-sts-credentials.md).

# Using Privileged Cloud to Generate AWS STS Credentials

Remove standing privilege and provide programmatic credentials for use in AWS

<figure><img src="https://762006384-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MJXOXEifAmpyvNVL1to%2Fuploads%2FQGaGj3QxRcS1gthHDR6J%2Fimage.png?alt=media&amp;token=192d58af-3938-4a9d-8bf4-9e597704555b" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
This feature goes live with Vault version 18.8 in November 2026
{% endhint %}

### Overview

Keeper Privileged Cloud gives developers and DevOps teams just-in-time access to elevated AWS permissions through short-lived AWS Security Token Service (STS) credentials. Eliminating standing privileges is a critical security control that limits the impact of compromised credentials and reduces the risk of unauthorized access.

Developers retain their existing tools and workflows, including the AWS CLI, scripts, Terraform and AWS SDKs, with minimal friction. The KeeperPAM Gateway generates the temporary credentials—an access key ID, secret access key and session token - and Keeper delivers them securely through the Vault.

This capability supports both just-in-time ephemeral accounts and existing AWS users.

### Setup

* Set up the PAM configuration as outlined in [AWS Environment Setup](https://docs.keeper.io/keeperpam/privileged-access-manager/getting-started/pam-configuration/aws-environment-setup.md), and connect the corresponding KeeperPAM Gateway.
* Create a [**PAM Cloud**](https://docs.keeper.io/keeperpam/privileged-access-manager/getting-started/pam-resources/pam-cloud.md) record and configure JIT and Workflow policies as described in the [setup docs](https://docs.keeper.io/keeperpam/privileged-access-manager/just-in-time-access-jit/keeper-privileged-cloud/configure-and-elevate-access-for-a-pam-cloud-resource.md)
* To use ephemeral accounts, make sure to check the "**Create ephemeral account for connection**" option in the record's JIT settings, and validate the permissions the account should receive.
* Share the **PAM Cloud** record with view-only permission to users who are eligible to request elevation

<figure><img src="https://762006384-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MJXOXEifAmpyvNVL1to%2Fuploads%2FrtHFqFvZAmF251QZeX3t%2FScreenshot%202026-10-30%20at%203.12.12%E2%80%AFPM.png?alt=media&amp;token=4b146d0b-3d92-4f88-9740-885d270dcabb" alt="PAM Cloud Resource record JIT settings for ephemeral account creation and generation of credentials"><figcaption><p>This record is set up to use an ephemeral account when generating credentials on the cloud resource.</p></figcaption></figure>

<figure><img src="https://762006384-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MJXOXEifAmpyvNVL1to%2Fuploads%2FPnzhHljEbz7B4e8sQSYN%2FScreenshot%202026-10-30%20at%203.19.12%E2%80%AFPM.png?alt=media&amp;token=5816732e-fa92-46b1-b034-8f547bf74037" alt="PAM Cloud Resource record showing generate credentials button"><figcaption><p>After the JIT settings have been saved for the record, the "Generate Credentials" button can be used.</p></figcaption></figure>

### Generating Credentials

As a user who is eligible to receive elevated access:

{% stepper %}
{% step %}

#### Open the record

Click **Generate Credentials**.
{% endstep %}

{% step %}

#### Wait for (up to) 15 seconds

Credentials will appear in a one-time share modal after they have been generated.
{% endstep %}

{% step %}

#### Save the credentials

Credentials can be saved as a PAM User record, or the user can copy/paste the STS credentials and place them in the appropriate location.
{% endstep %}
{% endstepper %}

If a workflow is active, the credentials will expire automatically when the workflow expires.

{% hint style="warning" %}
If the credentials modal is dismissed before the credentials are copied or saved, the user will not be able to see the credentials, as this is a one-time share.
{% endhint %}

<figure><img src="https://762006384-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MJXOXEifAmpyvNVL1to%2Fuploads%2F3zfMDzran5wVjwugWFR4%2FScreenshot%202026-10-30%20at%203.16.49%E2%80%AFPM.png?alt=media&amp;token=6da7cdc6-5642-4d8c-9780-5882ac5284a1" alt="Generated credentials being shown in a one-time shared modal"><figcaption><p>After the user account has been created, and STS credentials have been generated, they are shared in a one-time modal.</p></figcaption></figure>

<figure><img src="https://762006384-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MJXOXEifAmpyvNVL1to%2Fuploads%2FO80Ys9RWn1bK1QXg1EUr%2FScreenshot%202026-10-30%20at%203.17.13%E2%80%AFPM.png?alt=media&amp;token=04a84ac1-056a-44ec-8b98-5a1b40efb01b" alt="Modal showing where the user can save the generated credentials as a PAM User record"><figcaption><p>The credentials can be saved in any of the subfolders in the application folder as a PAM User record.</p></figcaption></figure>

### What happens behind the scenes

{% stepper %}
{% step %}

#### Optional: An ephemeral user account is created

For an ephemeral account, the KeeperPAM Gateway creates a new user in AWS with the permissions from the JIT settings. For an existing user, it skips this step. In both cases, the KeeperPAM Gateway adds the JIT role or group to that user, unless the user already has it.
{% endstep %}

{% step %}

#### A temporary access key is created

The KeeperPAM Gateway creates a temporary access key (a token) on the user's account. AWS won't issue a console login link without one.
{% endstep %}

{% step %}

#### STS Credentials are generated in AWS

The KeeperPAM Gateway uses that access key to get STS credentials from AWS.
{% endstep %}

{% step %}

#### A one-time modal is shown

The KeeperPAM Gateway puts the STS credentials into a new record and shares it with the user. For an ephemeral account, the record also includes the new AWS account's password.
{% endstep %}
{% endstepper %}

The credentials expire after the elevation time set in the JIT settings, or after 1 hour if it isn't set. AWS only accepts durations between 15 minutes and 36 hours, so anything outside that range gets moved to the closest limit.

The credentials also stop working as soon as the workflow ends, even if they haven't expired yet.

<figure><img src="https://762006384-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MJXOXEifAmpyvNVL1to%2Fuploads%2FPUQzZZYZ6tYGWBJIYQjG%2FScreenshot%202026-10-30%20at%203.21.04%E2%80%AFPM.png?alt=media&amp;token=b0ec54a2-5f38-4b68-b64d-0c8aabbee513" alt="AWS console showing the newly created ephemeral user after generating credentials"><figcaption><p>In this example, an ephemeral user account has been created in the AWS IAM instance when credentials have been requested.</p></figcaption></figure>

### Fields in the STS credential record

| Field                          | Description                                                                        |
| ------------------------------ | ---------------------------------------------------------------------------------- |
| Title                          | `Temporary AWS access token - <username>`                                          |
| Login                          | The AWS username                                                                   |
| Password                       | The ephemeral account's AWS console password. Empty for existing users.            |
| `privatePEMKey` (secret field) | The STS credentials, as JSON: `accessKeyId`, `secretAccessKey`, and `sessionToken` |
| Provider                       | `aws`                                                                              |
| Notes                          | When the credentials expire                                                        |

<figure><img src="https://762006384-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MJXOXEifAmpyvNVL1to%2Fuploads%2F9jaUtfWUY3T0lGn76dKY%2FScreenshot%202026-10-30%20at%203.17.35%E2%80%AFPM.png?alt=media&amp;token=d8c7afa1-cd00-42e0-bdb7-e279bd69d927" alt=""><figcaption></figcaption></figure>

To use the credentials with the AWS CLI, set them as environment variables:

```sh
export AWS_ACCESS_KEY_ID=<accessKeyId>
export AWS_SECRET_ACCESS_KEY=<secretAccessKey>
export AWS_SESSION_TOKEN=<sessionToken>

# Confirms which AWS user you're acting as
aws sts get-caller-identity
```

### When the workflow ends

The gateway removes what it created:

* Ephemeral user: the user is deleted from AWS, and its access key and permissions go with it.
* Existing user: the gateway deletes the access key it created and takes away the JIT role or group it added. The user account, its other access keys, and anything it had before the workflow started are left alone.

### Troubleshooting

#### The user already has two access keys

AWS caps each user at two access keys. If an existing user already has two, the gateway can't add the temporary one, so credential generation fails with this error:

> Can't issue session credentials: this launch credential's AWS user is already at the maximum of 2 access keys, so a temporary access key can't be created. Remove an unused access key on that IAM user and try again.

To fix it, delete one of the user's access keys in AWS (IAM > Users > select the user > Security credentials > Access keys), then try again. Check that nothing still depends on the key before you delete it. Deactivating the key isn't enough, because AWS counts inactive keys toward the limit.

Ephemeral users don't run into this. They start with no access keys.

#### "No elevation group or role found for the resource."

The record's JIT settings don't have an AWS role or group. Add one, then generate credentials again.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.keeper.io/keeperpam/privileged-access-manager/just-in-time-access-jit/keeper-privileged-cloud/using-privileged-cloud-to-generate-aws-sts-credentials.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
