Working with config stores
- English
- 日本語
Config stores are a type of versionless container that allow you to store often repeated data as key-value pairs that can be read from the edge and shared by multiple Compute services in your account. Once linked 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 config stores via the API.
Prerequisites
Config 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.
Limitations and considerations
Before working with config stores, keep the following things in mind:
- Config stores can only be used by Compute services, not CDN (VCL-based) services.
- Trials for Compute include one config store with a maximum of 100 entries.
- Paid accounts include a minimum of five config stores (each having a maximum of 500 entries).
When working with config store keys and values, be aware of the following limitations:
- Config store keys are limited to 255 characters and their values are limited to 8,000 characters.
- Keys and their values are case-sensitive.
Creating a config store
Creating a config store requires you to create at least one key-value pair before you associate it with a service. To create a new config store and its key-value pairs, follow these steps:
Log in to the Fastly control panel.
- Go to Resources > Config stores.
- Click Create store.
- In the Store name field, enter a name for the store and then click Create.
- Click Add item.
- Enter the key and the value in the appropriate fields.
- Click Save.
- Repeat to add additional key-value pairs as necessary.
Linking config stores to a service
Once you've added at least one key-value pair to a config store, you can link it to one or more services from the Resources controls or from the service configuration for the service. Any future updates made to the store are automatically reflected on the linked services.
Using the Resources controls to link config stores to a service
To link a config store to a service from the Resources controls:
Log in to the Fastly control panel.
Go to Resources > Config stores.
Click the name of the store you want to link to a service.
From the Options menu, click Link service.
Select the checkbox next to the services you want to link to your store. Use the search box to search for services by name or ID.
Click Next.
From the version menu, select which version of the service to link to. By default, the system will assume you want to clone the most recently active version of your service. Alternatively, you can choose an existing draft version.
Select one of the following options to finish linking the store to your service:
Link only: links the store to the selected service versions but leaves any cloned or draft versions deactivated so you can activate them at a later time.
Link and activate: links the store to the selected service versions and activates those versions at the same time.
A success message appears once the store is linked to the service.
Finally, do one of the following:
- If you chose Link only, click Finish to leave the cloned or draft service versions deactivated or click Activate versions if you're now ready to activate.
- If you chose Link and activate, click Confirm and activate to activate the cloned or draft service versions linked to the store.
You can immediately start referencing the store in your edge logic.
Using the service configuration to link config stores to a service
To link a config store to a service from the service configuration:
Log in to the Fastly control panel.
From the Home page, select the appropriate service. You can use the search box to search by ID, name, or domain.
Click Edit configuration and then select the option to clone the active version.
- Click Service configuration.
- From the Linked resources options in the on-page navigation, click Config stores.
- From the Link Config Store to service menu, select the config store you want to link to the service. A success message appears once the config store is linked to the service.
Once linked, you can immediately start referencing the config store in your edge logic and activate the service when you’re ready.
Unlinking config stores
You can unlink a config store from a service from the service configuration.
To unlink a config store:
Log in to the Fastly control panel.
From the Home page, select the appropriate service. You can use the search box to search by ID, name, or domain.
- Click Service configuration.
- From the Resources options in the on-page navigation, click Config stores.
- Click Unlink from service next to the config store you want to unlink from your service.
- Click Confirm and unlink. A new, draft version of the service is created.
- Activate the service to finalize unlinking the config store.
Editing a config store
You can edit the name of a config store as well as the key-value pairs within the store from Resources > Config stores. You can also access this page by clicking Edit in Resources when accessing a config store from the service configuration.
To rename a config store:
Log in to the Fastly control panel.
- Go to Resources > Config stores.
- Click the name of the store you want to edit.
- From the Options menu, click Edit store name.
- Enter a new name for the store.
- Click Confirm and rename.
To add new key-value pairs to a config store:
Log in to the Fastly control panel.
- Go to Resources > Config stores.
- Click the name of the store you want to edit.
- Click Add item.
- Enter the key and the value in the appropriate fields.
- Click Save.
- Repeat to add additional key-value pairs as necessary.
To edit the key-value pairs within a config store:
Log in to the Fastly control panel.
- Go to Resources > Config stores.
- Click the name of the store you want to edit.
- Click the pencil to the right of the key you want to edit.
- Edit the key value as necessary.
- Click Save.
To delete the key-value pairs within a config store:
Log in to the Fastly control panel.
- Go to Resources > Config stores.
- Click the name of the store you want to edit.
- Click the trash to the right of the key you want to edit.
- Click Confirm and delete.
The changes you make will be immediately applied to your configuration including any deployed service versions associated with the config store. If you have custom logic referencing the store or keys, ensure you update them.
Deleting a config store
You can delete a config store at any time. A config store must be unlinked from any services or an error will appear if you try to delete it.
Deleting a config 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 config store:
Log in to the Fastly control panel.
- Go to Resources > Config stores.
- Click the name of the store you want to delete.
- From the Options menu, click Delete store.
- Click Confirm and delete.