Skip to main content

Fastly Data Source

The Fastly connector enables you to ingest configuration, service, and billing data from your Fastly account into Nexla. Use this connector to monitor your CDN services, audit configurations, analyze usage, and build automated data pipelines around your Fastly infrastructure. Follow the instructions below to create a new data flow that ingests data from a Fastly source in Nexla.
fastly_api.png

Fastly

Create a New Data Flow

  1. To create a new data flow, navigate to the Integrate section, and click the New Data Flow button. Then, select the desired flow type from the list, and click the Create button.

  2. Select the Fastly connector tile from the list of available connectors. Then, select the credential that will be used to connect to the Fastly account, and click Next; or, create a new Fastly credential for use in this flow.

  3. In Nexla, Fastly data sources can be created using pre-built endpoint templates, which expedite source setup for common Fastly API endpoints. Each template is designed specifically for the corresponding Fastly endpoint, making source configuration easy and efficient.
    • To configure this source using a template, follow the instructions in Configure Using a Template.

    Fastly sources can also be configured manually, allowing you to ingest data from Fastly API endpoints not included in the pre-built templates or apply further customizations to exactly suit your needs.
    • To configure this source manually, follow the instructions in Configure Manually.

Configure Using a Template

Nexla provides pre-built templates that can be used to rapidly configure data sources to ingest data from common Fastly API endpoints. Each template is designed specifically for the corresponding Fastly endpoint, making data source setup easy and efficient.

Endpoint Settings

  • Select the endpoint from which this source will fetch data from the Endpoint pulldown menu. Available endpoint templates are listed in the expandable boxes below. Click on an endpoint to see more information about it and how to configure your data source for this endpoint.

Get Current User

Returns information about the authenticated user associated with the API token being used. This endpoint is useful for verifying your credentials and confirming which Fastly account is connected to Nexla.

  • This endpoint requires no additional configuration. Select it from the Endpoint pulldown menu and Nexla will automatically call GET /current_user on the Fastly API using the selected credential.
  • The response includes user details such as name, email, login, role, and account information.

This endpoint is particularly useful for validating that your Fastly credential is correctly configured and that the API token has the necessary access rights. For additional details, refer to the Fastly current user documentation.

List All Services

Returns a paginated list of all Fastly services associated with the authenticated account. A Fastly service represents a CDN configuration that maps domains to origin servers and defines caching, routing, and security behavior.

  • This endpoint requires no additional configuration. Select it from the Endpoint pulldown menu to retrieve all services for the connected Fastly account.
  • Results are paginated automatically by Nexla — all pages of results will be retrieved and combined into a single Nexset.
  • Each service record includes the service ID, name, type, active version number, creation date, and last updated date.

The service ID returned by this endpoint is required for several other Fastly endpoints. Run this endpoint first to obtain the service IDs for services you wish to inspect in more detail. For reference, see the Fastly services API documentation.

Get Service Details

Returns detailed configuration information about a specific Fastly service, including all versions, active configuration, and metadata. Use this endpoint to inspect or audit a particular service's full configuration.

  • Enter the unique identifier of the Fastly service in the Service ID field. This alphanumeric string identifies which service's details should be retrieved. Service IDs can be found by:

    • Running the List All Services endpoint to get a list of all services and their corresponding IDs.
    • Viewing the Fastly control panel at All services and inspecting the URL, which contains the service ID.

Service details include all versions of the service configuration. The active_version field in the response indicates which version is currently serving traffic. For reference, see the Fastly services API documentation.

List Service Versions

Returns a list of all configuration versions for a specific Fastly service. In Fastly, configuration changes are staged as new versions before being activated. This endpoint is useful for auditing configuration history and tracking changes over time.

  • Enter the unique identifier of the Fastly service in the Service ID field. You can find this value using the List All Services endpoint or the Fastly control panel.
  • Each version record includes the version number, whether it is active, whether it is locked, creation date, and last updated date.

Only the active version is serving traffic at any given time. Versions that are "locked" have been activated previously and can no longer be edited — they can only be cloned to create a new editable version. For reference, see the Fastly service versions documentation.

List Service Dictionaries

Returns a list of all edge dictionaries (also called edge config stores) configured for a specific service version. Fastly edge dictionaries are key-value stores attached to a service version that can be used in VCL to drive dynamic routing and configuration decisions.

  • Enter the unique identifier of the Fastly service in the Service ID field.
  • Enter the version number of the service configuration in the Version ID field. To get the current active version number, first use the List Service Versions endpoint or the Get Service Details endpoint, and look for the version with active: true.
  • Results are paginated automatically by Nexla.

Edge dictionaries differ from KV stores in that they are versioned and tied to a specific service version. Modifying dictionary contents does not require creating a new service version. For reference, see the Fastly dictionaries documentation.

List Service Backends

Returns a list of all backends (origin servers) configured for a specific service version. Backends define where Fastly should forward requests that cannot be served from cache, including the hostname, port, SSL settings, and health check configuration.

  • Enter the unique identifier of the Fastly service in the Service ID field.
  • Enter the version number of the service configuration in the Version ID field. Use the List Service Versions or Get Service Details endpoint to find the active version number.
  • Each backend record includes the backend name, address, port, SSL settings, connection timeout, and health check configuration.

