fastly_service_compute

Provides a Fastly Compute service. Compute is a computation platform capable of running custom binaries that you compile on your own systems and upload to Fastly. Security and portability is provided by compiling your code to WebAssembly using the wasm32-wasi target. A compute service encompasses Domains and Backends.

The Service resource requires a domain name that is correctly set up to direct traffic to the Fastly service. See Fastly's guide on Adding CNAME Records on their documentation site for guidance.

Example Usage

Basic usage:

data "fastly_package_hash" "example" {
  filename = "./path/to/package.tar.gz"
}

resource "fastly_service_compute" "example" {
  name = "demofastly"

  domain {
    name    = "demo.notexample.com"
    comment = "demo"
  }

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

  force_destroy = true
}

package block

The package block supports uploading or modifying Wasm packages for use in a Fastly Compute service. See Fastly's documentation on Compute

Product Enablement

The Product Enablement APIs allow customers to enable and disable specific products.

Not all customers are entitled to use these endpoints and so care needs to be given when configuring a product_enablement block in your Terraform configuration.

Consult the Product Enablement Guide to understand the internal workings for the product_enablement block.

Import

Fastly Services can be imported using their service ID, e.g.

$ terraform import fastly_service_compute.demo xxxxxxxxxxxxxxxxxxxx

By default, either the active version will be imported, or the latest version if no version is active. Alternatively, a specific version of the service can be selected by appending an @ followed by the version number to the service ID, e.g.

$ terraform import fastly_service_compute.demo xxxxxxxxxxxxxxxxxxxx@2

Schema

Required

Optional

Read-Only

Nested Schema for domain

Required:

Optional:

Nested Schema for backend

Required:

Optional:

Nested Schema for dictionary

Required:

Optional:

Read-Only:

Nested Schema for logging_bigquery

Required:

Optional:

Nested Schema for logging_blobstorage

Required:

Optional:

Nested Schema for logging_cloudfiles

Required:

Optional:

Nested Schema for logging_datadog

Required:

Optional:

Nested Schema for logging_digitalocean

Required:

Optional:

Nested Schema for logging_elasticsearch

Required:

Optional:

Nested Schema for logging_ftp

Required:

Optional:

Nested Schema for logging_gcs

Required:

Optional:

Nested Schema for logging_googlepubsub

Required:

Optional:

Nested Schema for logging_heroku

Required:

Nested Schema for logging_honeycomb

Required:

Nested Schema for logging_https

Required:

Optional:

Nested Schema for logging_kafka

Required:

Optional:

Nested Schema for logging_kinesis

Required:

Optional:

Nested Schema for logging_logentries

Required:

Optional:

Nested Schema for logging_loggly

Required:

Nested Schema for logging_logshuttle

Required:

Nested Schema for logging_newrelic

Required:

Optional:

Nested Schema for logging_openstack

Required:

Optional:

Nested Schema for logging_papertrail

Required:

Nested Schema for logging_s3

Required:

Optional:

Nested Schema for logging_scalyr

Required:

Optional:

Nested Schema for logging_sftp

Required:

Optional:

Nested Schema for logging_splunk

Required:

Optional:

Nested Schema for logging_sumologic

Required:

Optional:

Nested Schema for logging_syslog

Required:

Optional:

Nested Schema for package

Optional:

Nested Schema for product_enablement

Optional:

Required:

Read-Only: