Skip to content
This repository has been archived by the owner on Jan 25, 2022. It is now read-only.

Commit

Permalink
Revert "Namespace GCE using new lattice_namespace variable"
Browse files Browse the repository at this point in the history
This reverts commit 095abdb.

[#101697536]
  • Loading branch information
davidwadden committed Sep 11, 2015
1 parent eaf6259 commit 6432a13
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 22 deletions.
19 changes: 8 additions & 11 deletions terraform/google/example/lattice.google.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,22 @@ module "lattice-google" {
# lattice_password = "<CHANGE-ME>"

# Path to the JSON file used to describe your account credentials, downloaded from Google Cloud Console
# gce_account_file = "<CHANGE-ME>"
gce_account_file = "<CHANGE-ME>"

# The name of the project to apply any resources to
# gce_project = "<CHANGE-ME>"
gce_project = "<CHANGE-ME>"

# SSH user
# gce_ssh_user = "<CHANGE-ME>"
gce_ssh_user = "<CHANGE-ME>"

# Path to the SSH private key file
# gce_ssh_private_key_file = "<CHANGE-ME>"
gce_ssh_private_key_file = "<CHANGE-ME>"

# The number of Lattice Cells to launch (optional, default: 1)
# num_cells = "1"
# The number of Lattice Cells to launch
num_cells = "1"

# Google Compute Engine zone (optional, default: "us-central1-a")
# gce_zone = "us-central1-a"

# Namespace (optional, default: "lattice")
# lattice_namespace = "lattice"
# Google Compute Engine zone (optional)
# gce_zone = "<CHANGE-ME>"
}

output "lattice_target" {
Expand Down
12 changes: 6 additions & 6 deletions terraform/google/resources.tf
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
resource "google_compute_network" "lattice-network" {
name = "${var.lattice_namespace}-network"
name = "lattice"
ipv4_range = "${var.gce_ipv4_range}"
}

resource "google_compute_firewall" "lattice-network" {
name = "${var.lattice_namespace}-firewall"
name = "lattice"
network = "${google_compute_network.lattice-network.name}"
source_ranges = ["0.0.0.0/0"]
allow {
Expand All @@ -19,12 +19,12 @@ resource "google_compute_firewall" "lattice-network" {
}

resource "google_compute_address" "lattice-brain" {
name = "${var.lattice_namespace}-brain"
name = "lattice-brain"
}

resource "google_compute_instance" "lattice-brain" {
zone = "${var.gce_zone}"
name = "${var.lattice_namespace}-brain"
name = "lattice-brain"
tags = ["lattice"]
description = "Lattice Brain"
machine_type = "${var.gce_machine_type_brain}"
Expand Down Expand Up @@ -91,7 +91,7 @@ resource "google_compute_instance" "lattice-brain" {
resource "google_compute_instance" "cell" {
count = "${var.num_cells}"
zone = "${var.gce_zone}"
name = "${var.lattice_namespace}-cell-${count.index}"
name = "cell-${count.index}"
tags = ["lattice"]
description = "Lattice Cell ${count.index}"
machine_type = "${var.gce_machine_type_cell}"
Expand Down Expand Up @@ -145,7 +145,7 @@ resource "google_compute_instance" "cell" {
"sudo mkdir -p /var/lattice/setup/",
"sudo sh -c 'echo \"CONSUL_SERVER_IP=${google_compute_address.lattice-brain.address}\" >> /var/lattice/setup/lattice-environment'",
"sudo sh -c 'echo \"SYSTEM_DOMAIN=${google_compute_address.lattice-brain.address}.xip.io\" >> /var/lattice/setup/lattice-environment'",
"sudo sh -c 'echo \"LATTICE_CELL_ID=${var.lattice_namespace}-cell-${count.index}\" >> /var/lattice/setup/lattice-environment'",
"sudo sh -c 'echo \"LATTICE_CELL_ID=cell-${count.index}\" >> /var/lattice/setup/lattice-environment'",
"sudo sh -c 'echo \"GARDEN_EXTERNAL_IP=$(hostname -I | awk '\"'\"'{ print $1 }'\"'\"')\" >> /var/lattice/setup/lattice-environment'",

"sudo chmod +x /tmp/install-from-tar",
Expand Down
5 changes: 0 additions & 5 deletions terraform/google/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,3 @@ variable "lattice_password" {
variable "lattice_tar_source" {
description = "URL or local path of the lattice tar used to deploy your cluster."
}

variable "lattice_namespace" {
description = "Unique prefix for lattice infrastructure components, for deploying multiple clusters with different prefixes."
default = "lattice"
}

0 comments on commit 6432a13

Please sign in to comment.