# AutoConfig

## Overview

This topic explains AutoConfig for the Relay Proxy, which allows you to configure Relay Proxy instances automatically. 

* [AutoConfig](https://launchdarkly.com/docs/sdk/relay-proxy/automatic-configuration)  
* [Auto Config Actions](https://launchdarkly.com/docs/home/account/roles/role-actions#relay-proxy-configuration-actions)

### Custom Roles

These custom role policies allow members to create and modify LD Relay AutoConfigs. 

**All instances** 

For an LD Relay Admin type role with access to all LD Relay instances:

Here is an example:

```json
[
  {
    "effect": "allow",
    "resources": ["relay-proxy-config/*"],
    "actions": ["*"]
  }
]
```

**Specific instance by ID** 

Here is an example:

```json
[
  {
    "effect": "allow",
    "resources": ["relay-proxy-config/60be765280f9560e5cac9d4b"],
    "actions": ["*"]
  }
]
```

You can find your auto-configuration ID from the URL when editing its settings or using the API:   
![](instance-id.png)

### Using AutoConfig

**Selecting Environments**   
You can select the environments to include in a Relay Proxy configuration.  
![Selecting Environments](selecting-environments.png)

### Examples

**Production environment in all projects** 

Here is an example:

```json
[
  {
    "actions": ["*"],
    "effect": "allow",
    "resources": ["proj/*:env/production"]
  }
]
```
**Production environment in foo project** 

```json
[
  {
    "actions": ["*"],
    "effect": "allow",
    "resources": ["proj/foo:env/production"]
  }
]
```
**All environments in projects starting with foo-** 

```json
[
  {
    "actions": ["*"],
    "effect": "allow",
    "resources": ["proj/foo-*:env/*"]
  }
]
```
**Production in projects tagged "bar"** 

```json
[
  {
    "actions": ["*"],
    "effect": "allow",
    "resources": ["proj/*;bar:env/production"]
  }
]
```

**All non-production environments in any projects not tagged federal** Deny has precedence within a single policy 

```json
[
  {
    "actions": ["*"],
    "effect": "allow",
    "resources": ["proj/*:env/*"]
  },
  {
    "actions": ["*"],
    "effect": "deny",
    "resources": ["proj/*:env/production", "proj/*;federal:env/*"]
  }
]
```

<div class="page-metadata"><table class="page-metadata-table" aria-label="Page metadata"><thead><tr><th scope="col">Last modified</th><th scope="col">Last reviewed</th><th scope="col">Review due</th></tr></thead><tbody><tr><td><time datetime="2026-03-19">2026-03-19</time></td><td><time datetime="2026-02-13">2026-02-13</time></td><td><time datetime="2026-05-14">2026-05-14</time></td></tr><tr><td>Last commit: <a href="https://github.com/launchdarkly-labs/ps-flag-book/commit/d319a7d">d319a7d</a></td><td></td><td></td></tr></tbody></table></div>