Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save timoyuen/4df671b6bb94ec648394fae95e7b2400 to your computer and use it in GitHub Desktop.
Save timoyuen/4df671b6bb94ec648394fae95e7b2400 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