add main.tf and variables.tf for les

This commit is contained in:
Jakub Sokołowski 2018-11-23 16:54:09 +01:00
parent 259f810a52
commit 08183f9945
No known key found for this signature in database
GPG Key ID: 4EF064D0E6D63020
2 changed files with 77 additions and 0 deletions

48
main.tf Normal file
View File

@ -0,0 +1,48 @@
/* DERIVED --------------------------------------*/
provider "digitalocean" {
token = "${var.digitalocean_token}"
version = "<= 0.1.3"
}
provider "cloudflare" {
email = "${var.cloudflare_email}"
token = "${var.cloudflare_token}"
org_id = "${var.cloudflare_org_id}"
}
/* DATA -----------------------------------------*/
terraform {
backend "consul" {
address = "https://consul.statusim.net:8400"
lock = true
# WARNING This needs to be changed for every repo.
path = "terraform/misc/"
ca_file = "ansible/files/consul-ca.crt"
cert_file = "ansible/files/consul-client.crt"
key_file = "ansible/files/consul-client.key"
}
}
/* LES Full Nodes ------------------------------*/
module "les-main" {
source = "github.com/status-im/infra-tf-digital-ocean"
count = 3
env = "les-main"
group = "les-main"
size = "s-2vcpu-4gb"
vol_size = 800
domain = "${var.domain}"
open_ports = [ "30303-30303" ]
}
module "les-rops" {
source = "github.com/status-im/infra-tf-digital-ocean"
count = 3
env = "les-rops"
group = "les-rops"
size = "s-2vcpu-4gb"
vol_size = 100
domain = "${var.domain}"
open_ports = [ "30303-30303" ]
}

29
variables.tf Normal file
View File

@ -0,0 +1,29 @@
/* REQUIRED -------------------------------------*/
variable cloudflare_token {
description = "Token for interacting with Cloudflare API."
}
variable digitalocean_token {
description = "Token for interacting with DigitalOcean API."
}
variable cloudflare_email {
description = "Email address of Cloudflare account."
}
variable cloudflare_org_id {
description = "ID of the CloudFlare organization."
}
/* GENERAL --------------------------------------*/
variable public_domain {
description = "Domain under which the public sites go."
default = "status.im"
}
variable domain {
description = "DNS Domain to update"
default = "statusim.net"
}