Backend configuration changes require creating a new service version and activating it before taking effect. For reference, see the Fastly backends documentation.

List Service Domains

Returns a list of all domains configured for a specific service version. Domains define the hostnames that Fastly accepts requests for and routes to the configured backends.

  • Enter the unique identifier of the Fastly service in the Service ID field.
  • Enter the version number of the service configuration in the Version ID field. Use the List Service Versions or Get Service Details endpoint to find the active version number.
  • Each domain record includes the domain name, any associated comment, and the creation and update timestamps.

Domain configuration is version-specific. After adding or updating domains, you must activate the new service version for the changes to take effect. For reference, see the Fastly domains documentation.

List Service ACLs

Returns a list of all Access Control Lists (ACLs) configured for a specific service version. Fastly ACLs are named lists of IP addresses and CIDR ranges used in VCL to allow or deny traffic based on client IP address.

  • Enter the unique identifier of the Fastly service in the Service ID field.
  • Enter the version number of the service configuration in the Version ID field. Use the List Service Versions or Get Service Details endpoint to find the active version number.
  • Each ACL record includes the ACL name, ID, and the service version it belongs to.

ACL entries (the individual IP rules within an ACL) can be modified at runtime without requiring a new service version activation. However, the ACL itself must be created on a service version and that version must be activated before the ACL can be used. For reference, see the Fastly ACL documentation.

List All Invoices

Returns a list of all billing invoices for the authenticated Fastly account. Use this endpoint to ingest billing and usage data for financial reporting, cost analysis, or automated invoice processing pipelines.

  • This endpoint requires no additional configuration. Select it from the Endpoint pulldown menu to retrieve all invoices for the connected Fastly account.
  • Each invoice record includes the invoice period, total charges, and line items broken down by service and region.

Access to billing data requires that the API token used in the credential has sufficient account-level permissions. For reference, see the Fastly invoices documentation.

List All KV Stores

Returns a paginated list of all KV stores associated with the authenticated Fastly account. Fastly KV stores are global key-value storage containers used by Fastly Compute services to store and retrieve persistent data at the edge.

  • This endpoint requires no additional configuration. Select it from the Endpoint pulldown menu to retrieve all KV stores for the connected Fastly account.
  • Results are paginated using cursor-based pagination, which Nexla handles automatically.
  • Each KV store record includes the store ID, name, and creation timestamp. The store ID is required to perform operations on items within the store.

KV stores are distinct from edge dictionaries — KV stores are versionless global containers used with Fastly Compute, while edge dictionaries are versioned and tied to a specific service version. For reference, see the Fastly KV store documentation.

Endpoint Testing

Once the selected endpoint template has been configured, Nexla can retrieve a sample of the data that will be fetched according to the current settings. This allows users to verify that the source is configured correctly before saving.

  • To test the current endpoint configuration, click the Test button to the right of the endpoint selection menu. Sample data will be fetched & displayed in the Endpoint Test Result panel on the right.

  • If the sample data is not as expected, review the selected endpoint and associated settings, and make any necessary adjustments. Then, click the Test button again, and check the sample data to ensure that the correct information is displayed.

Configure Manually

Fastly data sources can be manually configured to ingest data from any valid Fastly API endpoint. Manual configuration provides maximum flexibility for accessing endpoints not covered by pre-built templates or when you need custom API configurations.

With manual configuration, you can also create more complex Fastly sources, such as sources that use chained API calls to fetch data from multiple endpoints or apply custom request parameters.

API Method

  1. To manually configure this source, select the Advanced tab at the top of the configuration screen.

  2. Select the API method that will be used for calls to the Fastly API from the Method pulldown menu. The most common method for Fastly data sources is:

    • GET: For retrieving data such as service configurations, versions, backends, domains, ACLs, and billing data.

API Endpoint URL

  1. Enter the URL of the Fastly API endpoint from which this source will fetch data in the Set API URL field. Fastly API endpoints use the base URL https://api.fastly.com/ followed by the resource path.

    For example:

    • https://api.fastly.com/service — list all services
    • https://api.fastly.com/current_user — get current user info
    • https://api.fastly.com/billing/v3/invoices — list all invoices

The complete Fastly API reference is available at https://www.fastly.com/documentation/reference/api/. Ensure the API endpoint URL matches your intended resource path exactly, including any required service or version IDs in the path.

Date/Time Macros (API URL)

Optional

Optionally, the API URL can be customized using macros—all macros added to the API URL will be converted into values when Nexla executes the API call. Macros are dynamic placeholders that allow you to create flexible API endpoints that can adapt to different time periods or data requirements.

