By following the example repo, I managed to setup a simple example app by following Hashicorps guide.
I am summarizing the steps I took here for reference. For a more concrete explanation, check out the example docs.
- Get a DigitalOcean Token from here
- Run
export DIGITALOCEAN_ACCESS_TOKEN=<API TOKEN>
in your local shell cd terraform
- Generate a new SSH key pair
ssh-keygen -t rsa -C "<email>" -f ./terraform-digitalocean
- Copy over the generated public ssh into
terramino_app.yaml
- Initialize terraform using
terraform init
- Check what changes are gonna be done using
terraform plan
- Apply the changes using
terraform apply
The public IP of the resource will be outputted after command completion.
It is astounding how simple the process has become. This pull request has the changes I made for getting the app to work. To see the entire code base, click here.
Next Step
Once we provision the machine, we need to generate the inventory file that ansible needs from the output of terraformer.
One thought on “Setting up Terraform to provision a DigitalOcean Droplet”