-
Clone this gist using the URL from the address bar
-
Run
terraform init -
Configure terraform variables as needed by updating the
main.tfvarsfile:Variable Description Default do_tokenDigitalocean API token None do_domainPublic domain used for the faasd gateway None letsencrypt_emailEmail used by when ordering TLS certificate from Letsencrypt ""do_create_recordWhen set to true, a new DNS record will be created. This works only if your domain (do_domain) is managed by Digitaloceanfalsedo_regionDigitalocean region for creating the droplet fra1ssh_key_filePath to public SSH key file ~/.ssh/id_rsa.pub
Environment variables can also be used to set terraform variables when running the
terraform applycommand using the formatTF_VAR_name.
-
Run
terraform apply- Add
-var-file=main.tfvarsif you have set the variables inmain.tfvars. - OR use environment variables for setting the terraform variables when running the
applycommand
- Add
-
View the output for the login command and gateway URL i.e.
droplet_ip = 178.128.39.201
gateway_url = https://faasd.example.com/
login_cmd = faas-cli login -g https://faasd.example.com/ -p rvIU49CEcFcHmqxj
password = rvIU49CEcFcHmqxj
- Use your browser to access the OpenFaaS interface
Note that the user-data may take a couple of minutes to come up since it will be pulling in various components and preparing the machine. Also take into consideration the DNS propagation time for the new DNS record.
A single host with 1GB of RAM will be deployed for you, to remove at a later date simply use terraform destroy.