> For the complete documentation index, see [llms.txt](https://docs.vergeos-demo.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.vergeos-demo.com/knowledge-base/automation-api/terraform-vergeio-provider.md).

# Terraform VergeIO Provider

The **Terraform VergeIO Provider** enables the integration and automation of VergeOS infrastructure with **Terraform**. It allows users to define, manage, and scale VergeOS resources as part of Infrastructure as Code (IaC) workflows.

For the latest provider documentation and examples, please refer to the following:

* [GitHub Repository](https://github.com/verge-io/terraform-provider-vergeio) for the VergeIO Terraform Provider.
* [Terraform Registry Documentation](https://registry.terraform.io/providers/verge-io/vergeio/latest) for official usage and updates.

***

## Example Usage

For more detailed usage examples, check the [docs folder](https://github.com/verge-io/terraform-provider-vergeio/tree/main/docs) in the GitHub repository.

### Example Configuration

```hcl
provider "vergeio" {
  host     = "https://some_url_or_ip"
  username = "my_user"
  password = "my_password"
  insecure = false  # Use true if using self-signed SSL certificates
}

resource "vergeio_vm" "new_vm" {
  name        = "NEW VM"
  description = "NEW TF VM"
  enabled     = true
  os_family   = "linux"
  cpu_cores   = 4
  machine_type = "q35"
  ram         = 8192
}
```

### Initializing and Applying

To apply the configuration:

```bash
terraform init && terraform apply
```

Configuration Reference

```
host (Required): URL or IP address for the VergeOS system or tenant.
username (Required): Username for the VergeOS system or tenant.
password (Required): Password for the provided username.
insecure (Optional): Set to true for systems using self-signed SSL certificates.
```

### Resources

The following VergeOS resources can be managed via Terraform:

```
vergeio_drive
vergeio_member
vergeio_network
vergeio_nic
vergeio_user
vergeio_vm
```

### Data Sources

The following data sources are available for querying VergeOS resources:

```
vergeio_clusters
vergeio_groups
vergeio_mediasources
vergeio_networks
vergeio_nodes
vergeio_version
vergeio_vms
```

## Testing a Sample Configuration

To test your configuration, create a main.tf file in your Terraform workspace:

```hcl

terraform {
  required_providers {
    vergeio = {
      source = "vergeio/cloud/vergeio"
    }
  }
}

provider "vergeio" {
  host     = "https://someURLorIP"
  username = "username"
  password = "password"
}

resource "vergeio_vm" "new_vm" {
  name        = "NEW VM"
  description = "NEW TF VM"
  enabled     = true
  os_family   = "linux"
  cpu_cores   = 4
  machine_type = "q35"
  ram         = 8192
}
```

Then, run the following command:

```bash

terraform init && terraform apply
```

***

{% hint style="info" %}
**Document Information**

* Last Updated: 2024-09-03
* VergeOS Version: 4.12.6
  {% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.vergeos-demo.com/knowledge-base/automation-api/terraform-vergeio-provider.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
