---
layout: "fastly"
page_title: "Fastly: fastly_package_hash"
sidebar_current: "docs-fastly-datasource-fastly_package_hash"
description: |-
  Generate a SHA512 hash of all files (in sorted order) within the package.
---

# fastly_package_hash

Use this data source to generate a SHA512 hash of all files (in sorted order) within the package.

## Example Usage

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

resource "fastly_service_compute" "example" {
  # ...

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

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

### Optional

- `content` (String) The contents of the Wasm deployment package as a base64 encoded string (e.g. could be provided using an input variable or via external data source output variable). Conflicts with `filename`. Exactly one of these two arguments must be specified
- `filename` (String) The path to the Wasm deployment package within your local filesystem. Conflicts with `content`. Exactly one of these two arguments must be specified

### Read-Only

- `hash` (String) A SHA512 hash of all files (in sorted order) within the package.
- `id` (String) The ID of this resource.
