- make a directory for your project `mkdir myfirstproject`
-`cd myfirstproject`
- create `main.tf`<-createstheterraformmainfile
## Create
to start the deployment `terraform init && terraform apply`
## Destroying
can be done using `terraform destroy`
And that's it!! you managed to deploy 2 VMs on the threefold grid v3
## How to use a Terraform File
### Initializing the provider
In terraform's global section
```terraform
terraform {
required_providers {
grid = {
source = "threefoldtech/grid"
version = "1.8.1"
}
}
}
```
- You can always provide a version to chooses a specific version of the provider like `1.8.1-dev` to use version `1.8.1` for devnet
- If `version = "1.8.1"` is omitted, the provider will fetch the latest version but for environments other than main you have to specify the version explicitly
- For devnet, qanet and testnet use version = `"<VERSION>-dev", "<VERSION>-qa" and "<VERSION>-rcx"` respectively
Providers can have different arguments e.g using which identity when deploying, which substrate network to create contracts on, .. etc. This can be done in the provider section
```terraform
provider "grid" {
mnemonics = "FROM THE CREATE TWIN STEP"
network = "dev" # or test to use testnet
}
```
Please note you can leave its content empty and export everything as environment variables