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.

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