# Terraform Provider Plugin

[transloadit/terraform-provider-transloadit](https://github.com/transloadit/terraform-provider-transloadit)

If you use HashiCorp's Terraform to provision your infrastructure, and are looking to deploy Transloadit as a part of that, you may find it interesting to know that you can bring Transloadit's Templates under the control of Terraform, so that along with your app, its encoding instructions can be provisioned in a reproducible way.

## Install

You'll first need [Terraform](https://www.terraform.io/downloads.html) 0.12.x installed on your system as a prerequisite.

The recommended way to install the Transloadit Terraform Provider is to use binary distributions from the [Releases](https://github.com/transloadit/terraform-provider-transloadit/releases) page. The binaries are available for Linux, macOS (darwin) and Windows (all for the amd64 architecture).

Here's how to download and extract the latest release for your OS:

### Linux

![](/_next/static/media/copy.04p1cju9qekk_.svg?dpl=dpl_CtwzFbHWtqiCy9uvWb9fE7WvfP9N)

```bash
mkdir -p ~/.terraform.d/plugins/ && cd !$
curl -sSL https://github.com/transloadit/terraform-provider-transloadit/releases/download/v0.1.0/terraform-provider-transloadit_linux_amd64.tar.gz | tar xvz
cd -

```

### macOS

![](/_next/static/media/copy.04p1cju9qekk_.svg?dpl=dpl_CtwzFbHWtqiCy9uvWb9fE7WvfP9N)

```bash
mkdir -p ~/.terraform.d/plugins/ && cd !$
curl -sSL https://github.com/transloadit/terraform-provider-transloadit/releases/download/v0.1.0/terraform-provider-transloadit_darwin_amd64.tar.gz | tar xvz
cd -

```

### Windows

[Download](https://github.com/transloadit/terraform-provider-transloadit/releases) and unpack the provider into `%APPDATA%\terraform.d\plugins`.

## Usage

Here's a quick example. More detailed instructions can be found in the[website directory](https://github.com/transloadit/terraform-provider-transloadit/blob/main/website/). If you intend to use multiple Apps withing Transloadit, check out the[examples](https://github.com/transloadit/terraform-provider-transloadit/blob/main/examples/multi-app)how to structure that by passing one provider alias per App.

In `main.tf`:

![](/_next/static/media/copy.04p1cju9qekk_.svg?dpl=dpl_CtwzFbHWtqiCy9uvWb9fE7WvfP9N)

```hcl
provider "transloadit" {
  auth_key    = "<TRANSLOADIT-AUTH-KEY>"
  auth_secret = "<TRANSLOADIT-AUTH-SECRET>"
  version     = "0.1.0"
}

resource "transloadit_template" "my-terraform-template" {
  name     = "my-terraform-template"
  template = <<EOT
{
  "steps": {
    ":original": {
      "robot": "/upload/handle"
    },
    "encoded": {
      "use": ":original",
      "robot": "/video/encode",
      "preset": "ipad-high",
      "ffmpeg_stack": "{{stacks.ffmpeg.recommended_version}}"
    },
    "thumbed": {
      "use": ":original",
      "robot": "/video/thumbs",
      "count": 4,
      "ffmpeg_stack": "{{stacks.ffmpeg.recommended_version}}"
    },
    "exported": {
      "use": [ ":original", "encoded", "thumbed"],
      "credentials": "YOUR_S3_CREDENTIALS",
      "robot": "/s3/store"
    }
  }
}
EOT
}

output "my-terraform-template-id" {
  value = transloadit_template.my-terraform-template.id
}

```

Now on the CLI, run:

![](/_next/static/media/copy.04p1cju9qekk_.svg?dpl=dpl_CtwzFbHWtqiCy9uvWb9fE7WvfP9N)

```bash
terraform init # only required on the first run after using a new Provider (version)
terraform plan

```

## Documentation

See [GitHub](https://github.com/transloadit/terraform-provider-transloadit#readme)for the full documentation.
