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

# Nhà cung cấp Terraform VergeIO

Tham số **Nhà cung cấp Terraform VergeIO** cho phép tích hợp và tự động hóa hạ tầng VergeOS với **Terraform**. Nó cho phép người dùng định nghĩa, quản lý và mở rộng các tài nguyên VergeOS như một phần của quy trình Infrastructure as Code (IaC).

Để xem tài liệu và ví dụ mới nhất của nhà cung cấp, vui lòng tham khảo:

* [Kho lưu trữ GitHub](https://github.com/verge-io/terraform-provider-vergeio) cho Nhà cung cấp Terraform VergeIO.
* [Tài liệu Terraform Registry](https://registry.terraform.io/providers/verge-io/vergeio/latest) cho hướng dẫn sử dụng chính thức và các bản cập nhật.

***

## Ví dụ sử dụng

Để xem thêm các ví dụ sử dụng chi tiết hơn, hãy kiểm tra [thư mục docs](https://github.com/verge-io/terraform-provider-vergeio/tree/main/docs) trong kho lưu trữ GitHub.

### Cấu hình mẫu

```hcl
provider "vergeio" {
  host     = "https://some_url_or_ip"
  username = "my_user"
  password = "my_password"
  insecure = false  # Đặt là true nếu đang dùng chứng chỉ SSL tự ký
}

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
}
```

### Khởi tạo và áp dụng

Để áp dụng cấu hình:

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

Tham chiếu cấu hình

```
host (Bắt buộc): URL hoặc địa chỉ IP của hệ thống hoặc tenant VergeOS.
username (Bắt buộc): Tên người dùng của hệ thống hoặc tenant VergeOS.
password (Bắt buộc): Mật khẩu cho tên người dùng đã cung cấp.
insecure (Tùy chọn): Đặt là true đối với các hệ thống sử dụng chứng chỉ SSL tự ký.
```

### Tài nguyên

Các tài nguyên VergeOS sau đây có thể được quản lý qua Terraform:

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

### Nguồn dữ liệu

Các nguồn dữ liệu sau đây có sẵn để truy vấn các tài nguyên VergeOS:

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

## Kiểm tra cấu hình mẫu

Để kiểm tra cấu hình của bạn, hãy tạo một tệp main.tf trong workspace Terraform của bạn:

```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
}
```

Sau đó, chạy lệnh sau:

```bash

terraform init && terraform apply
```

***

{% hint style="info" %}
**Thông tin tài liệu**

* Cập nhật lần cuối: 2024-09-03
* Phiên bản VergeOS: 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, and the optional `goal` query parameter:

```
GET https://docs.verge.io/knowledge-base/vi/automation-api/terraform-vergeio-provider.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
