> ## Documentation Index
> Fetch the complete documentation index at: https://biznetgio.creations.ren/llms.txt
> Use this file to discover all available pages before exploring further.

# NEO Lite (Terraform)

> Terraform resources and data sources for NEO Lite VPS

NEO Lite is Biznet GIO's KVM VPS product, exposed through the `/neolites` API group. The typical workflow chains the catalog data sources into a create: products → OS list → keypair → VM.

<Info>
  Every create/upgrade places a **real paid order**. Read the [billing guide](/guides/billing) for `cycle` values and `pay_with_credit_card` semantics.
</Info>

## `biznetgio_neolite_vm`

Orders a NEO Lite VM, waits until `Active`, and manages name, keypair, package, storage, power state, and OS rebuild in place.

```hcl theme={null}
data "biznetgio_neolite_products" "all" {}

data "biznetgio_neolite_os_list" "ubuntu" {
  product_id = data.biznetgio_neolite_products.all.products[0].product_id
}

resource "biznetgio_neolite_keypair" "main" {
  name = "neo-lite-key"
}

resource "biznetgio_neolite_vm" "main" {
  ssh_and_console_user = "admin"
  console_password     = "s3cretP4ssw0rd"
  vm_name              = "neo-lite-1"
  product_id           = data.biznetgio_neolite_products.all.products[0].product_id
  select_os            = data.biznetgio_neolite_os_list.ubuntu.oss[0].name
  keypair_id           = biznetgio_neolite_keypair.main.keypair_id
  cycle                = "m"

  # optional in-place actions (change value to fire):
  # power_state = "stop"
  # rebuild_os  = "ubuntu-22"
  # migrate_to_pro = "12345"   # neolite-pro product id
  # disk_size  = 100           # absolute GB target, grow-only
}
```

| Name                                  | Type   | Mode                | Notes                                                                                 |
| ------------------------------------- | ------ | ------------------- | ------------------------------------------------------------------------------------- |
| `id`                                  | string | computed            | equals `account_id`                                                                   |
| `ssh_and_console_user`                | string | required            | 6-32 chars, `[a-zA-Z0-9\-.]`; create-only                                             |
| `console_password`                    | string | required, sensitive | ≥8 chars, alphanumeric with upper+lower+digit; create-only                            |
| `product_id`                          | int64  | required            | from `biznetgio_neolite_products`; change triggers change-package                     |
| `select_os`                           | string | required            | from `biznetgio_neolite_os_list`; create-only (OS change = `rebuild_os`)              |
| `keypair_id`                          | int64  | required            | from `biznetgio_neolite_keypair`; change triggers change-keypair                      |
| `cycle`                               | string | required            | `m a q s b t p4 p5`; create-only                                                      |
| `vm_name`                             | string | optional            | default `server-name`; 6-16 chars; updatable                                          |
| `description`                         | string | optional            | default `""`; create-only                                                             |
| `pay_with_credit_card`                | bool   | optional            | default `true`; `false` leaves the invoice unpaid                                     |
| `promocode`                           | string | optional            | create-only                                                                           |
| `power_state`                         | string | optional            | `start stop suspend resume shutdown`; API called only on change                       |
| `rebuild_os`                          | string | optional            | one-shot destructive OS reinstall; change value to re-fire                            |
| `migrate_to_pro`                      | string | optional            | one-shot migration; value = NEO Lite Pro `product_id`                                 |
| `disk_size`                           | int64  | optional            | absolute GB target, grow-only                                                         |
| `status`                              | string | computed            | `Active` / `Pending` / `Suspended` / `Terminated`                                     |
| `order_id`                            | string | computed            | invoice order id                                                                      |
| `uptime`                              | int64  | computed            | seconds                                                                               |
| `maxdisk` / `maxmem` / `mem` / `cpus` | int64  | computed            | capacity and current usage                                                            |
| `ciuser`                              | string | computed            | cloud-init user                                                                       |
| `cipassword`                          | string | computed, sensitive | cloud-init password                                                                   |
| `osname`                              | string | computed            | installed OS                                                                          |
| `region` / `region_label`             | string | computed            |                                                                                       |
| `next_due`                            | string | computed            | next billing date                                                                     |
| `recurring_amount`                    | int64  | computed            |                                                                                       |
| `billingcycle`                        | string | computed            |                                                                                       |
| `product_name`                        | string | computed            |                                                                                       |
| `last_invoice`                        | block  | computed            | `id`, `paid_id`, `status`, `date`, `duedate`, `paybefore`, `datepaid`, `invoice_type` |
| `raw`                                 | string | computed, sensitive | last API response JSON, secrets redacted                                              |
| `timeouts`                            | block  | optional            | create/update/delete, defaults 20m/20m/10m                                            |

Import with the numeric account id: `terraform import biznetgio_neolite_vm.main 12345`.

## `biznetgio_neolite_keypair`

SSH keypair in the NEO Lite pool. Key material is generated server-side; the private key appears only once, in the create response.

```hcl theme={null}
resource "biznetgio_neolite_keypair" "main" {
  name = "neo-lite-key"
}
```

| Name          | Type   | Mode                | Notes                                       |
| ------------- | ------ | ------------------- | ------------------------------------------- |
| `id`          | string | computed            | equals `keypair_id`                         |
| `name`        | string | required            | create-only                                 |
| `keypair_id`  | int64  | computed            |                                             |
| `public_key`  | string | computed            | server-generated                            |
| `private_key` | string | computed, sensitive | returned once at create; preserved in state |

Updates are rejected - change `name` to recreate. Import with the keypair id. Keypairs are per-service: NEO Lite keypairs cannot be used on NEO Lite Pro, NEO Metal, or NEO GPU.

