Skip to content

Commit

Permalink
Merge pull request #5 from hashicorp/fix-example-link
Browse files Browse the repository at this point in the history
Minor fixes to examples, plus variable consistency
  • Loading branch information
amy-hashi authored Sep 4, 2019
2 parents cdc34da + 12f919a commit 26f0457
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 13 deletions.
10 changes: 5 additions & 5 deletions examples/root-example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ This example assumes you have already set up your gcp project with the required

* VPC
* Subnet specifically for Terrafrom Enterprise
* Firewall rules as outlined [in the instructions](link_to_website_instructions)
* A valid certificate and ssl policy in gcp. (If you are not going to use a google managed ssl certificate, plesae [read the instructions here on what to comment out](link_to_instructions))
* Firewall rules as outlined [in the instructions](https://www.terraform.io/docs/enterprise/beta/gcp.html#infrastructure)
* A valid certificate and ssl policy in gcp. (If you are not going to use a google managed ssl certificate, please [read the instructions here on what to comment out](https://www.terraform.io/docs/enterprise/beta/gcp.html#explanation-of-variables))
* An IP address and DNS entry for the front end load balancer
* A DNS Zone in gcp
* A license file provided by your Technical Account Manager

With this code you can either create a single instance, or a build a cluster:

![basic architecture diagram](tfeha_basic_diagram.jpg)
![basic architecture diagram](https://github.com/hashicorp/terraform-google-terraform-enterprise/blob/v0.0.1-beta/assets/gcp_diagram.jpg?raw=true)

## Change to the example directory

Expand Down Expand Up @@ -54,8 +54,8 @@ terraform apply

The replicated console url will output along with the password.

![output](output_example.png)
![output](https://github.com/hashicorp/terraform-google-terraform-enterprise/blob/master/examples/root-example/output_example.png?raw=true)

You can log into that dashboard at that url and wait for the application to be ready. This can take up to 30 minutes! Once complete use the `Open` link to set up the admin user and initial organization.

![application started](app_started.png)
![application started](https://github.com/hashicorp/terraform-google-terraform-enterprise/blob/master/examples/root-example/app_started.png?raw=true)
20 changes: 13 additions & 7 deletions examples/root-example/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,25 @@ variable "region" {
default = "us-central1"
}

variable "project" {}

provider "google" {
region = "${var.region}"
project = "${var.project}"
}

provider "google-beta" {
region = "${var.region}"
project = "${var.project}"
}

module "tfe-beta" {
source = "hashicorp/terraform-enterprise/google"
version = "0.0.1-beta"
version = "0.0.2-beta"
credentials_file = "auth-file-123456678.json"
region = "${var.region}"
zone = "${var.region}-a"
project = "tfe-beta"
project = "${var.project}"
domain = "example.com"
dns_zone = "example"
public_ip = "1.2.3.4"
Expand All @@ -32,9 +36,11 @@ module "tfe-beta" {
}

output "tfe-beta" {
application_endpoint = "${module.tfe-beta.application_endpoint}"
application_health_check = "${module.tfe-beta.application_health_check}"
installer_dashboard_password = "${module.tfe-beta.installer_dashboard_password}"
installer_dashboard__url = "${module.tfe-beta.installer_dashboard_url}"
primary_public_ip = "${module.tfe-beta.primary_public_ip}"
value = {
application_endpoint = "${module.tfe-beta.application_endpoint}"
application_health_check = "${module.tfe-beta.application_health_check}"
installer_dashboard_password = "${module.tfe-beta.installer_dashboard_password}"
installer_dashboard__url = "${module.tfe-beta.installer_dashboard_url}"
primary_public_ip = "${module.tfe-beta.primary_public_ip}"
}
}
2 changes: 2 additions & 0 deletions files/install-ptfe.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ fi
if [[ $(< /etc/ptfe/role) == "secondary" ]]; then
export PTFEHOSTNAME=$(curl -H "Metadata-Flavor: Google" http://metadata.google.internal/computeMetadata/v1/instance/network-interfaces/0/ip)
fi
# Using the IP address, as the secondaries don't have DNS entries
# Primaries have to use their local hostnames as https://frontenddns:8800 will not route through the LB currently

chown root:root /etc/ptfe/*
chown 0400 /etc/ptfe/*
Expand Down
2 changes: 1 addition & 1 deletion secondary.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ resource "google_compute_health_check" "autohealing" {
resource "google_compute_region_instance_group_manager" "secondary" {
name = "secondary"

base_instance_name = "ptfe-worker"
base_instance_name = "tfe-secondary"
instance_template = "${module.instance-template.secondary_template}"
update_strategy = "NONE"
region = "${var.region}"
Expand Down

0 comments on commit 26f0457

Please sign in to comment.