> ## Documentation Index
> Fetch the complete documentation index at: https://bruno-a6972042-mintlify-c74cb75a.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Integrating AWS Secrets Manager

Bruno integrates with AWS Secrets Manager to securely fetch secrets for use in your collections. The provider is configured once in **Preferences** and can then be attached to any collection environment.

## Configuration Steps

1. Go to **Preferences** settings and navigate to the **Secrets Manager** section.

2. Click the `+ Add Secret Manager` button.

3. Select **AWS Secrets Manager** as the provider type.

4. Enter your AWS credentials:

   * **Name** - name of your secret manager account e.g: **Production Secrets**
   * **Auth Mode** - **Manual** or **AWS CLI**
     * **Manual** - enter your AWS credentials manually
     * **AWS CLI** - use your existing AWS CLI credentials
   * **Access Key ID** - your AWS Access Key ID
   * **Secret Access Key** - your AWS Secret Access Key
   * **Session Token** *(optional - required only for temporary or assumed-role credentials)*
   * **Region** *(e.g. `us-east-1`)*

5. Click **Test Connection** to verify that Bruno can reach your AWS account.

6. Click **Save** to save the secret manager configuration.

<img src="https://mintcdn.com/bruno-a6972042-mintlify-c74cb75a/gzBEQzDtiQXT21Y4/images/screenshots/v4/secret-managers/aws-preference-config.webp?fit=max&auto=format&n=gzBEQzDtiQXT21Y4&q=85&s=8be27e2c528c5a8ffad603a3a8301844" alt="aws-preference-config" width="2602" height="1276" data-path="images/screenshots/v4/secret-managers/aws-preference-config.webp" />

Once saved, the account appears in the **Secrets Manager** list and is available to select when configuring secrets on an environment.

## Exporting as a .env file

Once a provider is saved, you can export its configuration as a `.env` file directly from **Preferences** > **Secrets Manager**. This is useful for passing credentials to the Bruno CLI or seeding a CI/CD pipeline without manually transcribing values.

1. In the **Secrets Manager** list, hover over the account you want to export.
2. Click the **Export as .env** icon (the square-with-arrow icon on the right).
3. Bruno writes the credentials to a `.env` file on your machine.

<img src="https://mintcdn.com/bruno-a6972042-mintlify-c74cb75a/gzBEQzDtiQXT21Y4/images/screenshots/v4/secret-managers/export-as-env.webp?fit=max&auto=format&n=gzBEQzDtiQXT21Y4&q=85&s=2d952a946acdc2a92a89e81f3cde69d9" alt="export-as-env" width="2602" height="796" data-path="images/screenshots/v4/secret-managers/export-as-env.webp" />

<Warning>
  The exported `.env` file contains your AWS credentials in plain text. Add it to `.gitignore` immediately and never commit it to version control.
</Warning>

Pass the exported file to the CLI using the `--secrets-env-file` flag:

```bash theme={null}
bru run collection/ --env Production --secrets-env-file ./secrets.env
```

## Next Steps

* [Configure and fetch secrets](./configuring-and-fetching-secrets) — attach the provider to an environment and pull secrets into Bruno
* [Use secrets in requests](./using-secrets) — reference fetched secrets in headers, body, auth fields, and scripts