## `biznetgio_neolite_snapshot`

Paid snapshot of a NEO Lite VM. Snapshots have their own account id and cannot be updated.

```hcl theme={null}
resource "biznetgio_neolite_snapshot" "main" {
  neolite_account_id = biznetgio_neolite_vm.main.id
  name               = "snapshot-1"
  description        = "pre-upgrade snapshot"
  cycle              = "m"
}
```

| Name                   | Type   | Mode     | Notes                               |
| ---------------------- | ------ | -------- | ----------------------------------- |
| `id`                   | string | computed | equals snapshot `account_id`        |
| `neolite_account_id`   | int64  | required | VM to snapshot                      |
| `cycle`                | string | required | `m a q s b t p4 p5`                 |
| `name`                 | string | optional | default `snapshot-name`; 6-16 chars |
| `description`          | string | optional | default `""`                        |
| `pay_with_credit_card` | bool   | optional | default `true`                      |
| `promocode`            | string | optional |                                     |
| `status`               | string | computed |                                     |
| `order_id`             | string | computed |                                     |
| `timeouts`             | block  | optional | create/delete                       |

All inputs are create-only; any change recreates the snapshot. Import with the snapshot account id.

## `biznetgio_neolite_vm_from_snapshot`

Restores a snapshot into a brand-new NEO Lite VM. Deleting this resource deletes the new VM (never the snapshot).

```hcl theme={null}
resource "biznetgio_neolite_vm_from_snapshot" "main" {
  snapshot_id          = biznetgio_neolite_snapshot.main.id
  product_id           = data.biznetgio_neolite_products.all.products[0].product_id
  cycle                = "m"
  keypair_id           = biznetgio_neolite_keypair.main.keypair_id
  name                 = "restored-1"
  ssh_and_console_user = "admin"
  console_password     = "s3cretP4ssw0rd"
}
```

| Name                   | Type   | Mode                | Notes                         |
| ---------------------- | ------ | ------------------- | ----------------------------- |
| `id`                   | string | computed            | account id of the restored VM |
| `snapshot_id`          | int64  | required            | source snapshot account id    |
| `product_id`           | int64  | required            |                               |
| `cycle`                | string | required            | `m a q s b t p4 p5`           |
| `keypair_id`           | int64  | required            |                               |
| `name`                 | string | required            | 6-16 chars                    |
| `ssh_and_console_user` | string | required            |                               |
| `console_password`     | string | required, sensitive |                               |
| `description`          | string | optional            | default `""`                  |
| `promocode`            | string | optional            |                               |
| `pay_with_credit_card` | bool   | optional            | default `true`                |
| `status`               | string | computed            |                               |
| `order_id`             | string | computed            |                               |
| `timeouts`             | block  | optional            | create/delete                 |

All inputs are create-only. Import with the restored VM's account id.

## `biznetgio_neolite_disk`

Additional (extra) disk attached to a NEO Lite VM. Size is grow-only and upgrades send the increment, not the absolute value.

```hcl theme={null}
resource "biznetgio_neolite_disk" "main" {
  product_id           = 60
  cycle                = "m"
  neolite_account_id   = biznetgio_neolite_vm.main.id
  service_name         = "extra-disk"
  size                 = 60
}
```

| Name                   | Type   | Mode                | Notes                                  |
| ---------------------- | ------ | ------------------- | -------------------------------------- |
| `id`                   | string | computed            | equals disk `account_id`               |
| `product_id`           | int64  | required            | from `GET /neolites/disks/products`    |
| `cycle`                | string | required            | `m a q s b t p4 p5`                    |
| `neolite_account_id`   | int64  | required            | target VM                              |
| `service_name`         | string | optional            | default `service-name`; 6-16 chars     |
| `size`                 | int64  | optional            | default `60` GB, minimum 60, grow-only |
| `promocode`            | string | optional            |                                        |
| `pay_with_credit_card` | bool   | optional            | default `true`                         |
| `status`               | string | computed            |                                        |
| `order_id`             | string | computed            |                                        |
| `raw`                  | string | computed, sensitive |                                        |
| `timeouts`             | block  | optional            | create/update/delete                   |

Import with the disk account id.

## Data sources

### `biznetgio_neolite_products`

The product catalog - use it to fill `product_id`.

```hcl theme={null}
data "biznetgio_neolite_products" "all" {}
```

`products` list items: `product_id`, `name`, `description`, `category_id`, `category_name`, plus `options` (`type`, `cores`, `memory` MB, `allow_downgrade`) and nested `billing` (`label`, `cycle`, `price`, and per-component price steps).

### `biznetgio_neolite_os_list`

Available OS images for a product - use `oss[].name` to fill `select_os`.

```hcl theme={null}
data "biznetgio_neolite_os_list" "ubuntu" {
  product_id = 123
}
```

Argument: `product_id` (required). `oss` list items: `vmid`, `node`, `name`, `maxmem`, `maxcpu`.

### `biznetgio_neolite_change_package_options`

Target packages and prices for an account's change-package operation. The upstream response is unmodeled, so it is exported as `raw` JSON.

```hcl theme={null}
data "biznetgio_neolite_change_package_options" "opts" {
  account_id = biznetgio_neolite_vm.main.id
}
```

### `biznetgio_neolite_storage_upgrade_options`

Per-GB storage upgrade pricing for an account; exported as `raw` JSON. Argument: `account_id`.

### `biznetgio_neolite_ip_availability`

Checks public-IP availability for a product.

```hcl theme={null}
data "biznetgio_neolite_ip_availability" "check" {
  product_id = 123
}
```

Returns `available` (bool).
