You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
933 B

  1. #Terraform Configuration
  2. variable "DO_API_TOKEN" {
  3. description = "DigitalOcean Access Token"
  4. }
  5. variable "TESTNET_NAME" {
  6. description = "Name of the cluster/testnet"
  7. default = "tf-testnet1"
  8. }
  9. variable "ssh_keys" {
  10. description = "SSH keys provided in DigitalOcean to be used on the nodes"
  11. # curl -X GET -H "Content-Type: application/json" -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" "https://api.digitalocean.com/v2/account/keys"
  12. default = ["9495227"]
  13. }
  14. variable "servers" {
  15. description = "Number of nodes in cluster"
  16. default = "4"
  17. }
  18. provider "digitalocean" {
  19. token = "${var.DO_API_TOKEN}"
  20. }
  21. module "cluster" {
  22. source = "./cluster"
  23. name = "${var.TESTNET_NAME}"
  24. key_ids = "${var.ssh_keys}"
  25. servers = "${var.servers}"
  26. }
  27. output "public_ips" {
  28. value = "${module.cluster.public_ips}"
  29. }
  30. #output "floating_ips" {
  31. # value = "${module.cluster.floating_ips}"
  32. #}