1. Packages
  2. Fastly Provider
  3. API Docs
  4. ComputeAcl
Fastly v11.1.0 published on Wednesday, Nov 5, 2025 by Pulumi

fastly.ComputeAcl

Get Started
fastly logo
Fastly v11.1.0 published on Wednesday, Nov 5, 2025 by Pulumi

    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.ComputeAcl) to be accessible to a Compute service you’ll first need to define a Compute service (fastly.ServiceCompute) 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:

    import * as pulumi from "@pulumi/pulumi";
    import * as fastly from "@pulumi/fastly";
    
    // IMPORTANT: Deleting a Compute ACL requires first deleting its resource_link.
    // This requires a two-step `pulumi up` because we can't guarantee deletion order.
    const exampleComputeAcl = new fastly.ComputeAcl("example", {name: "my_compute_acl"});
    const example = fastly.getPackageHash({
        filename: "package.tar.gz",
    });
    const exampleServiceCompute = new fastly.ServiceCompute("example", {
        name: "my_compute_service",
        domains: [{
            name: "demo.example.com",
        }],
        "package": {
            filename: "package.tar.gz",
            sourceCodeHash: example.then(example => example.hash),
        },
        resourceLinks: [{
            name: "my_acl_link",
            resourceId: exampleComputeAcl.id,
        }],
        forceDestroy: true,
    });
    
    import pulumi
    import pulumi_fastly as fastly
    
    # IMPORTANT: Deleting a Compute ACL requires first deleting its resource_link.
    # This requires a two-step `pulumi up` because we can't guarantee deletion order.
    example_compute_acl = fastly.ComputeAcl("example", name="my_compute_acl")
    example = fastly.get_package_hash(filename="package.tar.gz")
    example_service_compute = fastly.ServiceCompute("example",
        name="my_compute_service",
        domains=[{
            "name": "demo.example.com",
        }],
        package={
            "filename": "package.tar.gz",
            "source_code_hash": example.hash,
        },
        resource_links=[{
            "name": "my_acl_link",
            "resource_id": example_compute_acl.id,
        }],
        force_destroy=True)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-fastly/sdk/v11/go/fastly"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		// IMPORTANT: Deleting a Compute ACL requires first deleting its resource_link.
    		// This requires a two-step `pulumi up` because we can't guarantee deletion order.
    		exampleComputeAcl, err := fastly.NewComputeAcl(ctx, "example", &fastly.ComputeAclArgs{
    			Name: pulumi.String("my_compute_acl"),
    		})
    		if err != nil {
    			return err
    		}
    		example, err := fastly.GetPackageHash(ctx, &fastly.GetPackageHashArgs{
    			Filename: pulumi.StringRef("package.tar.gz"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = fastly.NewServiceCompute(ctx, "example", &fastly.ServiceComputeArgs{
    			Name: pulumi.String("my_compute_service"),
    			Domains: fastly.ServiceComputeDomainArray{
    				&fastly.ServiceComputeDomainArgs{
    					Name: pulumi.String("demo.example.com"),
    				},
    			},
    			Package: &fastly.ServiceComputePackageArgs{
    				Filename:       pulumi.String("package.tar.gz"),
    				SourceCodeHash: pulumi.String(example.Hash),
    			},
    			ResourceLinks: fastly.ServiceComputeResourceLinkArray{
    				&fastly.ServiceComputeResourceLinkArgs{
    					Name:       pulumi.String("my_acl_link"),
    					ResourceId: exampleComputeAcl.ID(),
    				},
    			},
    			ForceDestroy: pulumi.Bool(true),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Fastly = Pulumi.Fastly;
    
    return await Deployment.RunAsync(() => 
    {
        // IMPORTANT: Deleting a Compute ACL requires first deleting its resource_link.
        // This requires a two-step `pulumi up` because we can't guarantee deletion order.
        var exampleComputeAcl = new Fastly.ComputeAcl("example", new()
        {
            Name = "my_compute_acl",
        });
    
        var example = Fastly.GetPackageHash.Invoke(new()
        {
            Filename = "package.tar.gz",
        });
    
        var exampleServiceCompute = new Fastly.ServiceCompute("example", new()
        {
            Name = "my_compute_service",
            Domains = new[]
            {
                new Fastly.Inputs.ServiceComputeDomainArgs
                {
                    Name = "demo.example.com",
                },
            },
            Package = new Fastly.Inputs.ServiceComputePackageArgs
            {
                Filename = "package.tar.gz",
                SourceCodeHash = example.Apply(getPackageHashResult => getPackageHashResult.Hash),
            },
            ResourceLinks = new[]
            {
                new Fastly.Inputs.ServiceComputeResourceLinkArgs
                {
                    Name = "my_acl_link",
                    ResourceId = exampleComputeAcl.Id,
                },
            },
            ForceDestroy = true,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.fastly.ComputeAcl;
    import com.pulumi.fastly.ComputeAclArgs;
    import com.pulumi.fastly.FastlyFunctions;
    import com.pulumi.fastly.inputs.GetPackageHashArgs;
    import com.pulumi.fastly.ServiceCompute;
    import com.pulumi.fastly.ServiceComputeArgs;
    import com.pulumi.fastly.inputs.ServiceComputeDomainArgs;
    import com.pulumi.fastly.inputs.ServiceComputePackageArgs;
    import com.pulumi.fastly.inputs.ServiceComputeResourceLinkArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            // IMPORTANT: Deleting a Compute ACL requires first deleting its resource_link.
            // This requires a two-step `pulumi up` because we can't guarantee deletion order.
            var exampleComputeAcl = new ComputeAcl("exampleComputeAcl", ComputeAclArgs.builder()
                .name("my_compute_acl")
                .build());
    
            final var example = FastlyFunctions.getPackageHash(GetPackageHashArgs.builder()
                .filename("package.tar.gz")
                .build());
    
            var exampleServiceCompute = new ServiceCompute("exampleServiceCompute", ServiceComputeArgs.builder()
                .name("my_compute_service")
                .domains(ServiceComputeDomainArgs.builder()
                    .name("demo.example.com")
                    .build())
                .package_(ServiceComputePackageArgs.builder()
                    .filename("package.tar.gz")
                    .sourceCodeHash(example.hash())
                    .build())
                .resourceLinks(ServiceComputeResourceLinkArgs.builder()
                    .name("my_acl_link")
                    .resourceId(exampleComputeAcl.id())
                    .build())
                .forceDestroy(true)
                .build());
    
        }
    }
    
    resources:
      # IMPORTANT: Deleting a Compute ACL requires first deleting its resource_link.
      # This requires a two-step `pulumi up` because we can't guarantee deletion order.
      exampleComputeAcl:
        type: fastly:ComputeAcl
        name: example
        properties:
          name: my_compute_acl
      exampleServiceCompute:
        type: fastly:ServiceCompute
        name: example
        properties:
          name: my_compute_service
          domains:
            - name: demo.example.com
          package:
            filename: package.tar.gz
            sourceCodeHash: ${example.hash}
          resourceLinks:
            - name: my_acl_link
              resourceId: ${exampleComputeAcl.id}
          forceDestroy: true
    variables:
      example:
        fn::invoke:
          function: fastly:getPackageHash
          arguments:
            filename: package.tar.gz
    

    Create ComputeAcl Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new ComputeAcl(name: string, args?: ComputeAclArgs, opts?: CustomResourceOptions);
    @overload
    def ComputeAcl(resource_name: str,
                   args: Optional[ComputeAclArgs] = None,
                   opts: Optional[ResourceOptions] = None)
    
    @overload
    def ComputeAcl(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   name: Optional[str] = None)
    func NewComputeAcl(ctx *Context, name string, args *ComputeAclArgs, opts ...ResourceOption) (*ComputeAcl, error)
    public ComputeAcl(string name, ComputeAclArgs? args = null, CustomResourceOptions? opts = null)
    public ComputeAcl(String name, ComputeAclArgs args)
    public ComputeAcl(String name, ComputeAclArgs args, CustomResourceOptions options)
    
    type: fastly:ComputeAcl
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args ComputeAclArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args ComputeAclArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args ComputeAclArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ComputeAclArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ComputeAclArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var computeAclResource = new Fastly.ComputeAcl("computeAclResource", new()
    {
        Name = "string",
    });
    
    example, err := fastly.NewComputeAcl(ctx, "computeAclResource", &fastly.ComputeAclArgs{
    	Name: pulumi.String("string"),
    })
    
    var computeAclResource = new ComputeAcl("computeAclResource", ComputeAclArgs.builder()
        .name("string")
        .build());
    
    compute_acl_resource = fastly.ComputeAcl("computeAclResource", name="string")
    
    const computeAclResource = new fastly.ComputeAcl("computeAclResource", {name: "string"});
    
    type: fastly:ComputeAcl
    properties:
        name: string
    

    ComputeAcl Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The ComputeAcl resource accepts the following input properties:

    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.
    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.
    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.
    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.
    name str
    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.
    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.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the ComputeAcl resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing ComputeAcl Resource

    Get an existing ComputeAcl resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: ComputeAclState, opts?: CustomResourceOptions): ComputeAcl
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            name: Optional[str] = None) -> ComputeAcl
    func GetComputeAcl(ctx *Context, name string, id IDInput, state *ComputeAclState, opts ...ResourceOption) (*ComputeAcl, error)
    public static ComputeAcl Get(string name, Input<string> id, ComputeAclState? state, CustomResourceOptions? opts = null)
    public static ComputeAcl get(String name, Output<String> id, ComputeAclState state, CustomResourceOptions options)
    resources:  _:    type: fastly:ComputeAcl    get:      id: ${id}
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    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.
    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.
    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.
    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.
    name str
    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.
    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.

    Import

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

    $ pulumi import fastly:index/computeAcl:ComputeAcl example <compute_acl_id>
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Fastly pulumi/pulumi-fastly
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the fastly Terraform Provider.
    fastly logo
    Fastly v11.1.0 published on Wednesday, Nov 5, 2025 by Pulumi
      Meet Neo: Your AI Platform Teammate