Files
terraform-provider-binarylane/examples/ssh/main.tf
T
2024-08-16 17:38:04 +08:00

31 lines
869 B
Terraform

terraform {
required_providers {
binarylane = {
source = "oscarhermoso/binarylane"
}
}
}
provider "binarylane" {
# api_url = "" # Defaults to "https://api.binarylane.com"
# api_token = "" # Recommend setting with environment variable BINARYLANE_API_TOKEN
}
resource "binarylane_ssh_key" "example" {
name = "test-user"
public_key = file("./id_ed25519.pub") # Likely "~/.ssh/id_ed25519.pub"
default = true # Currently, the server will only register SSH keys that are added as global defaults
}
resource "binarylane_server" "example" {
name = "tf-example"
region = "per"
image = "ubuntu-24.04"
size = "std-min"
depends_on = [binarylane_ssh_key.example] # Wait for SSH key to be created as a global default
# TODO: Extend provider with "ssh_key_id" option for explicit registraton of keys
}