This example project will raise an rstudio-server instance on DigitalOcean using terraform with digitalocean provider.
Add custom variables and override default parameters using a *.tfvars
file
(not tracked and not to be tracked in this repository). For example:
MY_IP_ADDRESS = <your ip address>
DO_TOKEN = <your token>
SIZE = "s-1vcpu-2gb"
DOMAIN_NAME = <your digitalocean managed domain>
Take a look to variables.tf
to customize your instance according your needs.
# planning changes and write them into a file
$ terraform plan -out changes.tfplan
# apply changes from a file
$ terraform apply "changes.tfplan"
# display terraform state to output
$ terraform show
# execute output instructions only
$ terraform output
Plan changes and then destroy:
$ terraform plan -out changes.tfplan -destroy
$ terraform apply "changes.tfplan"
Or destroy all resources with a single command :
$ terraform destroy