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.

46 lines
826 B

  1. #Terraform Configuration
  2. terraform {
  3. required_providers {
  4. digitalocean = {
  5. source = "digitalocean/digitalocean"
  6. version = "~> 2.0"
  7. }
  8. }
  9. }
  10. variable "DO_API_TOKEN" {
  11. description = "DigitalOcean Access Token"
  12. }
  13. variable "TESTNET_NAME" {
  14. description = "Name of the testnet"
  15. default = "sentrynet"
  16. }
  17. variable "SSH_KEY_FILE" {
  18. description = "SSH public key file to be used on the nodes"
  19. type = string
  20. }
  21. variable "SERVERS" {
  22. description = "Number of nodes in testnet"
  23. default = "4"
  24. }
  25. provider "digitalocean" {
  26. token = "${var.DO_API_TOKEN}"
  27. }
  28. module "cluster" {
  29. source = "./cluster"
  30. name = "${var.TESTNET_NAME}"
  31. ssh_key = "${var.SSH_KEY_FILE}"
  32. servers = "${var.SERVERS}"
  33. }
  34. output "public_ips" {
  35. value = "${module.cluster.public_ips}"
  36. }