> ## Documentation Index
> Fetch the complete documentation index at: https://docs.prod.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# AWS Secrets Manager

**Who can use this feature?**\\

Organization **Owners**, **Admins**, and other users with the [`secrets:manage`](https://docs.prod.ai/admin/org-administration/org-roles/permissions) permission

Connect to your AWS Secrets Manager to securely access application secrets, API keys, and sensitive data from your Prod AI integrations. This guide covers:

* How to [**set up a new secret store**](#set-up) connected to AWS Secrets Manager
* Configuring and managing [**caching**](#caching) for your secret store to improve API performance
* [**Using secrets**](#using-secrets) throughout the Prod AI platform

### Prerequisites

To set up AWS Secrets Manager as a secret store for Prod AI you'll need:

* An AWS account with [**AWS Secrets Manager**](https://aws.amazon.com/secrets-manager/) configured
* Permission to create new IAM policies for your AWS account

## Set up

### Create IAM policy

[**Create an IAM policy**](https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access_examples.html) to grant Prod AI access to your secrets This policy should be associated with either an IAM user (for Access Key auth) or an IAM role (for Assume Role auth when self-hosting the data plane). Below is an example policy:

```json theme={null}
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "secretsmanager:GetSecretValue",
        "secretsmanager:DescribeSecret"
      ],
      "Resource": ["arn:aws:secretsmanager:${REGION}:${ACCOUNT_ID}:secret:*"]
    },
    {
      "Effect": "Allow",
      "Action": ["secretsmanager:ListSecrets"],
      "Resource": "*"
    }
  ]
}
```

We recommend only granting Prod AI access to the minimum set of secret ARN's your team will use in Prod AI. For added security, create secrets that are prefixed with `prod-ai/${env}/` to easily identify the secrets used in Prod AI.

### Configure secret store

Configure a new secret store in Prod AI:

1. Go to the **Secrets Management** page in Prod AI

2. Click the **AWS Secrets Manager** tile

3. Name your secret store integration

4. If your secrets follow [hierarchical naming conventions](https://docs.aws.amazon.com/prescriptive-guidance/latest/secure-sensitive-data-secrets-manager-terraform/naming-convention.html), specify a **Prefix** to filter secrets in this store. For example, if Prod AI secrets are all named like `prod-ai/${env}/secret1`, `prod-ai/${env}/secret2`, etc, then `prod-ai/${env}/` will be the corresponding prefix value.

5. Specify your AWS **Region**

6. Select **Auth type**

   > [tab] Access Key
   >
   > Paste the **Access key ID** and **Secret access key** for the IAM user Prod AI will act on behalf of.

   > [tab] Assume Role
   >
   > Cross-account IAM role assumption is coming soon for [Dedicated Cloud](https://docs.prod.ai/deployment/cloud-architecture.md) and [Managed BYOC](https://docs.prod.ai/deployment/cloud-prem/aws.md).
   >
   > Specify the **IAM Role ARN** that the data plane will assume via an AWS account trusted entity.

7. Configure caching rules for this store

8. Optionally, add more configurations for [different environments](https://docs.prod.ai/development-lifecycle/build/data-tags.md)

9. Click **Create**

Your secret store is now configured. Developers can now [reference secrets](https://docs.prod.ai/development-lifecycle/build/using-secrets.md) in their integration forms.

## Caching

If enabled, Prod AI can cache your secrets, reducing calls to your secrets manager and improving API performance when using secrets. Caching can be configured for each of your secret store's configurations, letting you set different policies based on the environment.

To configure caches, go to **Secrets Management** and click into your secrets store. From here you can:

* Update the **Cache TTL (seconds)** to your desired caching interval
* **Clear the cache** if you've rotated a secrets and need Prod AI to refetch secret values

![Manage secret caching](https://mintcdn.com/prod-ai/JxbdENi--_B2MRA4/images/admin/secrets-caching.png?fit=max\&auto=format\&n=JxbdENi--_B2MRA4\&q=85\&s=d5ee160ab18f2ae5edeb4faa25d5ac5a)

## Using secrets

For details on how to reference secrets in integration forms, see [Using secrets](https://docs.prod.ai/development-lifecycle/build/using-secrets.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.