Shared edge dictionaries



  • ryantownsend

    Thanks Andrew. Yes – I agree it would be awesome elsewhere too :slight_smile:

  • Philipp Schulte

    Hi Ryan,

    You can easily manage this with the Postman Collection I have built for the Fastly API! I recommend following the instructions of the fastly-postman repository to get started.

    First of all, I would use a dynamic snippet in order to manage your dictionary! You just need to configure your dictionary in the body for POST /service/serviceid/version/versionno/snippet:

    json { "name": "your_dictionary", "priority": "10", "dynamic": "1", "content": "table your_dictionary {\n \"one\": \"one\", \n \"two\": \"two\", \n \"three\": \"three\" \n }", "type": "init" }

    This creates the following dynamic dictionary in VCL:


    Snippet Dynamic Dictionary: 10

    table your_dictionary { "one": "one", "two": "two", "three": "three" } ```

    Clone the predefined Fasty environment for each of your services:

    bash service_id: <service_id> service_name: <service_name> version_no: <version_no>

    With this setup, you can easily switch the environment to create your dynamic dictionary on multiple services. Then you need to update the body of PUT /service/serviceid/snippet/snippetid:

    json { "content": "table your_dictionary {\n \"one\": \"one\", \n \"two\": \"two\", \n \"three\": \"three\", \n \"four\": \"four\" \n }" }

    This will update your dictionary to:


    Snippet Dynamic Dictionary: 10

    table your_dictionary { "one": "one", "two": "two", "three": "three", "four": "four" } ```

    Like before you just need to switch the environment in order to make the change to any other service and version. Don't forget to save your changes everytime you update the body of the PUT request!

    If you need to update your dictionary again you just need to open Postman and update the body of the PUT request. Then save the request infromation and send the request to all the services you want to update by selecting the proper environment.

    This concept allows you to share pretty much any configuration between all of your services! The best part is that Postman allows you to export your configuration so that anyone else can manage the dictionary if necessary!

  • ryantownsend

    Thanks Philipp, but unfortunately, we manage hundreds of services with changes to the dictionaries being made throughout the day – so this isn't something we can use Postman for in this way. We need to abstract changes to the dictionaries using our admin UI.

    What I'm trying to avoid is every time a user makes a single change to redirects in their admin panel, having to make 3 API calls to update it on 3 separate Fastly services so that the user's dev/staging/production environment stay in-sync.

    Another way to envisage this is: imagine we had an IP blacklist for known attackers, we'd want to share that list amongst all our services, but we don't want to have to replicate it individually for every one individually. We'd want all the services to reference a single master list.

Please sign in to leave a comment.