> ## 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 Metal (Terraform)

> Resource dan data source Terraform buat server bare-metal NEO Metal

NEO Metal itu produk bare-metal dedicated-nya Biznet GIO (`/baremetals` API group). Halaman ini juga bahas add-on-nya: additional (floating) IP sama NEO Elastic Storage.

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

## `biznetgio_baremetal`

Order server bare-metal, nunggu sampe `Active`, dan manage label, power state, reset, sama rebuild OS.

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

resource "biznetgio_baremetal_keypair" "main" {
  name = "neo-metal-key"
}

resource "biznetgio_baremetal" "main" {
  product_id = data.biznetgio_baremetal_products.all.products[0].product_id
  cycle      = "m"
  select_os  = "ubuntu-22"
  keypair_id = biznetgio_baremetal_keypair.main.keypair_id
  label      = "neo-metal-main"
  public_ip  = 1

  # optional in-place actions (change value to fire):
  # power_state = "off"
  # reset_trigger = "reboot-1"
  # rebuild_os   = "centos7-base"
}
```

| Name                   | Type   | Mode                | Notes                                                                              |
| ---------------------- | ------ | ------------------- | ---------------------------------------------------------------------------------- |
| `id`                   | string | computed            | sama dengan `account_id`                                                           |
| `product_id`           | int64  | required            | dari `biznetgio_baremetal_products`                                                |
| `cycle`                | string | required            | `m` bulanan / `a` tahunan                                                          |
| `select_os`            | string | optional            | default `ubuntu-22`; create-only                                                   |
| `keypair_id`           | int64  | required            | dari `biznetgio_baremetal_keypair`; create-only                                    |
| `label`                | string | required            | display name - satu-satunya field yang bisa di-update                              |
| `public_ip`            | int64  | optional            | default `1`; create-only                                                           |
| `promocode`            | string | optional            | create-only                                                                        |
| `pay_with_credit_card` | bool   | optional            | default `true`                                                                     |
| `power_state`          | string | optional            | `on` / `off`; API dipanggil cuma pas berubah                                       |
| `reset_trigger`        | string | optional            | one-shot reset; ganti value buat re-fire                                           |
| `rebuild_os`           | string | optional            | reinstall OS (destructive); value valid dari `biznetgio_baremetal_rebuild_os_list` |
| `status`               | string | computed            |                                                                                    |
| `order_id`             | string | computed            |                                                                                    |
| `ip_address`           | string | computed            |                                                                                    |
| `created_at`           | string | computed            |                                                                                    |
| `raw`                  | string | computed, sensitive | secrets di-redact                                                                  |
| `timeouts`             | block  | optional            | create/update/delete                                                               |

Import pake numeric account id.

## `biznetgio_baremetal_keypair`

SSH keypair di pool NEO Metal. Isi `public_key` buat import keypair sendiri; kalo dikosongin, keypair digenerate server-side.

```hcl theme={null}
resource "biznetgio_baremetal_keypair" "main" {
  name       = "neo-metal-key"
  public_key = "ssh-rsa AAAAB3NzaC1yc2E..."  # optional: import; omit to generate
}
```

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

Update gak ngapa-ngapain - semua input create-only. Import pake keypair id.

## `biznetgio_baremetal_additional_ip`

Order additional (floating) IP, independen dari server mana pun. Nempelnya pake `biznetgio_baremetal_additional_ip_assignment`.

```hcl theme={null}
resource "biznetgio_baremetal_additional_ip" "main" {
  product_id = 10
  cycle      = "m"
  region     = "wjv-1"
}
```

| Name                   | Type   | Mode                | Notes                                                         |
| ---------------------- | ------ | ------------------- | ------------------------------------------------------------- |
| `id`                   | string | computed            | sama dengan `account_id`                                      |
| `product_id`           | int64  | required            | dari `GET /baremetal-additional-ips/products`                 |
| `cycle`                | string | required            | `m` / `a`                                                     |
| `region`               | string | optional            | default `wjv-1`; dari `GET /baremetal-additional-ips/regions` |
| `promocode`            | string | optional            |                                                               |
| `pay_with_credit_card` | bool   | optional            | default `true`                                                |
| `status`               | string | computed            |                                                               |
| `ip_address`           | string | computed            |                                                               |
| `created_at`           | string | computed            |                                                               |
| `raw`                  | string | computed, sensitive |                                                               |
| `timeouts`             | block  | optional            | create/delete                                                 |

Import pake numeric account id.

## `biznetgio_baremetal_additional_ip_assignment`

Nempelin additional IP ke server bare-metal. Pindah target = destroy + recreate.

```hcl theme={null}
resource "biznetgio_baremetal_additional_ip_assignment" "main" {
  additional_ip_id = biznetgio_baremetal_additional_ip.main.id
  metal_account_id = biznetgio_baremetal.main.id
}
```

| Name               | Type   | Mode                | Notes                                             |
| ------------------ | ------ | ------------------- | ------------------------------------------------- |
| `id`               | string | computed            | composite `<metal_account_id>:<additional_ip_id>` |
| `additional_ip_id` | int64  | required            | dari `biznetgio_baremetal_additional_ip`          |
| `metal_account_id` | int64  | required            | account id server target                          |
| `status`           | string | computed            |                                                   |
| `raw`              | string | computed, sensitive |                                                   |

**Format Import ID:** `<metal_account_id>:<additional_ip_id>`, contohnya `terraform import biznetgio_baremetal_additional_ip_assignment.main 12345:67890`.

## `biznetgio_baremetal_elastic_storage`

Volume NEO Elastic Storage, ke-ikat permanen ke satu server bare-metal pas create.

```hcl theme={null}
resource "biznetgio_baremetal_elastic_storage" "main" {
  product_id        = 20
  cycle             = "m"
  storage_name      = "metal-volume"
  metal_account_id  = biznetgio_baremetal.main.id
  size              = 100
}
```

| Name                   | Type   | Mode                | Notes                                    |
| ---------------------- | ------ | ------------------- | ---------------------------------------- |
| `id`                   | string | computed            | sama dengan `account_id` storage         |
| `product_id`           | int64  | required            | ganti = change-package                   |
| `cycle`                | string | required            | `m` / `a`; create-only                   |
| `storage_name`         | string | required            | create-only                              |
| `metal_account_id`     | int64  | required            | create-only - gak ada endpoint re-attach |
| `size`                 | int64  | optional            | default `100` GB, cuma bisa naik         |
| `promocode`            | string | optional            | create-only                              |
| `pay_with_credit_card` | bool   | optional            | default `true`                           |
| `status`               | string | computed            |                                          |
| `created_at`           | string | computed            |                                          |
| `raw`                  | string | computed, sensitive |                                          |
| `timeouts`             | block  | optional            | create/update/delete                     |

Import pake numeric account id.

## Data sources

### `biznetgio_baremetal_products`

Katalog server (`GET /baremetals/products`). Item `products`: `product_id`, `name`, `description`, `raw`.

### `biznetgio_baremetal_rebuild_os_list`

OS image valid buat rebuild server.

```hcl theme={null}
data "biznetgio_baremetal_rebuild_os_list" "ubuntu" {
  account_id = biznetgio_baremetal.main.id
}
```

Return `oss` (list of strings, contohnya `centos7-base`) dan `raw`.

### `biznetgio_baremetal_openvpn`

Konfigurasi akses OpenVPN out-of-band (`GET /baremetals/openvpn`). Return `config` (sensitive) dan `raw`.
