---
layout: "fastly"
page_title: "Fastly: compute_acl"
sidebar_current: "docs-fastly-resource-compute_acl"
description: |-
  Provides a Compute Access Control List (ACL) that defines CIDR-based access rules and is accessible to Compute services during request processing.
---

# fastly_compute_acl

Provides a Compute Access Control List (ACL) that defines CIDR-based access rules (e.g., allow/block IP ranges) and is accessible to Compute services during request processing.

In order for a Compute ACL (`fastly_compute_acl`) to be accessible to a [Compute](https://developer.fastly.com/learning/compute/) service you'll first need to define a Compute service (`fastly_service_compute`) in your configuration, and then create a link to the ACL from within the service using the `resource_link` block (shown in the below examples).

## Example Usage

Basic usage:

```terraform
# IMPORTANT: Deleting a Compute ACL requires first deleting its resource_link.
# This requires a two-step `terraform apply` because we can't guarantee deletion order.

resource "fastly_compute_acl" "example" {
  name = "my_compute_acl"
}

resource "fastly_service_compute" "example" {
  name = "my_compute_service"

  domain {
    name = "demo.example.com"
  }

  package {
    filename         = "package.tar.gz"
    source_code_hash = data.fastly_package_hash.example.hash
  }

  resource_link {
    name        = "my_acl_link"
    resource_id = fastly_compute_acl.example.id
  }

  force_destroy = true
}

data "fastly_package_hash" "example" {
  filename = "package.tar.gz"
}
```

## Import

Fastly Compute ACLs can be imported using their ACL ID, e.g.

```sh
terraform import fastly_compute_acl.example <compute_acl_id>
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `name` (String) A unique name to identify the Compute ACL. It is important to note that changing this attribute will delete and recreate the Compute ACL, and discard the current entries. You MUST first delete the associated resource_link block from your service before modifying this field.

### Read-Only

- `id` (String) The ID of this resource.
