LOG IN SIGN UP
Documentation

Creating and using Edge ACLs

Edge ACLs are lists of permissions that Varnish uses to grant or restrict access to URLs within your services. You can use the Fastly API to programmatically add, remove, and update Edge ACLs and their entries. To create an Edge ACL and use it within your service, you'll need to perform the following steps:

  1. Create an empty ACL in a working version of a service that's unlocked and not yet activated.
  2. Activate the new version of the service you associated with the empty ACL.
  3. Add ACL entries to the newly created ACL.

Once the ACL is created, properly associated, and filled with ACL entries, it can be called in your service.

Attributes

Edge ACLs have the following attributes:

Creating an ACL

To start using an ACL, you'll need to create an empty one within a version of a service that's unlocked and not yet activated. Make the following API call in a terminal application:

curl -H "Fastly-Key: FASTLY_KEY" -X POST https://api.fastly.com/service/<service_id>/version/<vcl_version_number>/acl -d name=my_acl

The response will look like this:

{
    "id": "<vcl_version_number>",
    "name": "my_acl",
    "service_id": "<service_id>",
    "version": "1",
    "created_at": "2016-04-14 21:23:21",
    "updated_at": "2016-04-14 21:23:21"
}

Be sure to activate the new version of the service you associated with the empty ACL.

Viewing ACLs

To see information related to a single ACL (in this example, my_acl) attached to a particular version of a service, make the following API call in a terminal application:

curl -H "Fastly-Key: FASTLY_KEY" https://api.fastly.com/service/<service_id>/version/<vcl_version_number>/acl/my_acl

The response will look like this:

{
    "id": "<acl_id>",
    "name": "my_acl",
    "service_id": "<service_id>",
    "version": "<vcl_version_number>",
    "created_at": "2016-04-14 21:23:21",
    "updated_at": "2016-04-14 21:23:21"
}

To view a list of all ACLs attached to a particular version of a service, make the following API call in a terminal application:

curl -H "Fastly-Key: FASTLY_KEY" https://api.fastly.com/service/<service_id>/version/<vcl_version_number>/acl

The response will look like this:

[
    {
        "id": "<acl_1_id>",
        "name": "my_new_acl",
        "service_id": "<service_id>",
        "version": "<vcl_version_number>",
        "created_at": "2016-04-14 21:23:21",
        "updated_at": "2016-04-15 17:23:09"
},
    {
        "id": "<acl_2_id>",
        "name": "my_other_acl",
        "service_id": "<service_id>",
        "version": "<vcl_version_number>",
        "created_at": "2016-04-14 21:23:21",
        "updated_at": "2016-04-15 17:23:09"
    }
]

Deleting an ACL

Deleting an ACL deletes the ACL and all of its associated entries. To delete an ACL (in this example, my_new_acl), make the following API call in a terminal application:

curl -H "Fastly-Key: FASTLY_KEY" -X DELETE https://api.fastly.com/service/<service_id>/version/<vcl_version_number>/acl/my_new_acl

The response will look like this:

{
  "status":"ok"
}

Additional resources:


Back to Top