---
title: table.lookup_acl
summary: null
url: >-
  https://www.fastly.com/documentation/reference/vcl/functions/table/table-lookup-acl
---

```
ACL table.lookup_acl(ID id, STRING key, ACL default)
```

**Available in:** all subroutines

Looks up the key `key` in the table `id`. When the key is present, its
associated value will be returned. When the key is absent, the `default`
value is returned. The default value is required.

## Example

```vcl
acl documents {
  "192.0.2.0"/24;
  "203.0.113.0"/24;
}

acl images {
  "198.51.100.0"/24;
  "2001:db8::"/32;
}

# fallback to disallow any file extension not explicitly listed
acl empty {
}

table ext ACL {
  "doc":  documents,
  "docx": documents,
  "pdf":  documents,

  "png":  images,
  "jpg":  images,
  "jpeg": images,
}

sub vcl_recv {
  if (client.ip !~ table.lookup_acl(ext, req.url.ext, empty)) {
      error 403;
  }
}
```
