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.

63 lines
1.4 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. "10318834"
  21. ]
  22. }
  23. variable "servers" {
  24. description = "Number of nodes in cluster"
  25. default = "4"
  26. }
  27. variable "image" {
  28. description = "DigitalOcean image name"
  29. default = "ubuntu-16-04-x64"
  30. }
  31. variable "noroot" {
  32. description = "Set this variable to true, if you want SSH keys set for ec2-user instead of root."
  33. default = false
  34. }
  35. provider "digitalocean" {
  36. token = "${var.DO_API_TOKEN}"
  37. }
  38. module "cluster" {
  39. source = "./cluster"
  40. name = "${var.TESTNET_NAME}"
  41. key_ids = "${var.ssh_keys}"
  42. servers = "${var.servers}"
  43. noroot = "${var.noroot}"
  44. image_id = "${var.image}"
  45. }
  46. output "public_ips" {
  47. value = "${module.cluster.public_ips}"
  48. }
  49. #output "floating_ips" {
  50. # value = "${module.cluster.floating_ips}"
  51. #}