> ## 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)

> Resource dan data source Terraform buat VPS NEO Lite

NEO Lite itu produk KVM VPS-nya Biznet GIO, di-expose lewat API group `/neolites`. Alur biasa ngerangkai data source katalog ke create: products → OS list → keypair → VM.

<Info>
  Setiap create/upgrade bikin **order berbayar beneran**. Baca [panduan billing](/guides/billing) buat nilai `cycle` dan semantics `pay_with_credit_card`.
</Info>

## `biznetgio_neolite_vm`

Order VM NEO Lite, nunggu sampe `Active`, dan manage nama, keypair, paket, storage, power state, sama rebuild OS 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"

  # aksi in-place opsional (ganti value buat trigger):
  # power_state = "stop"
  # rebuild_os  = "ubuntu-22"
  # migrate_to_pro = "12345"   # product id neolite-pro
  # disk_size  = 100           # target GB absolut, cuma bisa naik
}
```

| Name                                  | Type   | Mode                | Notes                                                                                 |
| ------------------------------------- | ------ | ------------------- | ------------------------------------------------------------------------------------- |
| `id`                                  | string | computed            | sama dengan `account_id`                                                              |
| `ssh_and_console_user`                | string | required            | 6-32 char, `[a-zA-Z0-9\-.]`; create-only                                              |
| `console_password`                    | string | required, sensitive | ≥8 char, alphanumeric dengan upper+lower+digit; create-only                           |
| `product_id`                          | int64  | required            | dari `biznetgio_neolite_products`; ganti = change-package                             |
| `select_os`                           | string | required            | dari `biznetgio_neolite_os_list`; create-only (ganti OS = `rebuild_os`)               |
| `keypair_id`                          | int64  | required            | dari `biznetgio_neolite_keypair`; ganti = change-keypair                              |
| `cycle`                               | string | required            | `m a q s b t p4 p5`; create-only                                                      |
| `vm_name`                             | string | optional            | default `server-name`; 6-16 char; bisa di-update                                      |
| `description`                         | string | optional            | default `""`; create-only                                                             |
| `pay_with_credit_card`                | bool   | optional            | default `true`; `false` = invoice nggak dibayar                                       |
| `promocode`                           | string | optional            | create-only                                                                           |
| `power_state`                         | string | optional            | `start stop suspend resume shutdown`; API dipanggil cuma pas berubah                  |
| `rebuild_os`                          | string | optional            | one-shot reinstall OS (destructive); ganti value buat re-fire                         |
| `migrate_to_pro`                      | string | optional            | one-shot migrasi; value = `product_id` NEO Lite Pro                                   |
| `disk_size`                           | int64  | optional            | target GB absolut, cuma bisa naik                                                     |
| `status`                              | string | computed            | `Active` / `Pending` / `Suspended` / `Terminated`                                     |
| `order_id`                            | string | computed            | id order invoice                                                                      |
| `uptime`                              | int64  | computed            | detik                                                                                 |
| `maxdisk` / `maxmem` / `mem` / `cpus` | int64  | computed            | kapasitas dan usage sekarang                                                          |
| `ciuser`                              | string | computed            | user cloud-init                                                                       |
| `cipassword`                          | string | computed, sensitive | password cloud-init                                                                   |
| `osname`                              | string | computed            | OS keinstall                                                                          |
| `region` / `region_label`             | string | computed            |                                                                                       |
| `next_due`                            | string | computed            | tanggal billing berikutnya                                                            |
| `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 | JSON response API terakhir, secrets di-redact                                         |
| `timeouts`                            | block  | optional            | create/update/delete, default 20m/20m/10m                                             |

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

## `biznetgio_neolite_keypair`

SSH keypair di pool NEO Lite. Key material digenerate server-side; private key muncul cuma sekali, di response create.

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

| Name          | Type   | Mode                | Notes                                       |
| ------------- | ------ | ------------------- | ------------------------------------------- |
| `id`          | string | computed            | sama dengan `keypair_id`                    |
| `name`        | string | required            | create-only                                 |
| `keypair_id`  | int64  | computed            |                                             |
| `public_key`  | string | computed            | digenerate server                           |
| `private_key` | string | computed, sensitive | return sekali pas create; disimpen di state |

Update ditolak - ganti `name` buat recreate. Import pake keypair id. Keypair itu per-service: keypair NEO Lite gak bisa dipake di NEO Lite Pro, NEO Metal, atau NEO GPU.

## `biznetgio_neolite_snapshot`

Snapshot berbayar dari VM NEO Lite. Snapshot punya account id sendiri dan gak bisa di-update.

```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 | sama dengan `account_id` snapshot  |
| `neolite_account_id`   | int64  | required | VM yang di-snapshot                |
| `cycle`                | string | required | `m a q s b t p4 p5`                |
| `name`                 | string | optional | default `snapshot-name`; 6-16 char |
| `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                      |

Semua input create-only; perubahan apa pun recreate snapshot. Import pake snapshot account id.

## `biznetgio_neolite_vm_from_snapshot`

Restore snapshot jadi VM NEO Lite baru. Hapus resource ini = hapus VM barunya (bukan snapshotnya).

```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 VM hasil restore |
| `snapshot_id`          | int64  | required            | account id snapshot sumber  |
| `product_id`           | int64  | required            |                             |
| `cycle`                | string | required            | `m a q s b t p4 p5`         |
| `keypair_id`           | int64  | required            |                             |
| `name`                 | string | required            | 6-16 char                   |
| `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               |

Semua input create-only. Import pake account id VM hasil restore.

## `biznetgio_neolite_disk`

Disk tambahan (extra) yang nempel ke VM NEO Lite. Size cuma bisa naik dan upgrade ngirim increment, bukan nilai absolut.

```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            | sama dengan `account_id` disk               |
| `product_id`           | int64  | required            | dari `GET /neolites/disks/products`         |
| `cycle`                | string | required            | `m a q s b t p4 p5`                         |
| `neolite_account_id`   | int64  | required            | VM target                                   |
| `service_name`         | string | optional            | default `service-name`; 6-16 char           |
| `size`                 | int64  | optional            | default `60` GB, minimal 60, cuma bisa naik |
| `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 pake disk account id.

## Data sources

### `biznetgio_neolite_products`

Katalog produk - pake buat isi `product_id`.

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

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

### `biznetgio_neolite_os_list`

List OS image yang tersedia buat produk - pake `oss[].name` buat isi `select_os`.

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

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

### `biznetgio_neolite_change_package_options`

Paket target dan harga buat operasi change-package akun. Response upstream belum ke-model, jadi di-export sebagai JSON `raw`.

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

### `biznetgio_neolite_storage_upgrade_options`

Harga upgrade storage per-GB buat akun; di-export sebagai JSON `raw`. Argument: `account_id`.

### `biznetgio_neolite_ip_availability`

Cek ketersediaan public IP buat produk.

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

Return `available` (bool).
