<commit_before>variable "control_count" { default = 3 }
variable "datacenter" {default = "gce"}
variable "edge_count" { default = 3}
variable "image" {default = "centos-7-v20150526"}
variable "long_name" {default = "mantl"}
variable "short_name" {default = "mi"}
variable "ssh_key" {default = "~/.ssh/id_rsa.pub"}
variable "ssh_user" {default = "centos"}
variable "worker_count" {default = 1}
variable "zones" {
  default = "us-central1-a,us-central1-b"
}

provider "google" {
  credentials = "${file("account.json")}"
  project = ""
  region = "us-central1"
}

module "gce-network" {
 source = "./terraform/gce/network"
 network_ipv4 = "10.0.0.0/16"
}

# retmote state example
# _local is for development only s3 or something else should be used
# https://github.com/hashicorp/terraform/blob/master/state/remote/remote.go#L47
# https://www.terraform.io/docs/state/remote.html
#resource "terraform_remote_state" "gce-network" {
#  backend = "_local"
#  config {
#    path = "./terraform/gce/network/terraform.tfstate"
#  }
#}


module "control-nodes" {
  source = "./terraform/gce/nodes/control"
  control_count = "${var.control_count}"
  datacenter = "${var.datacenter}"
  image = "${var.image}"
  long_name = "${var.long_name}"
  network_name = "${module.gce-network.network_name}"
  #network_name = "${terraform_remote_state.gce-network.output.network_name}"
  short_name = "${var.short_name}"
  ssh_user = "${var.ssh_user}"
  ssh_key = "${var.ssh_key}"
  zones = "${var.zones}"
}

module "edge-nodes" {
  source = "./terraform/gce/nodes/edge"
  edge_count = "${var.edge_count}"
  datacenter = "${var.datacenter}"
  image = "${var.image}"
  long_name = "${var.long_name}"
  network_name = "${module.gce-network.network_name}"
  #network_name = "${terraform_remote_state.gce-network.output.network_name}"
  short_name = "${var.short_name}"
  ssh_user = "${var.ssh_user}"
  ssh_key = "${var.ssh_key}"
  zones = "${var.zones}"
}

module "worker-nodes" {
  source = "./terraform/gce/nodes/worker"
  worker_count = "${var.worker_count}"
  datacenter = "${var.datacenter}"
  image = "${var.image}"
  long_name = "${var.long_name}"
  network_name = "${module.gce-network.network_name}"
  #network_name = "${terraform_remote_state.gce-network.output.network_name}"
  short_name = "${var.short_name}"
  ssh_user = "${var.ssh_user}"
  ssh_key = "${var.ssh_key}"
  zones = "${var.zones}"
}

module "network-lb" {
  source = "./terraform/gce/lb"
  instances = "${module.edge-nodes.instances}"
  short_name = "${var.short_name}"
}<commit_msg>added cloud-dns example<commit_after>variable "control_count" { default = 3 }
variable "datacenter" {default = "gce"}
variable "edge_count" { default = 3}
variable "image" {default = "centos-7-v20150526"}
variable "long_name" {default = "mantl"}
variable "short_name" {default = "mi"}
variable "ssh_key" {default = "~/.ssh/id_rsa.pub"}
variable "ssh_user" {default = "centos"}
variable "worker_count" {default = 1}
variable "zones" {
  default = "us-central1-a,us-central1-b"
}

provider "google" {
  credentials = "${file("account.json")}"
  project = ""
  region = "us-central1"
}

module "gce-network" {
 source = "./terraform/gce/network"
 network_ipv4 = "10.0.0.0/16"
}

# retmote state example
# _local is for development only s3 or something else should be used
# https://github.com/hashicorp/terraform/blob/master/state/remote/remote.go#L47
# https://www.terraform.io/docs/state/remote.html
#resource "terraform_remote_state" "gce-network" {
#  backend = "_local"
#  config {
#    path = "./terraform/gce/network/terraform.tfstate"
#  }
#}


module "control-nodes" {
  source = "./terraform/gce/nodes/control"
  control_count = "${var.control_count}"
  datacenter = "${var.datacenter}"
  image = "${var.image}"
  long_name = "${var.long_name}"
  network_name = "${module.gce-network.network_name}"
  #network_name = "${terraform_remote_state.gce-network.output.network_name}"
  short_name = "${var.short_name}"
  ssh_user = "${var.ssh_user}"
  ssh_key = "${var.ssh_key}"
  zones = "${var.zones}"
}

module "edge-nodes" {
  source = "./terraform/gce/nodes/edge"
  edge_count = "${var.edge_count}"
  datacenter = "${var.datacenter}"
  image = "${var.image}"
  long_name = "${var.long_name}"
  network_name = "${module.gce-network.network_name}"
  #network_name = "${terraform_remote_state.gce-network.output.network_name}"
  short_name = "${var.short_name}"
  ssh_user = "${var.ssh_user}"
  ssh_key = "${var.ssh_key}"
  zones = "${var.zones}"
}

module "worker-nodes" {
  source = "./terraform/gce/nodes/worker"
  worker_count = "${var.worker_count}"
  datacenter = "${var.datacenter}"
  image = "${var.image}"
  long_name = "${var.long_name}"
  network_name = "${module.gce-network.network_name}"
  #network_name = "${terraform_remote_state.gce-network.output.network_name}"
  short_name = "${var.short_name}"
  ssh_user = "${var.ssh_user}"
  ssh_key = "${var.ssh_key}"
  zones = "${var.zones}"
}

module "network-lb" {
  source = "./terraform/gce/lb"
  instances = "${module.edge-nodes.instances}"
  short_name = "${var.short_name}"
}

module "cloud-dns" {
  source = "./terraform/gce/dns"
  control_count = "${var.control_count}"
  control_ips = "${module.control-nodes.control_ips}"
  domain = "mydomain.com"
  edge_count = "${var.edge_count}"
  edge_ips = "${module.edge-nodes.edge_ips}"
  lb_ip = "${module.network-lb.public_ip}"
  managed_zone = "my-cloud-dns-zone"
  short_name = "${var.short_name}"
  subdomain = "service"
  worker_count = "${var.worker_count}"
  worker_ips = "${module.worker-nodes.worker_ips}"
}
{'fraction_non_alphanumeric': 0.18449919079302285, 'fraction_numerical': 0.009350836180543068, 'mean_word_length': 4.539840637450199, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5660285', 'n_tokens_mistral': 2098, 'n_tokens_neox': 2071, 'n_words': 344}