20 lines
511 B
HCL
20 lines
511 B
HCL
# Create a new SSH key
|
|
resource "digitalocean_ssh_key" "default" {
|
|
name = "Terraform Example"
|
|
public_key = file("./tf-digitalocean.pub")
|
|
}
|
|
|
|
# Create a new Web Droplet in the nyc2 region
|
|
resource "digitalocean_droplet" "web" {
|
|
image = "ubuntu-22-04-x64"
|
|
name = "wireguard"
|
|
region = "nyc1"
|
|
size = "s-2vcpu-4gb"
|
|
ssh_keys = [digitalocean_ssh_key.default.fingerprint]
|
|
user_data = file("setup.sh")
|
|
}
|
|
|
|
output "droplet_output" {
|
|
value = digitalocean_droplet.web.ipv4_address
|
|
}
|