---
title: Working with secret stores
summary: null
url: >-
  https://www.fastly.com/documentation/guides/compute/edge-data-storage/working-with-secret-stores
---

Secret stores are a type of versionless container that give you a secure location to place credentials so they are available to [Compute services](https://www.fastly.com/documentation/guides/getting-started/services/working-with-compute-services) operating at the Fastly edge. Once [linked to a service](https://www.fastly.com/documentation/guides/compute/edge-data-storage/working-with-secret-stores#linking-secret-stores-to-a-service), any updates you make to the store are automatically reflected on the service without needing to increment the service's version. Changes immediately impact all service versions, including the active one.

You can also create and work with secret stores [via the API](https://www.fastly.com/documentation/reference/api/services/resources/secret-store/).

## Before you begin

Secret Store is only available for Fastly's Compute services, not for CDN (VCL-based) services.

Make sure you review the limitations for using edge data stores in the [Compute resource limits](https://docs.fastly.com/products/compute-resource-limits#edge-data-storage-limitations).

## Creating a secret store

You can create secret stores and add items to the store from the [Resources controls](https://manage.fastly.com/resources/secret-stores) or from the service configuration for a service. 

### Resources controls

To create a secret store from the Resources controls, navigate to **Resources** > [**Secret stores**](https://manage.fastly.com/resources/secret-stores), and then follow the steps below:

1. Click **Create store**.
1. In the **Store name** field, enter a name for the store and then click **Create**.

To add items to the store:

1. Click **Add item**.
1. Enter the key and the value in the appropriate fields.
1. Click **Save**.
1. Repeat to add additional key-value pairs as necessary.

### Service configuration

To create a secret store from the service configuration for a service, follow the steps below:

1. 

Log in to the [Fastly control panel](https://manage.fastly.com).

1. 

From the [**Home**](https://manage.fastly.com/home) page, select the appropriate service. You can use the search box to search by ID, name, or domain.

1. 

From the Service summary, click **Clone to edit**.

1. Click **Service configuration**.
1. From the on-page navigation, click the store type you want to create.
1. Click **Create store**.
1. In the **Store name** field, enter a name for the store and then click **Create and link**.
1. [Activate the service](https://www.fastly.com/documentation/guides/getting-started/services/working-with-compute-services#editing-and-activating-versions-of-services) to finalize linking the store.

To add items to the store:

1. Click **Add item**.
1. Enter the key and the value in the appropriate fields.
1. Click **Save**.
1. Repeat to add additional key-value pairs as necessary.

## Linking secret stores to a service

Once you've created a secret store, you can link it to one or more services from the [Resources controls](https://manage.fastly.com/resources/secret-stores) or from the service configuration for the service, creating a _resource link_. By creating a resource link, any future updates made to the store are automatically reflected on the linked services.

### Resources controls

To link a secret store to a service from the Resources controls, navigate to **Resources** > [**Secret stores**](https://manage.fastly.com/resources/secret-stores), and then follow the steps below:

1. Click the name of the store you want to link to a service.
1. Click the **Linked Services** tab.
1. Click **Link service**.
1. From the **Select a service** menu, select the service you want to link to your store. Use the search box to search for services by name or ID.
1. From the version menu, select which version of the service to link to. If you select an active version, the service will be cloned and put in a draft state.
1. In the **Resource link name** field, enter a name for your resource link. 

    > **HINT:** Use the resource link name when referencing the store in your code. This name will not change if the connected store is renamed.

1. Click **Link**.

A success message appears once the store is linked to the service. Once linked, you can immediately start referencing the store in your edge logic and [activate the service](https://www.fastly.com/documentation/guides/getting-started/services/working-with-compute-services#editing-and-activating-versions-of-services) when you're ready.

### Service configuration

To link a secret store to a service from the service configuration, navigate to the appropriate service and [clone](https://www.fastly.com/documentation/guides/getting-started/services/working-with-compute-services/#editing-and-activating-versions-of-services) the active version. Then, follow the steps below:

1. 

Log in to the [Fastly control panel](https://manage.fastly.com).

1. 

From the [**Home**](https://manage.fastly.com/home) page, select the appropriate service. You can use the search box to search by ID, name, or domain.

1. 

From the Service summary, click **Clone to edit**.

1. From the on-page navigation, click the store type you want to link to your service.
1. Click **Link store**.
1. From the **Select a service** menu, select the service you want to link to your store. Use the search box to search for services by name or ID.
1. In the **Resource link name** field, enter a name for your resource link. 

    > **HINT:** Use the resource link name when referencing the store in your code. This name will not change if the connected store is renamed.

1. Click **Save**.

A success message appears once the store is linked to the service. Once linked, you can immediately start referencing the store in your edge logic and [activate the service](https://www.fastly.com/documentation/guides/getting-started/services/working-with-compute-services#editing-and-activating-versions-of-services) when you're ready.

## Referencing resource links

When you create a store, that store has a unique *resource link name* that is separate from the store name. Once you link a store to a service, that resource link also gets a unique ID, separate from the service ID and store ID, which you can find by querying the [Resource API](https://www.fastly.com/documentation/reference/api/services/resource/). When referencing the store from your code, use the resource link name or ID, depending on your needs, not the store name. Refer to the [Resource API documentation](https://www.fastly.com/documentation/reference/api/services/resource/) for more information.

> **HINT:** It's possible to use the same name for the resource link as for the store itself. For example, you could have a store called `my-store` and also use that same name for the resource link that connects the store to each service. However, if you rename the underlying store, the name of the resource link will not change.

## Unlinking secret stores

Secret stores can only be unlinked from the service configuration. To unlink a secret store, follow the steps below:

1. 

Log in to the [Fastly control panel](https://manage.fastly.com).

1. 

From the [**Home**](https://manage.fastly.com/home) page, select the appropriate service. You can use the search box to search by ID, name, or domain.

1. 

From the Service summary, click **Clone to edit**.

1. Click **Service configuration**.
1. Click the three dots <span class="inline-icons"><img src="https://www.fastly.com/documentation/img/icons/more.png" alt="More icon" /></span> next to the store you want to unlink from your service, then click **Unlink**. 
1. Click **Unlink**. A new, draft version of the service is created.
1. [Activate the service](https://www.fastly.com/documentation/guides/getting-started/services/working-with-compute-services#editing-and-activating-versions-of-services) to finalize unlinking the store.

## Editing a secret store

You can edit the name of a secret store as well as the key-value pairs within the store from the [Resources controls](https://manage.fastly.com/resources/secret-stores) or from the service configuration for the service

### Resources controls

To edit a secret store from the Resources controls, go to **Resources** > [**Secret stores**](https://manage.fastly.com/resources/secret-stores), and then follow the steps below. You can also access this page by clicking **Edit in Resources** when accessing a secret store from the service configuration.

> **HINT:** The changes you make will be immediately applied to your configuration including any deployed service versions associated with the store. If you have custom logic referencing the store or keys, ensure you update them.

To rename a store:

> **IMPORTANT:** Changing the name of a store doesn't change the name of the resource link.

1. Click the name of the store you want to rename.
1. From the **Options** menu, click **Edit store name**.
1. Enter a new name for the store.
1. Click **Confirm and rename**.

To add new key-value pairs to a store:

1. Click the name of the store you want to edit.
1. Click **Add item**.
1. Enter the key and the value in the appropriate fields.
1. Click **Save**.
1. Repeat to add additional key-value pairs as necessary.

To edit the key value within a store:

1. Click the name of the store you want to edit.
1. Click the pencil <span class="inline-icons"><img src="https://www.fastly.com/documentation/img/icons/pencil.png" alt="Pencil icon" /></span> next to the key you want to edit.
1. Edit the key value as necessary.
1. Click **Save**.

To delete the key-value pairs within a store:

1. Click the name of the store you want to edit.
1. Click the trash <span class="inline-icons"><img src="https://www.fastly.com/documentation/img/icons/trash.png" alt="Trash icon" /></span> next to the key you want to edit.
1. Click **Confirm and delete**.

### Service configuration

To edit a secret store from the service configuration, follow the steps below:

> **HINT:** The changes you make will be immediately applied to your configuration including any deployed service versions associated with the store. If you have custom logic referencing the store or keys, ensure you update them.

To rename a resource link:

> **IMPORTANT:** Changing the name of a resource link is not the same as changing the name of the store. When you update the resource link, you must also update any code that references the old resource link name to avoid errors.

1. 

From the [**Home**](https://manage.fastly.com/home) page, select the appropriate service. You can use the search box to search by ID, name, or domain.

1. 

From the Service summary, click **Clone to edit**.

1. Click **Service configuration**.
1. From the on-page navigation, click the store type you want to edit.
1. Click the three dots <span class="inline-icons"><img src="https://www.fastly.com/documentation/img/icons/more.png" alt="More icon" /></span> next to the store you want to rename, then click **Rename resource link**. 
1. In the **Name** field, enter a new name for the resource link.
1. Click **Save**.

To add new key-value pairs to a store:

1. 

From the [**Home**](https://manage.fastly.com/home) page, select the appropriate service. You can use the search box to search by ID, name, or domain.

1. 

From the Service summary, click **Clone to edit**.

1. Click **Service configuration**.
1. From the on-page navigation, click the store type you want to edit.
1. Click the name of the store you want to edit.
1. Click **Add item**.
1. Enter the key and the value in the appropriate fields.
1. Click **Save**.
1. Repeat to add additional key-value pairs as necessary.

To edit the key value within a store:

1. 

From the [**Home**](https://manage.fastly.com/home) page, select the appropriate service. You can use the search box to search by ID, name, or domain.

1. 

From the Service summary, click **Clone to edit**.

1. Click **Service configuration**.
1. From the on-page navigation, click the store type you want to edit.
1. Click the name of the store you want to edit.
1. Click the pencil <span class="inline-icons"><img src="https://www.fastly.com/documentation/img/icons/pencil.png" alt="Pencil icon" /></span> next to the key you want to edit.
1. Edit the key value as necessary.
1. Click **Save**.

To delete the key-value pairs within a store:

1. 

From the [**Home**](https://manage.fastly.com/home) page, select the appropriate service. You can use the search box to search by ID, name, or domain.

1. 

From the Service summary, click **Clone to edit**.

1. Click **Service configuration**.
1. From the on-page navigation, click the store type you want to edit.
1. Click the name of the store you want to edit.
1. Click the trash <span class="inline-icons"><img src="https://www.fastly.com/documentation/img/icons/trash.png" alt="Trash icon" /></span> next to the key you want to edit.
1. Click **Confirm and delete**.

## Deleting a secret store

Secret stores can only be deleted from the [Resources controls](https://manage.fastly.com/resources/secret-stores). 

Before deleting a store, note the following:

* A store must be unlinked from any services or an error will appear if you try to delete it.
* Deleting a store also deletes all key-value pairs within the store. If you have custom logic referencing these keys, ensure you update them before deleting the store.

To delete a secret store, navigate to **Resources** > [**Secret stores**](https://manage.fastly.com/resources/secret-stores), and then follow the steps below.

1. Click the name of the store you want to delete.
1. From the **Options** menu, click **Delete store**.
1. Click **Confirm and delete**.

## Related content

- [Edge Data Storage](https://docs.fastly.com/products/edge-data-storage)
- [Edge Data Storage API documentation](https://www.fastly.com/documentation/reference/api/services/resources/)
- [Resource links API documentation](https://www.fastly.com/documentation/reference/api/services/resource/)