Date/time macros are particularly useful for Fastly billing and stats endpoints that accept date range parameters, allowing Nexla to automatically fetch data for the current period on each run.

  1. To add a macro, type { at the appropriate position in the API URL (within the Set API URL field), and select the desired macro from the dropdown list.

    • {now} – The current datetime
    • {now-1} – The datetime one time unit before the current datetime
    • {now+1} – The datetime one time unit after the current datetime
    • custom – Datetime macros can reference any number of time units before or after the current datetime—for example, enter (now-4) to indicate the datetime four time units before the current datetime
  2. Select the format that will be applied to datetime macros from the Date Format for Date/Time Macro pulldown menu. This format will be applied to the base datetime value of the macro—i.e., the value of {now} in {now-1}.

  3. Select the datetime unit that will be used to perform mathematical operations in the included macro(s) from the Time Unit for Operations pulldown menu—for example, for the macro {now-1}, when Day is selected, {now-1} will be converted to the datetime one day before the current datetime.

Lookup-Based Macros (API URL)

Optional

Column values from existing lookups can also be included as macros in the API URL. Lookup-based macros allow you to reference data from previously configured data sources or lookups, enabling dynamic API endpoints that can adapt based on existing data.

Lookup-based macros are useful for building multi-step Fastly pipelines — for example, you can first ingest a list of service IDs from the List All Services endpoint, then use those IDs as macros in subsequent endpoints to retrieve per-service details.

  1. To include a lookup column value macro, select the relevant lookup from the Add Lookups to Supported Macros pulldown menu.

  2. Type { at the appropriate position in the API URL, and select the lookup column-based macro from the dropdown list. Lookup-based macros are automatically populated into the macro list when a lookup is selected in the Add Lookups to Supported Macros pulldown menu.

Path to Data

Optional

If only a subset of the data that will be returned by the Fastly API endpoint is needed, you can designate the part(s) of the response that should be included in the Nexset(s) produced from this source by specifying the path to the relevant data within the response.

For example, Fastly's List All Services endpoint returns data under a data array: {"data": [...], "meta": {...}}. By entering $.data[*] as the path to data, Nexla will treat each element in the array as a separate record.

Path to Data is essential when Fastly API responses have nested structures with metadata wrappers. Without specifying the correct path, Nexla might not be able to properly parse and organize your data into usable records.

  • To specify which data should be treated as relevant in responses from this source, enter the path to the relevant data in the Set Path to Data in Response field.

    • For responses in JSON format enter the JSON path that points to the object or array that should be treated as relevant data. JSON paths use dot notation (e.g., $.data[*] to access an array within a data object, or $[*] for top-level arrays).
    Path to Data Example:

    If the Fastly API response contains a top-level data array such as {"data": [...], "meta": {...}}, enter $.data[*] as the path to data. For endpoints that return a top-level array directly (e.g., service versions), enter $[*].

Autogenerate Path Suggestions

Nexla can also autogenerate data path suggestions based on the response from the API endpoint. These suggested paths can be used as-is or modified to exactly suit your needs.

  • To use this feature, click the Test button next to the Set API URL field to fetch a sample response from the API endpoint. Suggested data paths generated based on the content & format of the response will be displayed in the Suggestions box below the Set Path to Data in Response field.

  • Click on a suggestion to automatically populate the Set Path to Data in Response field with the corresponding path. The populated path can be modified directly within the field if further customization is needed.

Metadata

If metadata is included in the Fastly API response but is located outside of the defined path to relevant data, you can configure Nexla to include this data as common metadata in each record. For example, Fastly's paginated list responses include a meta object with pagination context and request timestamps that may be useful to preserve alongside record data.

Metadata paths are particularly useful for preserving Fastly API response context like total record counts, pagination tokens, or request timestamps that apply to all records in the response.

  • To specify the location of metadata that should be included with each record, enter the path to the relevant metadata in the Path to Metadata in Response field.

    • For responses in JSON format, enter the JSON path to the object or array that contains the metadata (e.g., $.meta for Fastly's standard paginated response wrapper).

Request Headers

Optional
  • If Nexla should include any additional request headers in API calls to this source, enter the headers & corresponding values as comma-separated pairs in the Request Headers field (e.g., header1:value1,header2:value2). Additional headers may be needed for API versioning or custom content type specifications.

    You do not need to include the Fastly-Key authentication header here — it is automatically added to all requests by Nexla using the value from your Fastly credential. Common headers like Authorization and Content-Type are handled automatically.

Endpoint Testing

After configuring all settings for the selected endpoint, Nexla can retrieve a sample of the data that will be fetched according to the current configuration. This allows users to verify that the source is configured correctly before saving.

  • To test the current endpoint configuration, click the Test button to the right of the endpoint selection menu. Sample data will be fetched & displayed in the Endpoint Test Result panel on the right.

  • If the sample data is not as expected, review the selected endpoint and associated settings, and make any necessary adjustments. Then, click the Test button again, and check the sample data to ensure that the correct information is displayed.

Save & Activate the Source

  1. Once all of the relevant steps in the above sections have been completed, click the Create button in the upper right corner of the screen to save and create the new Fastly data source. Nexla will now begin ingesting data from the configured endpoint and will organize any data that it finds into one or more Nexsets.