Skip to content

Latest commit

 

History

History
25 lines (18 loc) · 851 Bytes

README.md

File metadata and controls

25 lines (18 loc) · 851 Bytes

Infrastructure as Code

Most of this was created from this guide: https://www.digitalocean.com/community/tutorials/how-to-use-terraform-with-digitalocean#step-4-%E2%80%94-using-terraform-to-create-the-nginx-server

Everything is made to work via setting two environment variables. The DO_PAT is the digital ocean API token. The pvt_key is set to the key which should be rolled out to the deployed resources.

Commands:

To plan: terraform plan -var "do_token=${DO_PAT}" -var "pvt_key=$HOME/.ssh/id_rsa"

To apply: terraform apply -var "do_token=${DO_PAT}" -var "pvt_key=$HOME/.ssh/id_rsa"

To show state: terraform show terraform.tfstate

To destroy: terraform plan -destroy -out=terraform.tfplan \ -var "do_token=${DO_PAT}" \ -var "pvt_key=$HOME/.ssh/id_rsa" \

to make the destroy plan and terraform apply terraform.tfplan