-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
41 lines (35 loc) · 1.17 KB
/
main.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
terraform {
required_providers {
binarylane = {
source = "oscarhermoso/binarylane"
}
}
}
provider "binarylane" {}
/**
* This example uses the public key in the git repository, but your SSH key will
* be different. You can use the following command to generate a new key pair:
*
* ssh-keygen -t ed25519 -C "[email protected]"
*
* Then, update the "public_key" attribute to point to the location of your
* generated public key.
*/
resource "binarylane_ssh_key" "example" {
name = "tf-example-ssh"
public_key = file("./id_ed25519.pub") # Change to "~/.ssh/id_ed25519.pub"
# You also have the option to register an SSH key as a global default, for any
# new VM but it is not the recommended approach.
# default = false
}
resource "binarylane_server" "example" {
name = "tf-example-ssh"
region = "per"
image = "ubuntu-24.04"
size = "std-min"
ssh_keys = [binarylane_ssh_key.example.id]
public_ipv4_count = 1
# If you are using a global default SSH key, you need to explicitly wait for
# it to be created before creating the server.
# depends_on = [binarylane_ssh_key.example]
}