---
layout: "fastly"
page_title: "Fastly: fastly_vcl_snippets"
sidebar_current: "docs-fastly-datasource-fastly_vcl_snippets"
description: |-
  Get information on Fastly service VCL Snippets.
---

# fastly_vcl_snippets

VCL Snippets are blocks of VCL logic inserted into your service's configuration that don't require custom VCL.

Use this data source to get a list of [Fastly VCL Snippets][1] for the specified service/version.

## Example Usage

```terraform
resource "fastly_service_vcl" "example" {
  name = "Example Service"

  domain {
    name = "example.com"
  }

  force_destroy = true
}

data "fastly_vcl_snippets" "example" {
  service_id      = fastly_service_vcl.example.id
  service_version = fastly_service_vcl.example.active_version
}

output "service_vcl_snippets" {
  value = data.fastly_vcl_snippets.example
}
```

[1]: https://www.fastly.com/documentation/reference/api/vcl-services/snippet/

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `service_id` (String) Alphanumeric string identifying the service.
- `service_version` (Number) Integer identifying a service version.

### Read-Only

- `id` (String) The ID of this resource.
- `vcl_snippets` (Set of Object) List of all VCL snippets for the version of the service. (see [below for nested schema](#nestedatt--vcl_snippets))

<a id="nestedatt--vcl_snippets"></a>
### Nested Schema for `vcl_snippets`

Read-Only:

- `content` (String)
- `id` (String)
- `name` (String)
- `priority` (Number)
- `type` (String)
