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.

51 lines
1.1 KiB

  1. #DigitalOcean 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 "private_ips" {
  31. value = "${join(",",module.cluster.private_ips)}"
  32. }
  33. output "seeds" {
  34. value = "${join(":46656,",module.cluster.public_ips)}:46656"
  35. }
  36. output "rpcs" {
  37. value = "${join(":46657,",module.cluster.public_ips)}:46657"
  38. }