Skip to content

improving-minnesota/terraform-fastly-service

Repository files navigation

Overview

Improving's terraform-fastly-service is a Terraform module to abstract select configuration features of a Fastly service via the Terraform Fastly provider. This module may not be maintained, nor fully-complete, and is provided as-is for demonstration purposes.

See examples for usage with the following example scenarios:

  • simple-service
    • Creates a Fastly service using this module, with simple configuration.
    • This example highlights the module's abstraction for simplistic use.
  • detailed-service
    • Creates a Fastly service using this module, with detailed configuration using most of the available features.
    • This example showcases split files for each available featureset, leading to a manageable approach for maintaining services.
  • multiple-environments-service
    • Creates multiple Fastly services (multiple environments - i.e. dev/prod) using this module, with detailed configuration using most of the available features
    • This example adds a shared global configuration to minimize duplication of configuration among environments, vastly simplifying multiple environments without drift of multiple codebases, while still allowing for the flexibility to modify single configurations where desired.

Implementing stored configuration via Terraform modules to drive your Fastly CDN services is only one aspect of a complete solution. Integrating CDN, WAF, certificate management, object storage, compute, bot detection, observability, security, and CICD automation all together can drive an efficient solution for your business needs. To learn more about how our customized solutions can drive your business success, reach out to us!

Development

Prerequisites

  • terraform
  • terraform-docs
  • terragrunt
  • yamllint
  • pre-commit (pre-commit install will install pre-commit hooks)

Requirements

Name Version
fastly ~> 6.1.0

Providers

Name Version
fastly ~> 6.1.0

Resources

Name Type
fastly_service_acl_entries.this resource
fastly_service_dictionary_items.this resource
fastly_service_dynamic_snippet_content.this resource
fastly_service_vcl.this resource

Inputs

