Skip to content

nickvth/terraform-digitalocean

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Terraform plan to deploy centos7 droplet(s) at Digital Ocean

Requirements

  • Terraform
  • Account at Digital Ocean
  • Generated token at Digital Ocean
  • Ssh key added to your Digital Ocean account
  • Get your pub key fingerprint, use ssh-keygen -E md5 -lf when md5.
  • Enough credits on your Digital Ocean account :-)

Features

  • Deployment centos7 OS with terraform
  • System update to latest centos7

Instructions

Set environment variables

export DO_PAT=[your generated toke]
export SSH_FINGERPRINT="[your public key fingerprint]"
export TF_LOG=1

Check your infrastructure execution plan

terraform plan \ 
-var "do_token=${DO_PAT}" \ 
-var "pub_key=~/.ssh/id_rsa.pub" \
-var "pvt_key=~/.ssh/id_rsa" \
-var "ssh_fingerprint=$SSH_FINGERPRINT"

Apply your infrastructure execution plan

terraform apply \ 
-var "do_token=${DO_PAT}" \ 
-var "pub_key=~/.ssh/id_rsa.pub" \
-var "pvt_key=~/.ssh/id_rsa" \
-var "ssh_fingerprint=$SSH_FINGERPRINT"

Show your infrastructure setup

terraform show

digitalocean_droplet.centos7node1:
  id = 9639873
  image = centos-7-0-x64
  ipv4_address = [public ip]
  ipv4_address_private = [private ip]
  locked = false
  name = centos7node1
  private_networking = true
  region = ams3
  size = 512mb
  ssh_keys.# = 1
  ssh_keys.0 =  [your fingerprint]
  status = active
digitalocean_droplet.centos7node2:
  id = 9639874
  image = centos-7-0-x64
  ipv4_address = [public ip]
  ipv4_address_private = [private ip]
  locked = false
  name = centos7node2
  private_networking = true
  region = ams3
  size = 512mb
  ssh_keys.# = 1
  ssh_keys.0 = [your fingerprint]
  status = active

Reference(s)

About

deploy centos7 droplets on digitalocean

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages