Skip to content

Commit 2acc2df

Browse files
authored
MINOR: pull request #3 from Datatamer/glb
fix bug for glb
2 parents ea87ffa + f196bad commit 2acc2df

File tree

12 files changed

+178
-56
lines changed

12 files changed

+178
-56
lines changed

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,9 @@
1-
# Tamr Terraform Template Repo - v0.1.0 - Feb 25th 2020
1+
# Tamr GCP Wrapper - v0.2.1 - August 3rd 2020
2+
* Remove direct invocation of GLB module
3+
* update docs with more examples
4+
5+
# Tamr GCP Wrapper - v0.2.0 - July 31st 2020
6+
* Adding integrations for GLB
7+
8+
# Tamr GCP Wrapper - v0.1.0 - July 28th 2020
29
* Initing project

README.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,7 @@ This modules creates:
4242

4343
## Providers
4444

45-
| Name | Version |
46-
|------|---------|
47-
| google | >= 3.29.0 |
45+
No provider.
4846

4947
## Inputs
5048

@@ -58,12 +56,9 @@ This modules creates:
5856
| tamr\_bigtable\_min\_nodes | Min number of nodes to scale down to | `string` | n/a | yes |
5957
| tamr\_instance\_image | Image to use for Tamr VM boot disk | `string` | n/a | yes |
6058
| tamr\_zip\_uri | gcs location to download tamr zip from | `string` | n/a | yes |
61-
| tls\_certificate | CRT for tls certifacate to attach to load balancer | `string` | n/a | yes |
62-
| tls\_private\_key | Private key for tls certifacate to attach to load balancer | `string` | n/a | yes |
6359
| zone | GCP zone to deploy resources into | `string` | n/a | yes |
6460
| additional\_admin\_users | list of additional entities to give admin permissions to provisioned resources | `list(string)` | `[]` | no |
6561
| additional\_read\_users | list of additional entities to give read only permissions to provisioned resources | `list(string)` | `[]` | no |
66-
| allow\_source\_ip\_ranges | IP whitelist for inbound traffic to the LB | `list(string)` | `[]` | no |
6762
| bucket\_locations | Location for the gcs buckets, default is `US` | `string` | `"US"` | no |
6863
| force\_destroy | force destroy potentially persistent resources, like bigtable/gcs | `bool` | `false` | no |
6964
| labels | Labels to attach to created resources | `map(string)` | `{}` | no |
@@ -77,7 +72,6 @@ This modules creates:
7772
| Name | Description |
7873
|------|-------------|
7974
| instance\_ip | An arbitrary value that changes each time the resource is replaced. |
80-
| load\_balancer\_ip | The IP assigned to the LB. |
8175
| tamr\_config\_file | full tamr config file |
8276
| tamr\_instance\_self\_link | full self link of created tamr vm |
8377
| tamr\_service\_account | service account tamr is using |

VERSION

Lines changed: 0 additions & 1 deletion
This file was deleted.

examples/load_balancer/README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
2+
## Requirements
3+
4+
| Name | Version |
5+
|------|---------|
6+
| terraform | >0.12.0 |
7+
| google | ~> 3.29.0 |
8+
| google-beta | ~> 3.29.0 |
9+
10+
## Providers
11+
12+
| Name | Version |
13+
|------|---------|
14+
| google | ~> 3.29.0 |
15+
| google-beta | ~> 3.29.0 |
16+
17+
## Inputs
18+
19+
No input.
20+
21+
## Outputs
22+
23+
No output.
24+
25+
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->

examples/load_balancer/main.tf

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
locals {
2+
deployment_name = "tamr-dev"
3+
project = "your-project"
4+
region = "us-east1"
5+
zone = "us-east1-b"
6+
}
7+
8+
module "tamr_stack" {
9+
source = "git::[email protected]:Datatamer/terraform-gcp-tamr-vm.git?ref=v0.1.0"
10+
deployment_name = local.deployment_name
11+
# tamr VM
12+
tamr_zip_uri = "gs://tamr-releases/v2020.015.0/unify.zip"
13+
tamr_instance_image = "your-project/ubuntu"
14+
# bigtable config
15+
tamr_bigtable_min_nodes = 1
16+
tamr_bigtable_max_nodes = 10
17+
# network
18+
subnet_self_link = data.google_compute_subnetwork.project_subnet.self_link
19+
region = local.region
20+
zone = local.zone
21+
# misc
22+
# NOTE: this module will deploy all resources into this project
23+
project_id = local.project
24+
}
25+
#
26+
# GLB
27+
#
28+
29+
# assume ssl cert is uploaded to a google secret
30+
data "google_secret_manager_secret_version" "ssl_key" {
31+
provider = google-beta
32+
project = local.project
33+
secret = "ssl_key"
34+
}
35+
36+
data "google_secret_manager_secret_version" "ssl_cert" {
37+
provider = google-beta
38+
project = local.project
39+
secret = "ssl_cert"
40+
}
41+
42+
# ssl
43+
resource "google_compute_ssl_certificate" "tamr" {
44+
project = local.project
45+
name = "${local.deployment_name}-cert"
46+
private_key = data.google_secret_manager_secret_version.ssl_key.secret_data
47+
certificate = data.google_secret_manager_secret_version.ssl_cert.secret_data
48+
49+
lifecycle {
50+
create_before_destroy = true
51+
}
52+
}
53+
54+
# NOTE: this section is commented out, as it can't be planned and run until the above snippets have be run.
55+
56+
# module "load_balancer" {
57+
# source = "git::[email protected]:Datatamer/terraform-gcp-tamr-load-balancer.git?ref=v1.1.0"
58+
59+
# name = local.deployment_name
60+
# project_id = local.project
61+
# ssl_certificates = [google_compute_ssl_certificate.tamr.id]
62+
# tamr_vm_self_link = module.tamr_stack.tamr_instance_self_link
63+
# region = local.region
64+
# allow_source_ip_ranges = ["1.1.1.1/32"] # NOTE: replace this with your IP
65+
# }
66+
67+
# resource "google_dns_record_set" "tamr-example-com" {
68+
# name = "${local.name}-ssl.example.com."
69+
# type = "A"
70+
# ttl = 30
71+
# project = local.project
72+
73+
# managed_zone = "example-zone"
74+
# rrdatas = [module.load_balancer.ip_address]
75+
# }

