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.

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