> 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/automate-protect-and-extend/integrations-and-apis/terraform-provider.md).

# VergeOS Terraform Provider

## Overview

The VergeOS Terraform Provider enables infrastructure-as-code management of your VergeOS environment. This provider allows you to define, deploy, and manage VergeOS resources using Terraform configurations, providing automation capabilities for your virtual infrastructure management.

## Key Features

* Automated provisioning of VergeOS virtual machines, networks, drives, and users
* Infrastructure-as-code workflows for VergeOS environments
* Version-controlled infrastructure deployments
* Integration with existing Terraform and OpenTofu workflows
* Reproducible environment creation and management

## Installation and Configuration

To use the VergeOS Terraform Provider, add the following to your Terraform configuration:

```hcl
terraform {
  required_providers {
    vergeio = {
      source = "verge-io/vergeio"
      version = "~> 0.1.0"
    }
  }
}

provider "vergeio" {
  host     = "your-vergeos-ip-or-hostname"
  username = "your-username"
  password = "your-password"
}
```

For OpenTofu users, the configuration remains the same:

```hcl
terraform {
  required_providers {
    vergeio = {
      source = "verge-io/vergeio"
      version = "~> 0.1.0"
    }
  }
}
```

## Available Resources

The provider supports management of the following VergeOS resources:

* `vergeio_vm` - Create and manage virtual machines
* `vergeio_network` - Configure and manage virtual networks
* `vergeio_user` - Provision and manage storage resources

## Usage Examples

### Creating a Virtual Machine

```hcl
resource "vergeio_vm" "example" {
  name        = "example-vm"
  cpu_cores   = 2
  ram         = 4096  # MB
  description = "Example VM created by Terraform"

  
  vergeio_drive {
    disksize            = 20  #GB
    interface           = "virtio-scsi"
    preferred_tier      = 2
  }
  
  vergeio_nic {
    vnet       = vergeio_network.example.id
    interface  = "virtio"
  }
}
```

### Configuring a Network

```hcl
resource "vergeio_network" "example" {
  name             = "example-internal-network"
  network_address  = "192.168.1.0/24"
  dns_server_list  = ["8.8.8.8", "8.8.4.4"]
  dhcp_enabled     = true
  dhcp_start       = "192.168.1.100"
  dhcp_end         = "192.168.1.200"
  }
}
```

## Documentation and Resources

For complete documentation, including all supported resources, data sources, and detailed usage examples, please visit the official provider documentation:

* [Terraform Registry Documentation](https://registry.terraform.io/providers/verge-io/vergeio/latest/docs){target="\_blank"}
* [OpenTofu Registry Documentation](https://search.opentofu.org/provider/verge-io/vergeio/latest){target="\_blank"}
* [GitHub Repository](https://github.com/verge-io/terraform-provider-vergeio){target="\_blank"}

## Support

If you encounter issues or have feature requests, please open an issue on the GitHub repository:

<https://github.com/verge-io/terraform-provider-vergeio/issues>{target="\_blank"}

## Additional Resources

* [Terraform Documentation](https://developer.hashicorp.com/terraform/docs){target="\_blank"}
* [OpenTofu Documentation](https://opentofu.org/docs/){target="\_blank"}
* [Infrastructure as Code Best Practices](https://www.hashicorp.com/resources/what-is-infrastructure-as-code){target="\_blank"}


---

# 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/automate-protect-and-extend/integrations-and-apis/terraform-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.
