Oscar Hermoso 30823b573c 🐛 Recover from a server that no longer exists
Fixes #69, which regressed when the read was extracted into
fetchServerResourceState: it reports diagnostics, and a diagnostic can only fail
the read, so the 404 handling added in #71 was lost. A server deleted outside of
Terraform failed every plan until the state was edited by hand.

fetchServerResourceState now returns an error, and errServerNotFound for a 404,
which Read turns back into removing the resource from state. Create and Update
treat it like any other read failure, since the server is meant to exist there.
Delete treats a 404 as the success it describes, for the paths that reach it
without a refresh first: `-refresh=false`, or a server deleted in between.

Also fixes the advanced features conversion overwriting the diagnostics gathered
before it.

TestServerResourceDeletedOutOfBand covers the read: it deletes the server
through the API and refreshes, which fails against the code before this commit.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-23 13:26:10 +08:00
2024-08-31 11:48:43 +08:00
2024-08-12 18:07:23 +08:00
2025-04-25 09:10:20 +08:00
2024-09-01 08:17:56 +08:00

terraform-provider-binarylane

See the documentation on the Terraform Registry, or see examples in the examples directory.

resource "binarylane_server" "example" {
  region            = "per"
  image             = "ubuntu-24.04"
  size              = "std-min"
  public_ipv4_count = 1
}

Progress

Planned features:

  • Servers
    • Firewall Rules
    • Cloud Init
    • Updating server properties
    • "Advanced Features"
    • IPV6
    • Customised Backups
    • Software
    • Alerts
  • SSH Keys
  • Virtual Private Cloud
  • Load Balancers
  • Images
  • DNS
  • Docs
    • Generated docs
    • Review & fill out remaining descriptions
    • Include examples in docs
  • Examples
    • Basic
    • Cloud Init
    • K3s
    • NixOS
    • Virtual Private Cloud

Server parameters

Regions

curl for regions
curl -X GET "https://api.binarylane.com.au/v2/regions" \
  -H "Authorization: Bearer $BINARYLANE_API_TOKEN" > tmp/regions.json

jq '[ .regions[] | .slug ] | sort' tmp/regions.json
[
  "adl",
  "bne",
  "mel",
  "per",
  "sin",
  "syd"
]

Images

curl for images
curl -X GET "https://api.binarylane.com.au/v2/images?type=distribution&&page=1&per_page=200" \
  -H "Authorization: Bearer $BINARYLANE_API_TOKEN" > tmp/images.json

jq '[ .images[] | .slug ] | sort' tmp/images.json
[
  "alma-10",
  "alma-8",
  "alma-9",
  "byo-os",
  "byo-os-uefi",
  "byo-os-virtio-disabled",
  "cpanel-plus-whm",
  "debian-11",
  "debian-12",
  "debian-13",
  "rocky-10",
  "rocky-9",
  "ubuntu-20.04.6",
  "ubuntu-22.04",
  "ubuntu-22.04-desktop",
  "ubuntu-24.04",
  "ubuntu-24.04-neon-desktop",
  "ubuntu-26.04",
  "windows-2016",
  "windows-2016-sql-2016-web",
  "windows-2019",
  "windows-2019-sql-2017-std",
  "windows-2019-sql-2017-web",
  "windows-2022",
  "windows-2022-sql-2019-std",
  "windows-2022-sql-2019-web",
  "windows-2025"
]

Sizes

curl for sizes
curl -X GET "https://api.binarylane.com.au/v2/sizes" \
  -H "Authorization: Bearer $BINARYLANE_API_TOKEN" > tmp/sizes.json

jq '[ .sizes[] | .slug ] | sort' tmp/sizes.json
[
  "cpu-2thr",
  "cpu-4thr",
  "cpu-6thr",
  "cpu-8thr",
  "ded-7900x-800gb",
  "ded-e2136-400gb",
  "ded-e2136-800gb",
  "ded-e2288g-800gb",
  "hdd-1000gb",
  "hdd-2000gb",
  "hdd-4000gb",
  "hdd-500gb",
  "hdd-6000gb",
  "hdd-8000gb",
  "std-1vcpu",
  "std-2vcpu",
  "std-4vcpu",
  "std-6vcpu",
  "std-8vcpu",
  "std-min"
]
S
Description
Pull mirror of github.com/oscarhermoso/terraform-provider-binarylane, the Terraform provider for BinaryLane
Readme MIT 1.3 MiB
Languages
Go 92%
Shell 8%