UNPKG

@pulumi/fastly

Version:

A Pulumi package for creating and managing fastly cloud resources.. Based on terraform-provider-fastly: version v4

93 lines 3.66 kB
"use strict"; // *** WARNING: this file was generated by pulumi-language-nodejs. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.ComputeAcl = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * 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](https://developer.fastly.com/learning/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 `resourceLink` block (shown in the below examples). * * ## Example Usage * * Basic usage: * * ```typescript * 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 * * Fastly Compute ACLs can be imported using their ACL ID, e.g. * * ```sh * $ pulumi import fastly:index/computeAcl:ComputeAcl example <compute_acl_id> * ``` */ class ComputeAcl extends pulumi.CustomResource { /** * Get an existing ComputeAcl resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name, id, state, opts) { return new ComputeAcl(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of ComputeAcl. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj) { if (obj === undefined || obj === null) { return false; } return obj['__pulumiType'] === ComputeAcl.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["name"] = state?.name; } else { const args = argsOrState; resourceInputs["name"] = args?.name; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(ComputeAcl.__pulumiType, name, resourceInputs, opts); } } exports.ComputeAcl = ComputeAcl; /** @internal */ ComputeAcl.__pulumiType = 'fastly:index/computeAcl:ComputeAcl'; //# sourceMappingURL=computeAcl.js.map