> For the complete documentation index, see [llms.txt](https://developers.incidents.cloud.solarwinds.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.incidents.cloud.solarwinds.com/integration-and-extensibility/terraform/tutorial/how-to-use-terraformer.md).

# How to use Terraformer with Squadcast?

If you are already using Squadcast via API or the Web UI and would like to generate the Terraform files for your existing Squadcast configuration, you can use our [Squadcast implementation of Terraformer](https://github.com/SquadcastHub/terraformer) to do the same.

## Download Terraformer binaries

Download the release using any of the following methods:

Go to: <https://github.com/SquadcastHub/terraformer/releases> and download the appropriate binary for your OS.

or

Run the following command:

### MacOS

```sh
curl -LO https://github.com/SquadcastHub/terraformer/releases/download/$(curl -s https://api.github.com/repos/SquadcastHub/terraformer/releases/latest | grep tag_name | cut -d '"' -f 4)/terraformer-all-darwin-amd64
```

### Linux

```sh
curl -LO https://github.com/SquadcastHub/terraformer/releases/download/$(curl -s https://api.github.com/repos/SquadcastHub/terraformer/releases/latest | grep tag_name | cut -d '"' -f 4)/terraformer-all-linux-amd64
```

### Windows

```sh
curl -LO https://github.com/SquadcastHub/terraformer/releases/download/$(curl -s https://api.github.com/repos/SquadcastHub/terraformer/releases/latest | grep tag_name | cut -d '"' -f 4)/terraformer-all-windows-amd64
```

## Configure the binaries

Make the binary executable:

```sh
chmod +x terraformer-all-<your_os>-<arch>
```

Add to /usr/local/bin

```sh
sudo mv terraformer-all-<your_os>-<arch> /usr/local/bin/terraformer
```

## Setup Terraform

Create a new directory in your home folder and add versions.tf file and add the following code:

```tf
terraform {
  required_providers {
    squadcast = {
      source = "SquadcastHub/squadcast"
      version = "1.0.5"
    }
  }
}
```

Run `terraform init`

## Generate Terraform files

Use terraformer to import resources:

```tf
terraformer import squadcast --resources=RESOURCE_NAME(s) --region=REGION --team-name=TEAM_NAME --refresh-token=YOUR_REFRESH_TOKEN
```

This will create a `generated` folder with all terraform files(including statefiles) depending upon the previous command.

## Update "version" and add "source" in autogenerated "provider.tf" file

Go to `/generated/squadcast/<RESOURCE_NAME>/<REGION>/provider.tf`

Add `source = "SquadcastHub/squadcast"` to squadcast inside `required_providers`

Update `version` in `required_providers` by removing .exe (Windows users only)

## Update "terraform\_version"

```sh
cd /generated/squadcast/<RESOURCE_NAME>/<REGION>

terraform state replace-provider -auto-approve "registry.terraform.io/-/squadcast" "SquadcastHub/squadcast"
```

## Use Generated files with Terraform

Update generated files as per your requirement and apply the changes using following commands

```tf
terraform init
terraform plan
terraform apply
```
