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.

56 lines
1.2 KiB

  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 $DO_API_TOKEN" "https://api.digitalocean.com/v2/account/keys"
  12. default = [
  13. "6259615",
  14. "7658963",
  15. "7668263",
  16. "7668264",
  17. "8036767",
  18. "8163311",
  19. "9495227"
  20. ]
  21. }
  22. variable "servers" {
  23. description = "Number of nodes in cluster"
  24. default = "4"
  25. }
  26. variable "noroot" {
  27. description = "Set this variable to true, if you want SSH keys set for ec2-user instead of root."
  28. default = false
  29. }
  30. provider "digitalocean" {
  31. token = "${var.DO_API_TOKEN}"
  32. }
  33. module "cluster" {
  34. source = "./cluster"
  35. name = "${var.TESTNET_NAME}"
  36. key_ids = "${var.ssh_keys}"
  37. servers = "${var.servers}"
  38. noroot = "${var.noroot}"
  39. }
  40. output "public_ips" {
  41. value = "${module.cluster.public_ips}"
  42. }
  43. #output "floating_ips" {
  44. # value = "${module.cluster.floating_ips}"
  45. #}