Private Edge Dictionaries

Private Edge Dictionaries store dictionary items that can't be listed or read via the web interface or the API.

Limitations and considerations

When creating private Edge Dictionaries, keep the following things in mind:

  • You can create, read, update, and delete a private dictionary
  • You cannot update the write_only attribute of a dictionary
  • You can create, update, and delete items that belong to a private dictionary
  • You cannot view items that belong to a private dictionary via the API
  • Depending on how your service is configured, data stored in private Edge Dictionaries can be sent in headers and to log streaming endpoints.

Creating a private dictionary container

To use a private dictionary container, start by creating an empty one within an unlocked version of a service.

Before a private Edge Dictionary can be manipulated, its private dictionary container must be associated with at least one service version that is not locked and not active so that the service becomes aware of the private dictionary's existence.

For example, if you were creating a my_example_dictionary private dictionary via the API, you would make an API call by running this command:

1
curl -X POST -H 'Fastly-Key: FASTLY_API_TOKEN' -d 'name=my_example_dictionary&write_only=true' https://api.fastly.com/service/<service_id>/version/<version_number>/dictionary

which would return:

1
2
3
4
5
6
7
8
9
10
{
  "created_at": "2017-05-03T16:11:41+00:00",
  "deleted_at": null,
  "id": "<dictionary_id>",
  "name": "my_example_dictionary",
  "service_id": "<service_id>",
  "updated_at": "2017-05-03T16:11:41+00:00",
  "version": <version_number>,
  "write_only": true
}

You can start adding dictionary items after you've created the dictionary. Don't forget to activate the service when you're finished.

Viewing private dictionaries in VCL

The contents of private Edge Dictionaries are hidden in VCL. The private dictionary's metadata is displayed, as shown below:

1
2
3
4
5
6
table my_example_dictionary {
     # REDACTED dictionary content
     # last_updated: 2017-10-16 20:44:43
     # item_count: 2
     # digest: 8f92141234567890da30ba9cea7d98ef614
 }
Back to Top