Name Description Type Default Required
fastly_acls A list of ACLs to be added to the Fastly service. Each object in the list has the following attributes:
- entries (List) A list of ACL entries. Each object in the list has the following attributes:
- comment (String) A personal freeform descriptive note
- ip (String) An IP address that is the focus for the ACL
- negated (Boolean) A boolean that will negate the match if true
- subnet (String) An optional subnet mask applied to the IP address
- force_destroy (Boolean) Allow the ACL to be deleted, even if it contains entries. Defaults to false.
- manage_entries (Boolean) Whether to reapply changes if the state of the entries drifts, i.e. if entries are managed externally.
- name (String) A unique name to identify this ACL. It is important to note that changing this attribute will delete and recreate the ACL, and discard the current items in the ACL.
list(object({
entries = list(object({
comment = optional(string)
ip = string
negated = optional(bool)
subnet = optional(string)
}))
force_destroy = optional(bool, false)
manage_entries = bool
name = string
}))
[] no
fastly_activate (Boolean) Conditionally prevents new service versions from being activated. The apply step will create a new draft version but will not activate it if this is set to false. Default true bool true no
fastly_api_key The Fastly API key string n/a yes
fastly_backends A list of backends to be added to the Fastly service. Each object in the list has the following attributes:
- address (String) An IPv4, hostname, or IPv6 address for the Backend
- name (String) Name for this Backend. Must be unique to this Service. It is important to note that changing this attribute will delete and recreate the resource.
- auto_loadbalance (Boolean) Denotes if this Backend should be included in the pool of backends that requests are load balanced against. Default false
- between_bytes_timeout (Number) How long to wait between bytes in milliseconds. Default 10000
- connect_timeout (Number) How long to wait for a timeout in milliseconds. Default 1000
- error_threshold (Number) How many errors should be seen before this backend is considered unhealthy. Default 0
- first_byte_timeout (Number) How long to wait for the first byte in milliseconds. Default 15000
- healthcheck (String) The name of the healthcheck to use with this backend
- keepalive_time (Number) How long to keep a connection to the backend open in seconds. Default 60
- max_conn (Number) The maximum number of connections to the backend. Default 200
- max_tls_version (String) The maximum version of TLS the backend supports
- min_tls_version (String) The minimum version of TLS the backend supports
- override_host (String) The hostname to override the Host header
- port (Number) The port number of the address. Default 80
- request_condition (String) Name of a condition, which if met, will select this backend during a request.
- share_key (String) Value that when shared across backends will enable those backends to share the same health check.
- shield (String) The POP of the shield designated to reduce inbound load. Valid values for shield are included in the GET /datacenters API response
- ssl_ca_cert (String) CA certificate attached to origin.
- ssl_cert_hostname (String) Configure certificate validation. Does not affect SNI at all
- ssl_check_cert (Boolean) Check the backend certificate. Default true
- ssl_ciphers (String) Cipher list consisting of one or more cipher strings separated by colons. Commas or spaces are also acceptable separators but colons are normally used.
- ssl_client_cert (String) Client certificate attached to origin.
- ssl_client_key (String, Sensitive) Client key attached to origin.
- ssl_sni_hostname (String) SNI host name to use during SSL handshake. This is required when using SSL.
- use_ssl (Boolean) Use SSL for this backend. Default false
- weight (Number) Weight used to load balance this backend against others. Default 100
list(object({
address = string
auto_loadbalance = optional(bool, false)
between_bytes_timeout = optional(number, 10000)
connect_timeout = optional(number, 1000)
error_threshold = optional(number, 0)
first_byte_timeout = optional(number, 15000)
healthcheck = optional(string)
keepalive_time = optional(number, 60)
max_conn = optional(number, 200)
max_tls_version = optional(string)
min_tls_version = optional(string)
name = string
override_host = optional(string)
port = optional(number, 80)
request_condition = optional(string)
share_key = optional(string)
shield = optional(string)
ssl_ca_cert = optional(string)
ssl_cert_hostname = optional(string)
ssl_check_cert = optional(bool, true)
ssl_ciphers = optional(string)
ssl_client_cert = optional(string)
ssl_client_key = optional(string)
ssl_sni_hostname = optional(string)
use_ssl = optional(bool, false)
weight = optional(number, 100)
}))
[] no
fastly_cache_setting A list of cache settings to be added to the Fastly service. Each object in the list has the following attributes:
- action (String) One of cache, pass, or restart, as defined on Fastly's documentation under "Caching action descriptions"
- cache_condition (String) Name of already defined condition used to test whether this settings object should be used. This condition must be of type CACHE
- name (String) Unique name for this Cache Setting. It is important to note that changing this attribute will delete and recreate the resource
- stale_ttl (Number) Max "Time To Live" for stale (unreachable) objects
- ttl (Number) The Time-To-Live (TTL) for the object
list(object({
action = string
cache_condition = string
name = string
stale_ttl = optional(number)
ttl = optional(number)
}))
[] no
fastly_conditions A list of conditions to be added to the Fastly service. Each object in the list has the following attributes:
- name (String) The unique name for the condition. It is important to note that changing this attribute will delete and recreate the resource.
- priority (Number) A number used to determine the order in which multiple conditions execute. Lower numbers execute first. Default 10
- statement (String) The statement used to determine if the condition is met.
- type (String) Type of condition, either REQUEST (req), RESPONSE (req, resp), or CACHE (req, beresp).
list(object({
name = string
priority = optional(number, 10)
statement = string
type = string
}))
[] no
fastly_default_host (String) The default hostname string "" no
fastly_default_ttl (Number) The default Time-to-live (TTL) for requests number 3600 no
fastly_dictionaries A list of dictionaries to be added to the Fastly service. Each object in the list has the following attributes:
- force_destroy (Boolean) Allow the dictionary to be deleted, even if it contains entries. Defaults to false.
- items (Map of String) A map representing an entry in the dictionary, (key/value)
- manage_items (Boolean) Whether to reapply changes if the state of the items drifts, i.e. if items are managed externally.
- name (String) A unique name to identify this dictionary. It is important to note that changing this attribute will delete and recreate the dictionary, and discard the current items in the dictionary.
list(object({
force_destroy = optional(bool, false)
items = map(string)
manage_items = bool
name = string
}))
[] no
fastly_directors A list of directors to be added to the Fastly service. Each object in the list has the following attributes:
- backends (Set of String) Names of defined backends to map the Director to. Example: [ "origin1", "origin2" ]
- comment (String) A comment to describe the Director.
- name (String) Unique name for this Director. It is important to note that changing this attribute will delete and recreate the resource
- quorum (Number) Percentage of capacity that needs to be up for the director itself to be considered up. Default 75
- retries (Number) Number of retries to perform before failing over to the next backend. Default 5
- shield (String) Selected POP to serve as a "shield" for backends. Valid values for shield are included in the GET /datacenters API response
- type (Number) Type of load balance group to use. Integer, 1 to 4. Values: 1 for round-robin, 2 for random, 3 for hash, 4 for client. Default 1
list(object({
backends = set(string)
comment = optional(string)
name = string
quorum = optional(number, 75)
retries = optional(number, 5)
shield = optional(string)
type = optional(number, 1)
}))
[] no
fastly_domain_names List of domains to be added to the Fastly service.
list(object({
name = string
comment = optional(string)
}))
n/a yes
fastly_dynamic_snippets A list of dynamic VCL snippets to be added to the Fastly service. Each object in the list has the following attributes:
- content (String) The VCL code that specifies exactly what the snippet does.
- priority (Number) Priority determines the ordering for multiple snippets. Lower numbers execute first. Defaults to 100
- manage (Boolean) Whether to reapply changes if the state of the snippets drifts, i.e. if snippets are managed externally.
- name (String) A name that is unique across "regular" and "dynamic" VCL Snippet configuration blocks. It is important to note that changing this attribute will delete and recreate the resource.
- type (String) The location in generated VCL where the snippet should be placed (can be one of init, recv, hash, hit, miss, pass, fetch, error, deliver, log or none).
list(object({
content = optional(string)
priority = optional(number, 100)
manage = optional(bool, false)
name = string
type = string
}))
[] no
fastly_force_destroy (Boolean) Services that are active cannot be destroyed. In order to destroy the Service, set force_destroy to true. Default false bool false no
fastly_gzip_settings A list of gzip settings to be added to the Fastly service. Each object in the list has the following attributes:
- cache_condition (String) Name of already defined condition controlling when this gzip configuration applies. This condition must be of type CACHE.
- content_types (List of String) The content-type for each type of content you wish to have dynamically gzip'ed. Example: ["text/html", "text/css"]
- extensions (List of String) File extensions for each file type to dynamically gzip. Example: ["css", "js"]
- name (String) A name to refer to this gzip condition. It is important to note that changing this attribute will delete and recreate the resource.
list(object({
cache_condition = optional(string)
content_types = optional(list(string))
extensions = optional(list(string))
name = string
}))
[] no
fastly_headers A list of headers to be added to the Fastly service. Each object in the list has the following attributes:
- action (String) The Header manipulation action to take; must be one of set, append, delete, regex, or regex_repeat
- cache_condition (String) Name of already defined condition to apply. This condition must be of type CACHE
- destination (String) The name of the header that is going to be affected by the Action
- ignore_if_set (Boolean) Don't add the header if it is already. (Only applies to set action.). Default false
- name (String) A name to refer to this header condition. It is important to note that changing this attribute will delete and recreate the resource.
- priority (Number) Lower priorities execute first. Default: 100
- regex (String) Regular expression to use (Only applies to regex and regex_repeat actions.)
- request_condition (String) Name of already defined condition to apply. This condition must be of type REQUEST
- response_condition (String) Name of already defined condition to apply. This condition must be of type RESPONSE
- source (String) Variable to be used as a source for the header content (Does not apply to delete action.)
- substitution (String) The substitution string to use (Only applies to regex and regex_repeat actions.)
- type (String) The Request type on which to apply the selected Action; must be one of request, fetch, cache or response
list(object({
action = string
cache_condition = optional(string)
destination = string
ignore_if_set = optional(bool, false)
name = string
priority = optional(number, 100)
regex = optional(string)
request_condition = optional(string)
response_condition = optional(string)
source = optional(string)
substitution = optional(string)
type = string
}))
[] no
fastly_healthchecks A list of healthchecks to be added to the Fastly service. Each object in the list has the following attributes:
- check_interval (Number) How often to run the Healthcheck in milliseconds. Default 5000
- expected_response (Number) The status code expected from the host. Default 200
- headers (Set of String) Custom headers to send with the Healthcheck. Each header should be in the format "Header: Value". To remove all headers, first specify an empty string. Example: ["Accept: application/json", "User-Agent: fastly-healthchecks"]
- host (String) The Host header to send for this Healthcheck.
- http_version (String) Whether to use version 1.0 or 1.1 HTTP. Default 1.1
- initial (Number) When loading a config, the initial number of probes to be seen as OK. Default 3
- method (String) Which HTTP method to use. Default HEAD
- name (String) A unique name to identify this Healthcheck. It is important to note that changing this attribute will delete and recreate the resource
- path (String) The path to check
- threshold (Number) How many Healthchecks must succeed to be considered healthy. Default 3
- timeout (Number) Timeout in milliseconds. Default 5000
- window (Number) The number of most recent Healthcheck queries to keep for this Healthcheck. Default 5
list(object({
check_interval = optional(number, 5000)
expected_response = optional(number, 200)
headers = optional(set(string))
host = string
http_version = optional(string, "1.1")
initial = optional(number, 3)
method = optional(string, "HEAD")
name = string
path = string
threshold = optional(number, 3)
timeout = optional(number, 5000)
window = optional(number, 5)
}))
[] no
fastly_http3 (Boolean) Enables support for the HTTP/3 (QUIC) protocol. Default true bool true no
fastly_image_optimizers A single-item list of settings for the image optimizer to be added to the Fastly service. Each object in the list has the following attributes:
- allow-video (Boolean) Enables GIF to MP4 transformations on this service.
- jpeg_quality (Number) The default quality to use with JPEG output. This can be overridden with the "quality" parameter on specific image optimizer requests.
- jpeg_type (String) The default type of JPEG output to use. This can be overridden with "format=bjpeg" and "format=pjpeg" on specific image optimizer requests. Valid values are auto, baseline and progressive.
- auto: Match the input JPEG type, or baseline if transforming from a non-JPEG input.
- baseline: Output baseline JPEG images
- progressive: Output progressive JPEG images
- name (String) Used by the provider to identify modified settings. Changing this value will force the entire block to be deleted, then recreated.
- resize_filter (String) The type of filter to use while resizing an image. Valid values are lanczos3, lanczos2, bicubic, bilinear and nearest.
- lanczos3: A Lanczos filter with a kernel size of 3. Lanczos filters can detect edges and linear features within an image, providing the best possible reconstruction.
- lanczos2: A Lanczos filter with a kernel size of 2.
- bicubic: A filter using an average of a 4x4 environment of pixels, weighing the innermost pixels higher.
- bilinear: A filter using an average of a 2x2 environment of pixels.
- nearest: A filter using the value of nearby translated pixel values. Preserves hard edges.
- upscale (Boolean) Whether or not we should allow output images to render at sizes larger than input.
- webp (Boolean) Controls whether or not to default to WebP output when the client supports it. This is equivalent to adding "auto=webp" to all image optimizer requests.
- webp_quality (Number) The default quality to use with WebP output. This can be overridden with the second option in the "quality" URL parameter on specific image optimizer requests.
list(object({
allow_video = optional(bool)
jpeg_quality = optional(number)
jpeg_type = optional(string)
name = string
resize_filter = optional(string)
upscale = optional(bool)
webp = optional(bool)
webp_quality = optional(number)
}))
[] no
fastly_logging_bigquery A list of logging BigQuery settings to be added to the Fastly service. Each object in the list has the following attributes:
- account_name (String) The google account name used to obtain temporary credentials (default none). You may optionally provide this via an environment variable, FASTLY_GCS_ACCOUNT_NAME.
- dataset (String) The ID of your BigQuery dataset.
- format (String) The logging format desired.
- name (String) A unique name to identify this BigQuery logging endpoint. It is important to note that changing this attribute will delete and recreate the resource.
- placement (String) Where in the generated VCL the logging call should be placed.
- project_id (String) The ID of your GCP project.
- response_condition (String) Name of a condition to apply this logging.
- table (String) The ID of your BigQuery table.
- template (String) BigQuery table name suffix template.
list(object({
account_name = optional(string)
dataset = string
format = optional(string)
name = string
placement = optional(string)
project_id = string
response_condition = optional(string)
table = string
template = optional(string)
}))
[] no
fastly_logging_bigquery_email (String, Sensitive) The email for the service account with write access to your BigQuery dataset. If not provided, this will be pulled from a FASTLY_BQ_EMAIL environment variable. string "" no
fastly_logging_bigquery_secret_key (String, Sensitive) The secret key associated with the service account that has write access to your BigQuery table. If not provided, this will be pulled from the FASTLY_BQ_SECRET_KEY environment variable. Typical format for this is a private key in a string with newlines. string "" no
fastly_logging_blobstorage A list of logging Azure Blob Storage settings to be added to the Fastly service. Each object in the list has the following attributes:
- account_name (String) The unique Azure Blob Storage namespace in which your data objects are stored.
- compression_codec (String) The codec used for compression of your logs. Valid values are zstd, snappy, and gzip. If the specified codec is "gzip", gzip_level will default to 3. To specify a different level, leave compression_codec blank and explicitly set the level using gzip_level. Specifying both compression_codec and gzip_level in the same API request will result in an error.
- container (String) The name of the Azure Blob Storage container in which to store logs.
- file_max_bytes (String) Maximum size of an uploaded log file, if non-zero.
- format (String) Apache-style string or VCL variables to use for log formatting Default: %h %l %u %t "%r" %>s %b
- format_version (String) The version of the custom logging format used for the configured endpoint. Can be either 1 or 2. Default 2
- gzip_level (String) Level of Gzip compression from 0-9. 0 means no compression. 1 is the fastest and the least compressed version, 9 is the slowest and the most compressed version. Default 0
- message_type (String) How the message should be formatted. Can be either classic, loggly, logplex or blank. Default is classic
- name (String) A unique name to identify the Azure Blob Storage endpoint. It is important to note that changing this attribute will delete and recreate the resource.
- path (String) The path to upload logs to. Must end with a trailing slash. If this field is left empty, the files will be saved in the container's root path.
- period (String) How frequently the logs should be transferred in seconds. Default 3600.
- placement (String) Where in the generated VCL the logging call should be placed.
- public_key (String) A PGP public key that Fastly will use to encrypt your log files before writing them to disk.
- response_condition (String) The name of the condition to apply.
- timestamp_format (String) The strftime specified timestamp formatting. Default: %Y-%m-%dT%H:%M:%S.000
list(object({
account_name = string
compression_codec = optional(string)
container = string
file_max_bytes = optional(number)
format = string
format_version = optional(number)
gzip_level = optional(number)
message_type = optional(string)
name = string
path = optional(string)
period = optional(number)
placement = optional(string)
public_key = optional(string)
response_condition = optional(string)
timestamp_format = optional(string)
}))
[] no
fastly_logging_blobstorage_sas_token (String, Sensitive) The Azure shared access signature providing write access to the blob service objects. Be sure to update your token before it expires or the logging functionality will not work. string "" no
fastly_logging_cloudfiles A list of logging Cloud Files settings to be added to the Fastly service. Each object in the list has the following attributes:
- bucket_name (String) The name of your Cloud Files container.
- compression_codec (String) The codec used for compression of your logs. Valid values are zstd, snappy, and gzip. If the specified codec is "gzip", gzip_level will default to 3. To specify a different level, leave compression_codec blank and explicitly set the level using gzip_level. Specifying both compression_codec and gzip_level in the same API request will result in an error.
- format (String) Apache style log formatting.
- format_version (Number) The version of the custom logging format used for the configured endpoint. Can be either 1 or 2. Default 2
- gzip_level (Number) Level of Gzip compression from 0-9. 0 means no compression. 1 is the fastest and the least compressed version, 9 is the slowest and the most compressed version. Default 0
- message_type (String) How the message should be formatted. Can be either classic, loggly, logplex or blank. Default is classic
- name (String) The unique name of the Rackspace Cloud Files logging endpoint. It is important to note that changing this attribute will delete and recreate the resource.
- path (String) The path to upload logs to.
- period (Number) How frequently log files are finalized so they can be available for reading in seconds. Default 3600
- placement (String) Where in the generated VCL the logging call should be placed. Can be none or none.
- public_key (String) The PGP public key that Fastly will use to encrypt your log files before writing them to disk.
- region (String) The region to stream logs to. One of: DFW (Dallas), ORD (Chicago), IAD (Northern Virginia), LON (London), SYD (Sydney), HKG (Hong Kong).
- response_condition (String) The name of an existing condition in the configured endpoint, or leave blank to always execute.
- timestamp_format (String) The strftime specified timestamp formatting. Default: %Y-%m-%dT%H:%M:%S.000
- user (String) The username for your Cloud Files account.
list(object({
bucket_name = string
compression_codec = optional(string)
format = optional(string)
format_version = optional(number)
gzip_level = optional(number)
message_type = optional(string)
name = string
path = optional(string)
period = optional(number)
placement = optional(string)
public_key = optional(string)
region = optional(string)
response_condition = optional(string)
timestamp_format = optional(string)
user = string
}))
[] no
fastly_logging_cloudfiles_access_key (String, Sensitive) Your Cloud File account access key. string "" no
fastly_logging_datadog A list of logging Datadog settings to be added to the Fastly service. Each object in the list has the following attributes:
- format (String) Apache-style string or VCL variables to use for log formatting.
- format_version (Number) The version of the custom logging format used for the configured endpoint. Can be either 1 or 2. Default 2
- name (String) The unique name of the Datadog logging endpoint. It is important to note that changing this attribute will delete and recreate the resource.
- placement (String) Where in the generated VCL the logging call should be placed.
- region (String) The region that log data will be sent to. One of US or EU. Default US
- response_condition (String) The name of the condition to apply.
list(object({
format = optional(string)
format_version = optional(number)
name = string
placement = optional(string)
region = optional(string)
response_condition = optional(string)
}))
[] no
fastly_logging_datadog_token (String, Sensitive) The API key from your Datadog account. string "" no
fastly_logging_digitalocean A list of logging DigitalOcean settings to be added to the Fastly service. Each object in the list has the following attributes:
- bucket_name (String) The name of the DigitalOcean Space.
- compression_codec (String) The codec used for compression of your logs. Valid values are zstd, snappy, and gzip. If the specified codec is "gzip", gzip_level will default to 3. To specify a different level, leave compression_codec blank and explicitly set the level using gzip_level. Specifying both compression_codec and gzip_level in the same API request will result in an error.
- domain (String) The domain of the DigitalOcean Spaces endpoint Default: nyc3.digitaloceanspaces.com
- format (String) Apache style log formatting.
- format_version (Number) The version of the custom logging format used for the configured endpoint. Can be either 1 or 2. Default 2
- gzip_level (Number) Level of Gzip compression from 0-9. 0 means no compression. 1 is the fastest and the least compressed version, 9 is the slowest and the most compressed version. Default 0
- message_type (String) How the message should be formatted. Can be either classic, loggly, logplex or blank. Default is classic
- name (String) The unique name of the DigitalOcean Spaces logging endpoint. It is important to note that changing this attribute will delete and recreate the resource.
- path (String) The path to upload logs to.
- period (Number) How frequently log files are finalized so they can be available for reading in seconds. Default 3600
- placement (String) Where in the generated VCL the logging call should be placed. Can be none or none.
- public_key (String) A PGP public key that Fastly will use to encrypt your log files before writing them to disk.
- response_condition (String) The name of an existing condition in the configured endpoint, or leave blank to always execute.
- timestamp_format (String) The strftime specified timestamp formatting Default: %Y-%m-%dT%H:%M:%S.000
list(object({
bucket_name = string
compression_codec = optional(string)
domain = optional(string)
format = optional(string)
format_version = optional(number)
gzip_level = optional(number)
message_type = optional(string)
name = string
path = optional(string)
period = optional(number)
placement = optional(string)
public_key = optional(string)
response_condition = optional(string)
timestamp_format = optional(string)
}))
[] no
fastly_logging_digitalocean_access_key (String, Sensitive) Your DigitalOcean Spaces account access key. string "" no
fastly_logging_digitalocean_secret_key (String, Sensitive) Your DigitalOcean Spaces account secret key. string "" no
fastly_logging_elasticsearch A list of logging Elasticsearch settings to be added to the Fastly service. Each object in the list has the following attributes:
- format (String) Apache-style string or VCL variables to use for log formatting.
- format_version (Number) The version of the custom logging format used for the configured endpoint. Can be either 1 or 2. Default 2
- index (String) The name of the Elasticsearch index to send documents (logs) to.
- name (String) The unique name of the Elasticsearch logging endpoint. It is important to note that changing this attribute will delete and recreate the resource.
- pipeline (String) The ID of the Elasticsearch ingest pipeline to apply pre-process transformations to before indexing.
- placement (String) Where in the generated VCL the logging call should be placed.
- request_max_bytes (Number) The maximum number of logs sent in one request. Defaults to 0 for unbounded.
- request_max_entries (Number) The maximum number of bytes sent in one request. Defaults to 0 for unbounded.
- response_condition (String) The name of the condition to apply.
- tls_ca_cert (String) secure certificate to authenticate the server with. Must be in PEM format.
- tls_client_cert (String) The client certificate used to make authenticated requests. Must be in PEM format.
- tls_hostname (String) The hostname used to verify the server's certificate. It can either be the Common Name (CN) or a Subject Alternative Name (SAN).
- url (String) The Elasticsearch URL to stream logs to.
- user (String) BasicAuth username for Elasticsearch.
list(object({
format = optional(string)
format_version = optional(number)
index = string
name = string
pipeline = optional(string)
placement = optional(string)
request_max_bytes = optional(number)
request_max_entries = optional(number)
response_condition = optional(string)
tls_ca_cert = optional(string)
tls_client_cert = optional(string)
tls_hostname = optional(string)
url = string
user = optional(string)
}))
[] no
fastly_logging_elasticsearch_password (String, Sensitive) BasicAuth password for Elasticsearch. string "" no
fastly_logging_elasticsearch_tls_client_key (String, Sensitive) The client private key used to make authenticated requests. Must be in PEM format. string "" no
fastly_logging_ftp A list of logging FTP settings to be added to the Fastly service. Each object in the list has the following attributes:
- address (String) The FTP address to stream logs to.
- compression_codec (String) The codec used for compression of your logs. Valid values are zstd, snappy, and gzip. If the specified codec is "gzip", gzip_level will default to 3. To specify a different level, leave compression_codec blank and explicitly set the level using gzip_level. Specifying both compression_codec and gzip_level in the same API request will result in an error.
- format (String) Apache-style string or VCL variables to use for log formatting.
- format_version (Number) The version of the custom logging format used for the configured endpoint. Can be either 1 or 2. Default 2
- gzip_level (Number) Level of Gzip compression from 0-9. 0 means no compression. 1 is the fastest and the least compressed version, 9 is the slowest and the most compressed version. Default 0
- message_type (String) How the message should be formatted. Can be either classic, loggly, logplex or blank. Default is classic
- name (String) The unique name of the FTP logging endpoint. It is important to note that changing this attribute will delete and recreate the resource.
- path (String) The path to upload log files to. If the path ends in / then it is treated as a directory.
- period (Number) How frequently the logs should be transferred, in seconds. Default 3600
- placement (String) Where in the generated VCL the logging call should be placed.
- port (Number) The port number. Default 21
- public_key (String) The PGP public key that Fastly will use to encrypt your log files before writing them to disk.
- response_condition (String) The name of the condition to apply.
- timestamp_format (String) The strftime specified timestamp formatting. Default: %Y-%m-%dT%H:%M:%S.000
- user (String) The username for the server (can be anonymous).
list(object({
address = string
compression_codec = optional(string)
format = optional(string)
format_version = optional(number)
gzip_level = optional(number)
message_type = optional(string)
name = string
path = string
period = optional(number)
placement = optional(string)
port = optional(number)
public_key = optional(string)
response_condition = optional(string)
timestamp_format = optional(string)
user = string
}))
[] no
fastly_logging_ftp_password (String, Sensitive) The password for the server (for anonymous use an email address). string "" no
fastly_logging_gcs A list of logging GCS settings to be added to the Fastly service. Each object in the list has the following attributes:
- account_name (String) The google account name used to obtain temporary credentials (default none). You may optionally provide this via an environment variable, FASTLY_GCS_ACCOUNT_NAME.
- bucket_name (String) The name of the bucket in which to store the logs
- compression_codec (String) The codec used for compression of your logs. Valid values are zstd, snappy, and gzip. If the specified codec is "gzip", gzip_level will default to 3. To specify a different level, leave compression_codec blank and explicitly set the level using gzip_level. Specifying both compression_codec and gzip_level in the same API request will result in an error.
- format (String) Apache-style string or VCL variables to use for log formatting
- format_version (Number) The version of the custom logging format used for the configured endpoint. Can be either 1 or 2. (Default: 2)
- gzip_level (Number) Level of Gzip compression from 0-9. 0 means no compression. 1 is the fastest and the least compressed version, 9 is the slowest and the most compressed version. Default 0
- message_type (String) How the message should be formatted. Can be either classic, loggly, logplex or blank. Default is classic
- name (String) A unique name to identify this GCS endpoint. It is important to note that changing this attribute will delete and recreate the resource
- path (String) Path to store the files. Must end with a trailing slash. If this field is left empty, the files will be saved in the bucket's root path
- period (Number) How frequently the logs should be transferred, in seconds (Default 3600)
- placement (String) Where in the generated VCL the logging call should be placed.
- project_id (String) The ID of your Google Cloud Platform project
- response_condition (String) Name of a condition to apply this logging.
- secret_key (String, Sensitive) The secret key associated with the target gcs bucket on your account. You may optionally provide this secret via an environment variable, FASTLY_GCS_SECRET_KEY. A typical format for the key is PEM format, containing actual newline characters where required
- timestamp_format (String) The strftime specified timestamp formatting (default %Y-%m-%dT%H:%M:%S.000)
- user (String) Your Google Cloud Platform service account email address. The client_email field in your service account authentication JSON. You may optionally provide this via an environment variable, FASTLY_GCS_EMAIL.
list(object({
account_name = optional(string)
bucket_name = string
compression_codec = optional(string)
format = optional(string)
format_version = optional(number)
gzip_level = optional(number)
message_type = optional(string)
name = string
path = optional(string)
period = optional(number)
placement = optional(string)
project_id = optional(string)
response_condition = optional(string)
timestamp_format = optional(string)
user = optional(string)
}))
[] no
fastly_logging_gcs_secret_key (String, Sensitive) The secret key associated with the target gcs bucket on your account. You may optionally provide this secret via an environment variable, FASTLY_GCS_SECRET_KEY. A typical format for the key is PEM format, containing actual newline characters where required. string "" no
fastly_logging_googlepubsub A list of logging Google Cloud Pub/Sub settings to be added to the Fastly service. Each object in the list has the following attributes:
- account_name (String) The google account name used to obtain temporary credentials (default none). You may optionally provide this via an environment variable, FASTLY_GCS_ACCOUNT_NAME.
- format (String) Apache style log formatting.
- format_version (Number) The version of the custom logging format used for the configured endpoint. Can be either 1 or 2. (default: 2).
- name (String) The unique name of the Google Cloud Pub/Sub logging endpoint. It is important to note that changing this attribute will delete and recreate the resource
- placement (String) Where in the generated VCL the logging call should be placed.
- project_id (String) The ID of your Google Cloud Platform project
- response_condition (String) The name of an existing condition in the configured endpoint, or leave blank to always execute.
- topic (String) The Google Cloud Pub/Sub topic to which logs will be published
- user (String) Your Google Cloud Platform service account email address. The client_email field in your service account authentication JSON. You may optionally provide this via an environment variable, FASTLY_GOOGLE_PUBSUB_EMAIL.
list(object({
account_name = optional(string)
format = optional(string)
format_version = optional(number)
name = string
placement = optional(string)
project_id = string
response_condition = optional(string)
topic = string
user = optional(string)
}))
[] no
fastly_logging_googlepubsub_secret_key (String, Sensitive) Your Google Cloud Platform account secret key. The private_key field in your service account authentication JSON. You may optionally provide this secret via an environment variable, FASTLY_GOOGLE_PUBSUB_SECRET_KEY. string "" no
fastly_logging_grafanacloudlogs A list of logging GrafanaCloudLogs settings to be added to the Fastly service. Each object in the list has the following attributes:
- format (String) Apache-style string or VCL variables to use for log formatting.
- format_version (Number) The version of the custom logging format used for the configured endpoint. Can be either 1 or 2. (default: 2).
- index (String) The stream identifier as a JSON string
- name (String) The unique name of the GrafanaCloudLogs logging endpoint. It is important to note that changing this attribute will delete and recreate the resource
- placement (String) Where in the generated VCL the logging call should be placed.
- response_condition (String) The name of the condition to apply.
- token (String, Sensitive) The Access Policy Token key for your GrafanaCloudLogs account
- url (String) The URL to stream logs to
- user (String) The Grafana User ID
list(object({
format = optional(string)
format_version = optional(number)
index = string
name = string
placement = optional(string)
response_condition = optional(string)
url = string
user = string
}))
[] no
fastly_logging_grafanacloudlogs_token (String, Sensitive) The Access Policy Token key for your GrafanaCloudLogs account. string "" no
fastly_logging_heroku A list of logging Heroku settings to be added to the Fastly service. Each object in the list has the following attributes:
- format (String) Apache-style string or VCL variables to use for log formatting.
- format_version (Number) The version of the custom logging format used for the configured endpoint. Can be either 1 or 2. (default: 2).
- name (String) The unique name of the Heroku logging endpoint. It is important to note that changing this attribute will delete and recreate the resource
- placement (String) Where in the generated VCL the logging call should be placed. Can be none or none.
- response_condition (String) The name of an existing condition in the configured endpoint, or leave blank to always execute.
- url (String) The URL to stream logs to
list(object({
format = optional(string)
format_version = optional(number)
name = string
placement = optional(string)
response_condition = optional(string)
url = string
}))
[] no
fastly_logging_heroku_token (String, Sensitive) The token to use for authentication (https://www.heroku.com/docs/customer-token-authentication-token/) string "" no
fastly_logging_honeycomb A list of logging Honeycomb settings to be added to the Fastly service. Each object in the list has the following attributes:
- dataset (String) The Honeycomb Dataset you want to log to
- format (String) Apache style log formatting. Your log must produce valid JSON that Honeycomb can ingest.
- format_version (Number) The version of the custom logging format used for the configured endpoint. Can be either 1 or 2. (default: 2).
- name (String) The unique name of the Honeycomb logging endpoint. It is important to note that changing this attribute will delete and recreate the resource
- placement (String) Where in the generated VCL the logging call should be placed. Can be none or none.
- response_condition (String) The name of an existing condition in the configured endpoint, or leave blank to always execute.
list(object({
dataset = string
format = optional(string)
format_version = optional(number)
name = string
placement = optional(string)
response_condition = optional(string)
}))
[] no
fastly_logging_honeycomb_token (String, Sensitive) The Write Key from the Account page of your Honeycomb account. string "" no
fastly_logging_https A list of logging HTTPS settings to be added to the Fastly service. Each object in the list has the following attributes:
- content_type (String) Value of the Content-Type header sent with the request
- format (String) Apache-style string or VCL variables to use for log formatting.
- format_version (Number) The version of the custom logging format used for the configured endpoint. Can be either 1 or 2. (default: 2)
- header_name (String) Custom header sent with the request
- header_value (String) Value of the custom header sent with the request
- json_format (String) Formats log entries as JSON. Can be either disabled (0), array of json (1), or newline delimited json (2)
- message_type (String) How the message should be formatted. Can be either classic, loggly, logplex or blank. Default is classic
- method (String) HTTP method used for request. Can be either POST or PUT. Default POST
- name (String) The unique name of the HTTPS logging endpoint. It is important to note that changing this attribute will delete and recreate the resource
- placement (String) Where in the generated VCL the logging call should be placed
- request_max_bytes (Number) The maximum number of bytes sent in one request
- request_max_entries (Number) The maximum number of logs sent in one request
- response_condition (String) The name of the condition to apply
- tls_ca_cert (String) A secure certificate to authenticate the server with. Must be in PEM format
- tls_client_cert (String) The client certificate used to make authenticated requests. Must be in PEM format
- tls_hostname (String) Used during the TLS handshake to validate the certificate
- url (String) URL that log data will be sent to. Must use the https protocol
list(object({
content_type = optional(string)
format = optional(string)
format_version = optional(number)
header_name = optional(string)
header_value = optional(string)
json_format = optional(number)
message_type = optional(string)
method = optional(string)
name = string
placement = optional(string)
request_max_bytes = optional(number)
request_max_entries = optional(number)
response_condition = optional(string)
tls_ca_cert = optional(string)
tls_client_cert = optional(string)
tls_hostname = optional(string)
url = string
}))
[] no
fastly_logging_https_tls_client_key (String, Sensitive) The client private key used to make authenticated requests. Must be in PEM format. string "" no
fastly_logging_kafka A list of logging Kafka settings to be added to the Fastly service. Each object in the list has the following attributes:
- auth_method (String) SASL authentication method. One of: plain, scram-sha-256, scram-sha-512
- brokers (String) A comma-separated list of IP addresses or hostnames of Kafka brokers
- compression_codec (String) The codec used for compression of your logs. One of: gzip, snappy, lz4
- format (String) Apache style log formatting.
- format_version (Number) The version of the custom logging format used for the configured endpoint. Can be either 1 or 2. (default: 2).
- name (String) The unique name of the Kafka logging endpoint. It is important to note that changing this attribute will delete and recreate the resource
- parse_log_keyvals (Boolean) Enables parsing of key=value tuples from the beginning of a logline, turning them into record headers
- placement (String) Where in the generated VCL the logging call should be placed.
- request_max_bytes (Number) Maximum size of log batch, if non-zero. Defaults to 0 for unbounded
- required_acks (String) The Number of acknowledgements a leader must receive before a write is considered successful. One of: 1 (default) One server needs to respond. 0 No servers need to respond. -1 Wait for all in-sync replicas to respond
- response_condition (String) The name of an existing condition in the configured endpoint, or leave blank to always execute.
- tls_ca_cert (String) A secure certificate to authenticate the server with. Must be in PEM format
- tls_client_cert (String) The client certificate used to make authenticated requests. Must be in PEM format
- tls_hostname (String) The hostname used to verify the server's certificate. It can either be the Common Name or a Subject Alternative Name (SAN)
- topic (String) The Kafka topic to send logs to
- use_tls (Boolean) Whether to use TLS for secure logging. Can be either true or false
- user (String) SASL User
list(object({
auth_method = optional(string)
brokers = string
compression_codec = optional(string)
format = optional(string)
format_version = optional(number)
name = string
parse_log_keyvals = optional(bool)
placement = optional(string)
request_max_bytes = optional(number)
required_acks = optional(string)
response_condition = optional(string)
tls_ca_cert = optional(string)
tls_client_cert = optional(string)
tls_hostname = optional(string)
topic = string
use_tls = optional(bool)
user = optional(string)
}))
[] no
fastly_logging_kafka_password (String, Sensitive) SASL Password used to authenticate with the Kafka brokers. string "" no
fastly_logging_kafka_tls_client_key (String, Sensitive) The client private key used to make authenticated requests. Must be in PEM format. string "" no
fastly_logging_kinesis A list of logging Kinesis settings to be added to the Fastly service. Each object in the list has the following attributes:
- access_key (String, Sensitive) The AWS access key to be used to write to the stream
- format (String) Apache style log formatting.
- format_version (Number) The version of the custom logging format used for the configured endpoint. Can be either 1 or 2. (default: 2).
- iam_role (String) The Amazon Resource Name (ARN) for the IAM role granting Fastly access to Kinesis. Not required if access_key and secret_key are provided.
- name (String) The unique name of the Kinesis logging endpoint. It is important to note that changing this attribute will delete and recreate the resource
- placement (String) Where in the generated VCL the logging call should be placed. Can be none or none.
- region (String) The AWS region the stream resides in. (Default: us-east-1)
- response_condition (String) The name of an existing condition in the configured endpoint, or leave blank to always execute.
- secret_key (String, Sensitive) The AWS secret access key to authenticate with
- topic (String) The Kinesis stream name
list(object({
access_key = optional(string)
format = optional(string)
format_version = optional(number)
iam_role = optional(string)
name = string
placement = optional(string)
region = optional(string)
response_condition = optional(string)
topic = string
}))
[] no
fastly_logging_kinesis_access_key (String, Sensitive) The AWS access key to be used to write to the stream (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html). string "" no
fastly_logging_kinesis_secret_key (String, Sensitive) The AWS secret access key to authenticate with (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html). string "" no
fastly_logging_logentries A list of logging Logentries settings to be added to the Fastly service. Each object in the list has the following attributes:
- name (String) The unique name of the Logentries logging endpoint. It is important to note that changing this attribute will delete and recreate the resource
- format (String) Apache-style string or VCL variables to use for log formatting
- format_version (Number) The version of the custom logging format used for the configured endpoint. Can be either 1 or 2. (Default: 2)
- placement (String) Where in the generated VCL the logging call should be placed.
- port (Number) The port number configured in Logentries
- response_condition (String) Name of blockAttributes condition to apply this logging.
- use_tls (Boolean) Whether to use TLS for secure logging
list(object({
name = string
format = optional(string)
format_version = optional(number)
placement = optional(string)
port = optional(number)
response_condition = optional(string)
use_tls = optional(bool)
}))
[] no
fastly_logging_logentries_token token (String) Use token based authentication (https://logentries.com/doc/input-token/). string "" no
fastly_logging_loggly A list of logging Loggly settings to be added to the Fastly service. Each object in the list has the following attributes:
- format (String) Apache-style string or VCL variables to use for log formatting.
- format_version (Number) The version of the custom logging format used for the configured endpoint. Can be either 1 or 2. (default: 2).
- name (String) The unique name of the Loggly logging endpoint. It is important to note that changing this attribute will delete and recreate the resource
- placement (String) Where in the generated VCL the logging call should be placed. Can be none or none.
- response_condition (String) The name of an existing condition in the configured endpoint, or leave blank to always execute.
list(object({
format = optional(string)
format_version = optional(number)
name = string
placement = optional(string)
response_condition = optional(string)
}))
[] no
fastly_logging_loggly_token (String, Sensitive) The token to use for authentication (https://www.loggly.com/docs/customer-token-authentication-token/). string "" no
fastly_logging_logshuttle A list of logging Log Shuttle settings to be added to the Fastly service. Each object in the list has the following attributes:
- format (String) Apache style log formatting.
- format_version (Number) The version of the custom logging format used for the configured endpoint. Can be either 1 or 2. (default: 2).
- name (String) The unique name of the Log Shuttle logging endpoint. It is important to note that changing this attribute will delete and recreate the resource
- placement (String) Where in the generated VCL the logging call should be placed. Can be none or none.
- response_condition (String) The name of an existing condition in the configured endpoint, or leave blank to always execute.
- url (String) Your Log Shuttle endpoint URL
list(object({
format = optional(string)
format_version = optional(number)
name = string
placement = optional(string)
response_condition = optional(string)
url = string
}))
[] no
fastly_logging_logshuttle_token (String, Sensitive) The data authentication token associated with this endpoint (https://www.fastly.com/documentation/log-shuttle/). string "" no
fastly_logging_newrelic A list of logging New Relic settings to be added to the Fastly service. Each object in the list has the following attributes:
- format (String) Apache style log formatting. Your log must produce valid JSON that New Relic Logs can ingest.
- format_version (Number) The version of the custom logging format used for the configured endpoint. Can be either 1 or 2. (default: 2).
- name (String) The unique name of the New Relic logging endpoint. It is important to note that changing this attribute will delete and recreate the resource
- placement (String) Where in the generated VCL the logging call should be placed.
- region (String) The region that log data will be sent to. Default: US
- response_condition (String) The name of the condition to apply.
list(object({
format = optional(string)
format_version = optional(number)
name = string
placement = optional(string)
region = optional(string)
response_condition = optional(string)
}))
[] no
fastly_logging_newrelic_token (String, Sensitive) The Insert API key from the Account page of your New Relic account (https://docs.newrelic.com/docs/logs/logging-api/logging-api-keys/insert-api-key/). string "" no
fastly_logging_newrelicotlp A list of logging New Relic OTLP settings to be added to the Fastly service. Each object in the list has the following attributes:
- format (String) Apache style log formatting. Your log must produce valid JSON that New Relic OTLP can ingest.
- format_version (Number) The version of the custom logging format used for the configured endpoint. Can be either 1 or 2. (default: 2).
- name (String) The unique name of the New Relic OTLP logging endpoint. It is important to note that changing this attribute will delete and recreate the resource
- placement (String) Where in the generated VCL the logging call should be placed.
- region (String) The region that log data will be sent to. Default: US
- response_condition (String) The name of the condition to apply.
- url (String) The optional New Relic Trace Observer URL to stream logs to for Infinite Tracing.
list(object({
format = optional(string)
format_version = optional(number)
name = string
placement = optional(string)
region = optional(string)
response_condition = optional(string)
url = optional(string)
}))
[] no
fastly_logging_newrelicotlp_token (String, Sensitive) The Insert API key from the Account page of your New Relic account (https://docs.newrelic.com/docs/logs/logging-api/logging-api-keys/insert-api-key/). string "" no
fastly_logging_openstack A list of logging OpenStack settings to be added to the Fastly service. Each object in the list has the following attributes:
- bucket_name (String) The name of your OpenStack container
- compression_codec (String) The codec used for compression of your logs. Valid values are zstd, snappy, and gzip. If the specified codec is "gzip", gzip_level will default to 3. To specify a different level, leave compression_codec blank and explicitly set the level using gzip_level. Specifying both compression_codec and gzip_level in the same API request will result in an error.
- format (String) Apache style log formatting.
- format_version (Number) The version of the custom logging format used for the configured endpoint. Can be either 1 or 2. (default: 2).
- gzip_level (Number) Level of Gzip compression from 0-9. 0 means no compression. 1 is the fastest and the least compressed version, 9 is the slowest and the most compressed version. Default 0
- message_type (String) How the message should be formatted. Can be either classic, loggly, logplex or blank. Default is classic
- name (String) The unique name of the OpenStack logging endpoint. It is important to note that changing this attribute will delete and recreate the resource
- path (String) Path to store the files. Must end with a trailing slash. If this field is left empty, the files will be saved in the bucket's root path
- period (Number) How frequently the logs should be transferred, in seconds. Default 3600
- placement (String) Where in the generated VCL the logging call should be placed. Can be none or none.
- public_key (String) A PGP public key that Fastly will use to encrypt your log files before writing them to disk
- response_condition (String) The name of an existing condition in the configured endpoint, or leave blank to always execute.
- timestamp_format (String) The strftime specified timestamp formatting (default %Y-%m-%dT%H:%M:%S.000)
- url (String) Your OpenStack auth url
- user (String) The username for your OpenStack account
list(object({
bucket_name = string
compression_codec = optional(string)
format = optional(string)
format_version = optional(number)
gzip_level = optional(number)
message_type = optional(string)
name = string
path = optional(string)
period = optional(number)
placement = optional(string)
public_key = optional(string)
response_condition = optional(string)
timestamp_format = optional(string)
url = string
user = string
}))
[] no
fastly_logging_openstack_access_key (String, Sensitive) Your OpenStack account access key. string "" no
fastly_logging_papertrail A list of logging Papertrail settings to be added to the Fastly service. Each object in the list has the following attributes:
- address (String) The address of the Papertrail endpoint
- format (String) A Fastly log format string
- format_version (Number) The version of the custom logging format used for the configured endpoint. The logging call gets placed by default in vcl_log if format_version is set to 2 and in vcl_deliver if format_version is set to 1
- name (String) A unique name to identify this Papertrail endpoint. It is important to note that changing this attribute will delete and recreate the resource
- placement (String) Where in the generated VCL the logging call should be placed. If not set, endpoints with format_version of 2 are placed in vcl_log and those with format_version of 1 are placed in vcl_deliver
- port (Number) The port associated with the address where the Papertrail endpoint can be accessed
- response_condition (String) The name of an existing condition in the configured endpoint, or leave blank to always execute
list(object({
address = string
format = optional(string)
format_version = optional(number)
name = string
placement = optional(string)
port = number
response_condition = optional(string)
}))
[] no
fastly_logging_s3 A list of logging S3 settings to be added to the Fastly service. Each object in the list has the following attributes:
- acl (String) The AWS Canned ACL to use for objects uploaded to the S3 bucket. Options are: private, public-read, public-read-write, aws-exec-read, authenticated-read, bucket-owner-read, bucket-owner-full-control
- bucket_name (String) The name of the bucket in which to store the logs
- compression_codec (String) The codec used for compression of your logs. Valid values are zstd, snappy, and gzip. If the specified codec is "gzip", gzip_level will default to 3. To specify a different level, leave compression_codec blank and explicitly set the level using gzip_level. Specifying both compression_codec and gzip_level in the same API request will result in an error.
- domain (String) If you created the S3 bucket outside of us-east-1, then specify the corresponding bucket endpoint. Example: s3-us-west-2.amazonaws.com
- file_max_bytes (Number) Maximum size of an uploaded log file, if non-zero.
- format (String) Apache-style string or VCL variables to use for log formatting.
- format_version (Number) The version of the custom logging format used for the configured endpoint. Can be either 1 or 2. (Default: 2).
- gzip_level (Number) Level of Gzip compression from 0-9. 0 means no compression. 1 is the fastest and the least compressed version, 9 is the slowest and the most compressed version. Default 0
- message_type (String) How the message should be formatted. Can be either classic, loggly, logplex or blank. Default is classic
- name (String) The unique name of the S3 logging endpoint. It is important to note that changing this attribute will delete and recreate the resource
- path (String) Path to store the files. Must end with a trailing slash. If this field is left empty, the files will be saved in the bucket's root path
- period (Number) How frequently the logs should be transferred, in seconds. Default 3600
- placement (String) Where in the generated VCL the logging call should be placed.
- public_key (String) A PGP public key that Fastly will use to encrypt your log files before writing them to disk
- redundancy (String) The S3 storage class (redundancy level). Should be one of: standard, intelligent_tiering, standard_ia, onezone_ia, glacier, glacier_ir, deep_archive, or reduced_redundancy
- response_condition (String) Name of blockAttributes condition to apply this logging.
- s3_iam_role (String) The Amazon Resource Name (ARN) for the IAM role granting Fastly access to S3. Not required if access_key and secret_key are provided. You can provide this value via an environment variable, FASTLY_S3_IAM_ROLE
- server_side_encryption (String) Specify what type of server side encryption should be used. Can be either AES256 or aws:kms
- server_side_encryption_kms_key_id (String) Optional server-side KMS Key Id. Must be set if server_side_encryption is set to aws:kms
- timestamp_format (String) The strftime specified timestamp formatting (default %Y-%m-%dT%H:%M:%S.000)
list(object({
acl = optional(string)
bucket_name = string
compression_codec = optional(string)
domain = optional(string)
file_max_bytes = optional(number)
format = optional(string)
format_version = optional(number)
gzip_level = optional(number)
message_type = optional(string)
name = string
path = optional(string)
period = optional(number)
placement = optional(string)
public_key = optional(string)
redundancy = optional(string)
response_condition = optional(string)
s3_iam_role = optional(string)
server_side_encryption = optional(string)
server_side_encryption_kms_key_id = optional(string)
timestamp_format = optional(string)
}))
[] no
fastly_logging_s3_access_key (String, Sensitive) AWS Access Key of an account with the required permissions to post logs. It is strongly recommended you create a separate IAM user with permissions to only operate on this Bucket. This key will be not be encrypted. Not required if iam_role is provided. You can provide this key via an environment variable, FASTLY_S3_ACCESS_KEY string "" no
fastly_logging_s3_secret_key (String, Sensitive) AWS Secret Key of an account with the required permissions to post logs. It is strongly recommended you create a separate IAM user with permissions to only operate on this Bucket. This secret will be not be encrypted. Not required if iam_role is provided. You can provide this secret via an environment variable, FASTLY_S3_SECRET_KEY string "" no
fastly_logging_scalyr A list of logging Scalyr settings to be added to the Fastly service. Each object in the list has the following attributes:
- format (String) Apache style log formatting.
- format_version (Number) The version of the custom logging format used for the configured endpoint. Can be either 1 or 2. (default: 2).
- name (String) The unique name of the Scalyr logging endpoint. It is important to note that changing this attribute will delete and recreate the resource
- placement (String) Where in the generated VCL the logging call should be placed.
- project_id (String) The name of the logfile field sent to Scalyr
- region (String) The region that log data will be sent to. One of US or EU. Defaults to US if undefined
- response_condition (String) The name of an existing condition in the configured endpoint, or leave blank to always execute.
list(object({
format = optional(string)
format_version = optional(number)
name = string
placement = optional(string)
project_id = optional(string)
region = optional(string)
response_condition = optional(string)
}))
[] no
fastly_logging_scalyr_token (String, Sensitive) The token to use for authentication (https://www.scalyr.com/keys) string "" no
fastly_logging_sftp A list of logging SFTP settings to be added to the Fastly service. Each object in the list has the following attributes:
- address (String) The SFTP address to stream logs to
- compression_codec (String) The codec used for compression of your logs. Valid values are zstd, snappy, and gzip. If the specified codec is "gzip", gzip_level will default to 3. To specify a different level, leave compression_codec blank and explicitly set the level using gzip_level. Specifying both compression_codec and gzip_level in the same API request will result in an error.
- format (String) Apache-style string or VCL variables to use for log formatting.
- format_version (Number) The version of the custom logging format used for the configured endpoint. Can be either 1 or 2. (default: 2).
- gzip_level (Number) Level of Gzip compression from 0-9. 0 means no compression. 1 is the fastest and the least compressed version, 9 is the slowest and the most compressed version. Default 0
- message_type (String) How the message should be formatted. Can be either classic, loggly, logplex or blank. Default is classic
- name (String) The unique name of the SFTP logging endpoint. It is important to note that changing this attribute will delete and recreate the resource
- path (String) The path to upload log files to. If the path ends in / then it is treated as a directory
- period (Number) How frequently log files are finalized so they can be available for reading (in seconds, default 3600)
- placement (String) Where in the generated VCL the logging call should be placed.
- port (Number) The port the SFTP service listens on. (Default: 22)
- public_key (String) A PGP public key that Fastly will use to encrypt your log files before writing them to disk
- response_condition (String) The name of the condition to apply.
- ssh_known_hosts (String) A list of host keys for all hosts we can connect to over SFTP
- timestamp_format (String) The strftime specified timestamp formatting (default %Y-%m-%dT%H:%M:%S.000)
- user (String) The username for the server
list(object({
address = string
compression_codec = optional(string)
format = optional(string)
format_version = optional(number)
gzip_level = optional(number)
message_type = optional(string)
name = string
path = string
period = optional(number)
placement = optional(string)
port = optional(number)
public_key = optional(string)
response_condition = optional(string)
ssh_known_hosts = string
timestamp_format = optional(string)
user = string
}))
[] no
fastly_logging_sftp_password (String, Sensitive) The password for the server. If both password and secret_key are passed, secret_key will be preferred string "" no
fastly_logging_sftp_secret_key (String, Sensitive) The SSH private key for the server. If both password and secret_key are passed, secret_key will be preferred string "" no
fastly_logging_splunk A list of logging Splunk settings to be added to the Fastly service. Each object in the list has the following attributes:
- format (String) Apache-style string or VCL variables to use for log formatting (default: %h %l %u %t "%r" %>s %b)
- format_version (Number) The version of the custom logging format used for the configured endpoint. Can be either 1 or 2. (default: 2)
- name (String) A unique name to identify the Splunk endpoint. It is important to note that changing this attribute will delete and recreate the resource
- placement (String) Where in the generated VCL the logging call should be placed
- response_condition (String) The name of the condition to apply
- tls_ca_cert (String) A secure certificate to authenticate the server with. Must be in PEM format. You can provide this certificate via an environment variable, FASTLY_SPLUNK_CA_CERT
- tls_client_cert (String) The client certificate used to make authenticated requests. Must be in PEM format.
- tls_hostname (String) The hostname used to verify the server's certificate. It can either be the Common Name or a Subject Alternative Name (SAN)
- url (String) The Splunk URL to stream logs to
- use_tls (Boolean) Whether to use TLS for secure logging. Default: false
list(object({
format = optional(string)
format_version = optional(number)
name = string
placement = optional(string)
response_condition = optional(string)
tls_ca_cert = optional(string)
tls_client_cert = optional(string)
tls_hostname = optional(string)
url = string
use_tls = optional(bool)
}))
[] no
fastly_logging_splunk_tls_client_key (String, Sensitive) The client private key used to make authenticated requests. Must be in PEM format. You can provide this key via an environment variable, FASTLY_SPLUNK_CLIENT_KEY. string "" no
fastly_logging_splunk_token (String, Sensitive) The Splunk token to be used for authentication (https://docs.splunk.com/Documentation/Splunk/latest/Data/UsetheHTTPEventCollector). string "" no
fastly_logging_sumologic A list of logging SumoLogic settings to be added to the Fastly service. Each object in the list has the following attributes:
- format (String) Apache-style string or VCL variables to use for log formatting
- format_version (Number) The version of the custom logging format used for the configured endpoint. Can be either 1 or 2. (Default: 2)
- message_type (String) How the message should be formatted. Can be either classic, loggly, logplex or blank. Default is classic
- name (String) A unique name to identify this Sumologic endpoint. It is important to note that changing this attribute will delete and recreate the resource
- placement (String) Where in the generated VCL the logging call should be placed.
- response_condition (String) Name of blockAttributes condition to apply this logging.
- url (String) The URL to Sumologic collector endpoint
list(object({
format = optional(string)
format_version = optional(number)
message_type = optional(string)
name = string
placement = optional(string)
response_condition = optional(string)
url = string
}))
[] no
fastly_logging_syslog A list of logging syslog settings to be added to the Fastly service. Each object in the list has the following attributes:
- address (String) A hostname or IPv4 address of the Syslog endpoint.
- format (String) Apache-style string or VCL variables to use for log formatting.
- format_version (String) The version of the custom logging format. Can be either 1 or 2. Default: 2
- message_type (String) How the message should be formatted. Can be either classic, loggly, logplex or blank. Default is classic.
- name (String) A unique name to identify this Syslog endpoint. It is important to note that changing this attribute will delete and recreate the resource.
- placement (String) Where in the generated VCL the logging call should be placed.
- port (Number) The port associated with the address where the Syslog endpoint can be accessed. Default 514
- response_condition (String) Name of blockAttributes condition to apply this logging.
- tls_ca_cert (String) A secure certificate to authenticate the server with. Must be in PEM format. You can provide this certificate via an environment variable, FASTLY_SYSLOG_CA_CERT.
- tls_client_cert (String) The client certificate used to make authenticated requests. Must be in PEM format. You can provide this certificate via an environment variable, FASTLY_SYSLOG_CLIENT_CERT.
- tls_hostname (String) Used during the TLS handshake to validate the certificate.
- token (String) Whether to prepend each message with a specific token.
- use_tls (Boolean) Whether to use TLS for secure logging. Default false
list(object({
address = string
format = optional(string)
format_version = optional(number)
message_type = optional(string)
name = string
placement = optional(string)
port = optional(number)
response_condition = optional(string)
tls_ca_cert = optional(string)
tls_client_cert = optional(string)
tls_hostname = optional(string)
token = optional(string)
use_tls = optional(bool)
}))
[] no
fastly_logging_syslog_tls_client_key logging_syslog tls_client_key (String, Sensitive) The client private key used to make authenticated requests. Must be in PEM format. You can provide this key via an environment variable, FASTLY_SYSLOG_CLIENT_KEY. string "" no
fastly_product_enablement A single-item list of settings for product enablement to be added to the Fastly service. Each object in the list has the following attributes:
- bot_management (Boolean) Enable Bot Management support.
- brotli_compression (Boolean) Enable Brotli Compression support.
- ddos_protection (Block List) A single block list of DDoS Protection product settings with the following attributes:
- enabled (Boolean) Enable DDoS Protection support.
- mode (String) Operation mode.
- domain_inspector (Boolean) Enable Domain Inspector support.
- image_optimizer (Boolean) Enable Image Optimizer support (all backends must have a shield attribute).
- log_explorer_insights (Boolean) Enable Log Explorer & Insights.
- name (String) Used by the provider to identify modified settings (changing this value will force the entire block to be deleted, then recreated).
- ngwaf (Block List) A single block list of Next-Gen WAF product settings with the following attributes:
- enabled (Boolean) Enable Next-Gen WAF support.
- traffic_ramp (Number) The percentage of traffic to inspect.
- workspace_id (String) The workspace to link.
- origin_inspector (Boolean) Enable Origin Inspector support.
- websockets (Boolean) Enable WebSockets support.
list(object({
bot_management = optional(bool)
brotli_compression = optional(bool)
ddos_protection = optional(object({
enabled = bool
mode = string
}))
domain_inspector = optional(bool)
image_optimizer = optional(bool)
log_explorer_insights = optional(bool)
name = optional(string)
ngwaf = optional(object({
enabled = bool
traffic_ramp = number
workspace_id = string
}))
origin_inspector = optional(bool)
websockets = optional(bool)
}))
[] no
fastly_rate_limiters A list of rate limiters to be added to the Fastly service. Each object in the list has the following attributes:
- action (String) The action to take when a rate limiter violation is detected (one of: log_only, response, response_object).
- client_key (String) Comma-separated list of VCL variables used to generate a counter key to identify a client.
- feature_revision (Number) Revision number of the rate limiting feature implementation.
- http_methods (String) Comma-separated list of HTTP methods to apply rate limiting to.
- logger_type (String) Name of the type of logging endpoint to be used when action is log_only (one of: azureblob, bigquery, cloudfiles, datadog, digitalocean, elasticsearch, ftp, gcs, googleanalytics, heroku, honeycomb, http, https, kafka, kinesis, logentries, loggly, logshuttle, newrelic, openstack, papertrail, pubsub, s3, scalyr, sftp, splunk, stackdriver, sumologic, syslog).
- name_suffix (String) A unique human readable name suffix for the rate limiting rule.
- penalty_box_duration (Number) Length of time in minutes that the rate limiter is in effect after the initial violation is detected.
- response (Block List) A single block list of custom response settings to be sent when the rate limit is exceeded. Required if action is response. Consists of the following attributes:
- content (String) HTTP response body data.
- content_type (String) HTTP Content-Type (e.g. application/json).
- status (Number) HTTP response status code (e.g. 429).
- response_object_name (String) Name of existing response object. Required if action is response_object.
- rps_limit (Number) Upper limit of requests per second allowed by the rate limiter.
- uri_dictionary_name (String) The name of an Edge Dictionary containing URIs as keys. If not defined or null, all origin URIs will be rate limited.
- window_size (Number) Number of seconds during which the RPS limit must be exceeded in order to trigger a violation (one of: 1, 10, 60).
list(object({
action = string
client_key = string
feature_revision = optional(number)
http_methods = string
logger_type = optional(string)
name_suffix = string
penalty_box_duration = number
response = optional(object({
content = string
content_type = string
status = number
}))
response_object_name = optional(string)
rps_limit = number
uri_dictionary_name = optional(string)
window_size = number
}))
[] no
fastly_request_settings A list of request settings to be added to the Fastly service. Each object in the list has the following attributes:
- action (String) Allows you to terminate request handling and immediately perform an action.
- bypass_busy_wait (Boolean) Disable collapsed forwarding, so you don't wait for other objects to origin
- default_host (String) Sets the host header
- force_miss (Boolean) Force a cache miss for the request
- force_ssl (Boolean) Forces the request to use SSL (Redirects a non-SSL request to SSL)
- hash_keys (String) Comma separated list of varnish request object fields that should be in the hash key
- max_stale_age (Number) How old an object is allowed to be to serve stale-if-error or stale-while-revalidate, in seconds
- name (String) Unique name to refer to this Request Setting. It is important to note that changing this attribute will delete and recreate the resource.
- request_condition (String) Name of already defined condition to determine if this request setting should be applied
- timer_support (Boolean) Injects the X-Timer info into the request for viewing origin fetch durations
- xff (String) X-Forwarded-For, should be clear, leave, append, append_all, or overwrite
list(object({
action = optional(string)
bypass_busy_wait = optional(bool)
default_host = optional(string)
force_miss = optional(bool)
force_ssl = optional(bool)
hash_keys = optional(string)
max_stale_age = optional(number)
name = string
request_condition = optional(string)
timer_support = optional(bool)
xff = optional(string)
}))
[] no
fastly_response_objects A list of response objects to be added to the Fastly service. Each object in the list has the following attributes:
- cache_condition (String) Name of already defined condition to check after we have retrieved an object. If the condition passes then deliver this Request Object instead. This condition must be of type CACHE. For detailed information about Conditionals, see Fastly's Documentation on Conditionals
- content (String) The content to deliver for the response object
- content_type (String) The MIME type of the content
- name (String) A unique name to identify this Response Object. It is important to note that changing this attribute will delete and recreate the resource.
- request_condition (String) Name of already defined condition to be checked during the request phase. If the condition passes then this object will be delivered. This condition must be of type REQUEST
- response (String) The HTTP Response. Default OK
- status (Number) The HTTP Status Code. Default 200
list(object({
cache_condition = optional(string)
content = optional(string)
content_type = optional(string)
name = string
request_condition = optional(string)
response = optional(string, "OK")
status = optional(number, 200)
}))
[] no
fastly_service_comment (String) Description field for the service. Default Managed by Terraform string "Managed by Terraform" no
fastly_snippets A list of VCL snippets to be added to the Fastly service. Each object in the list has the following attributes:
- content (String) The VCL code that specifies exactly what the snippet does.
- name (String) A name that is unique across "regular" and "dynamic" VCL Snippet configuration blocks. It is important to note that changing this attribute will delete and recreate the resource.
- priority (Number) Priority determines the ordering for multiple snippets. Lower numbers execute first. Defaults to 100
- type (String) The location in generated VCL where the snippet should be placed (can be one of init, recv, hash, hit, miss, pass, fetch, error, deliver, log or none).
list(object({
content = string
name = string
priority = optional(number, 100)
type = string
}))
[] no
fastly_stage (Boolean) Conditionally enables new service versions to be staged. If set to true, all changes made by an apply step will be staged, even if apply did not create a new draft version. Default false bool false no
fastly_stale_if_error (Boolean) Enables serving a stale object if there is an error. Default true bool true no
fastly_stale_if_error_ttl (Number) The default time-to-live (TTL) for serving the stale object for the version number 43200 no
fastly_vcls A list of VCLs to be added to the Fastly service. Each object in the list has the following attributes:
- content (String) The custom VCL code to upload.
- main (Boolean) A unique name for this configuration block. It is important to note that changing this attribute will delete and recreate the resource.
- name (String) If true, use this block as the main configuration. If false, use this block as an includable library. Only a single VCL block can be marked as the main block. Default false
list(object({
content = string
main = optional(bool)
name = string
}))
[] no

Outputs

Name Description
fastly_service_id The ID of the Fastly Service that was updated.
fastly_service_name The name of the Fastly Service that was updated.

About

Improving's Terraform Fastly Service Module

Topics

Resources

License

Stars

Watchers

Forks

Contributors 2

  •  
  •  

Languages