examples/load_balancer/versions.tf

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
terraform {
2+
required_version = ">0.12.0"
3+
}
4+
5+
provider "google" {
6+
project = var.project-id
7+
region = "us-east1"
8+
version = "~> 3.29.0"
9+
}
10+
11+
provider "google-beta" {
12+
project = var.project-id
13+
region = "us-east1"
14+
version = "~> 3.29.0"
15+
}

examples/minimal/README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
2+
## Requirements
3+
4+
| Name | Version |
5+
|------|---------|
6+
| terraform | >0.12.0 |
7+
| google | ~> 3.29.0 |
8+
| google-beta | ~> 3.29.0 |
9+
10+
## Providers
11+
12+
No provider.
13+
14+
## Inputs
15+
16+
No input.
17+
18+
## Outputs
19+
20+
No output.
21+
22+
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->

examples/minimal/main.tf

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
module "tamr_stack" {
2+
source = "git::[email protected]:Datatamer/terraform-gcp-tamr-vm.git?ref=v0.1.0"
3+
deployment_name = "tamr-dev"
4+
# tamr VM
5+
tamr_zip_uri = "gs://tamr-releases/v2020.015.0/unify.zip"
6+
tamr_instance_image = "your-project/ubuntu"
7+
# bigtable config
8+
tamr_bigtable_min_nodes = 1
9+
tamr_bigtable_max_nodes = 10
10+
# network
11+
subnet_self_link = data.google_compute_subnetwork.project_subnet.self_link
12+
region = "us-east1"
13+
zone = "us-east1-b"
14+
# misc
15+
# NOTE: this module will deploy all resources into this project
16+
project_id = "your-project"
17+
}

examples/minimal/versions.tf

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
terraform {
2+
required_version = ">0.12.0"
3+
}
4+
5+
provider "google" {
6+
project = var.project-id
7+
region = "us-east1"
8+
version = "~> 3.29.0"
9+
}
10+
11+
provider "google-beta" {
12+
project = var.project-id
13+
region = "us-east1"
14+
version = "~> 3.29.0"
15+
}

main.tf

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -97,26 +97,3 @@ module "tamr_vm" {
9797
# misc
9898
labels = var.labels
9999
}
100-
101-
# load balancer config
102-
resource "google_compute_ssl_certificate" "tamr" {
103-
project = var.project_id
104-
name = "${var.deployment_name}-cert"
105-
private_key = var.tls_private_key
106-
certificate = var.tls_certificate
107-
108-
lifecycle {
109-
create_before_destroy = true
110-
}
111-
}
112-
113-
module "load_balancer" {
114-
source = "git::[email protected]:Datatamer/terraform-gcp-tamr-load-balancer.git?ref=v1.1.0"
115-
116-
name = var.deployment_name
117-
project_id = var.project_id
118-
ssl_certificates = [google_compute_ssl_certificate.tamr.id]
119-
tamr_vm_self_link = module.tamr_vm.tamr_instance_self_link
120-
region = var.region
121-
allow_source_ip_ranges = var.allow_source_ip_ranges
122-
}

outputs.tf

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,6 @@ output "tamr_service_account" {
1313
description = "service account tamr is using"
1414
}
1515

16-
output "load_balancer_ip" {
17-
value = module.load_balancer.ip_address
18-
description = "The IP assigned to the LB."
19-
}
20-
2116
# config files
2217
# NOTE: these are very useful for debugging
2318
output "tamr_config_file" {

variables.tf

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -80,25 +80,6 @@ variable "bucket_locations" {
8080
description = "Location for the gcs buckets, default is `US`"
8181
default = "US"
8282
}
83-
#
84-
# Google Load Balancer
85-
#
86-
#
87-
variable "tls_private_key" {
88-
type = string
89-
description = "Private key for tls certifacate to attach to load balancer"
90-
}
91-
92-
variable "tls_certificate" {
93-
type = string
94-
description = "CRT for tls certifacate to attach to load balancer"
95-
}
96-
97-
variable "allow_source_ip_ranges" {
98-
default = []
99-
type = list(string)
100-
description = "IP whitelist for inbound traffic to the LB"
101-
}
10283

10384
# Misc
10485
#

0 commit comments

Comments
 (0)