Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save RajeshChouhan21/4ca9010402f9dac64507a19a574c4d4a to your computer and use it in GitHub Desktop.
Save RajeshChouhan21/4ca9010402f9dac64507a19a574c4d4a to your computer and use it in GitHub Desktop.
How to connect to server via SSH and use remote-exec provisioner.
resource "digitalocean_droplet" "web" {
image = "ubuntu-16-04-x64"
name = "web-1"
region = "sgp1"
size = "512mb"
ssh_keys = [12345]
connection {
type = "ssh"
user = "root"
private_key = "${file("~/.ssh/id_rsa")}"
}
provisioner "remote-exec" {
inline = [
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment