diff --git a/terraform/google/example/lattice.google.tf b/terraform/google/example/lattice.google.tf index 6b81507e..f242e5a7 100644 --- a/terraform/google/example/lattice.google.tf +++ b/terraform/google/example/lattice.google.tf @@ -10,25 +10,22 @@ module "lattice-google" { # lattice_password = "" # Path to the JSON file used to describe your account credentials, downloaded from Google Cloud Console - # gce_account_file = "" + gce_account_file = "" # The name of the project to apply any resources to - # gce_project = "" + gce_project = "" # SSH user - # gce_ssh_user = "" + gce_ssh_user = "" # Path to the SSH private key file - # gce_ssh_private_key_file = "" + gce_ssh_private_key_file = "" - # 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 = "" } output "lattice_target" { diff --git a/terraform/google/resources.tf b/terraform/google/resources.tf index 06e69dbc..4f148bac 100644 --- a/terraform/google/resources.tf +++ b/terraform/google/resources.tf @@ -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 { @@ -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}" @@ -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}" @@ -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", diff --git a/terraform/google/variables.tf b/terraform/google/variables.tf index c9b82006..d0ebf70e 100644 --- a/terraform/google/variables.tf +++ b/terraform/google/variables.tf @@ -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" -}