Skip to content

Commit bb5c9a8

Browse files
committed
all working
1 parent 2e7396a commit bb5c9a8

14 files changed

+781
-819
lines changed

scaletest/terraform/new/cf_dns.tf

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,8 @@
11
resource "cloudflare_record" "coder" {
2+
for_each = local.deployments
23
zone_id = var.cloudflare_zone_id
3-
name = local.coder_subdomain
4-
content = google_compute_address.coder["primary"].address
5-
type = "A"
6-
ttl = 3600
7-
}
8-
9-
resource "cloudflare_record" "coder_europe" {
10-
zone_id = var.cloudflare_zone_id
11-
name = local.coder_europe_subdomain
12-
content = google_compute_address.coder["europe"].address
4+
name = each.value.subdomain
5+
content = google_compute_address.coder[each.key].address
136
type = "A"
147
ttl = 3600
158
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
locals {
2+
deployments = {
3+
primary = {
4+
subdomain = "${var.name}-scaletest"
5+
url = "http://${var.name}-scaletest.${var.cloudflare_domain}"
6+
region = "us-east1"
7+
zone = "us-east1-c"
8+
cidr = "10.200.0.0/24"
9+
}
10+
europe = {
11+
subdomain = "${var.name}-europe-scaletest"
12+
url = "http://${var.name}-europe-scaletest.${var.cloudflare_domain}"
13+
region = "europe-west1"
14+
zone = "europe-west1-b"
15+
cidr = "10.201.0.0/24"
16+
}
17+
asia = {
18+
subdomain = "${var.name}-asia-scaletest"
19+
url = "http://${var.name}-asia-scaletest.${var.cloudflare_domain}"
20+
region = "asia-southeast1"
21+
zone = "asia-southeast1-a"
22+
cidr = "10.202.0.0/24"
23+
}
24+
}
25+
}

scaletest/terraform/new/gcp_cluster.tf renamed to scaletest/terraform/new/gcp_clusters.tf

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,6 @@ data "google_compute_default_service_account" "default" {
44
}
55

66
locals {
7-
clusters = {
8-
primary = {
9-
region = "us-east1"
10-
zone = "us-east1-c"
11-
cidr = "10.200.0.0/24"
12-
}
13-
europe = {
14-
region = "europe-west1"
15-
zone = "europe-west1-b"
16-
cidr = "10.201.0.0/24"
17-
}
18-
asia = {
19-
region = "asia-southeast1"
20-
zone = "asia-southeast1-a"
21-
cidr = "10.202.0.0/24"
22-
}
23-
}
247
node_pools = {
258
primary_coder = {
269
name = "coder"
@@ -71,7 +54,7 @@ locals {
7154
}
7255

7356
resource "google_container_cluster" "cluster" {
74-
for_each = local.clusters
57+
for_each = local.deployments
7558
name = "${var.name}-${each.key}"
7659
location = each.value.zone
7760
project = var.project_id
@@ -118,7 +101,7 @@ resource "google_container_cluster" "cluster" {
118101
resource "google_container_node_pool" "node_pool" {
119102
for_each = local.node_pools
120103
name = each.value.name
121-
location = local.clusters[each.value.cluster].zone
104+
location = local.deployments[each.value.cluster].zone
122105
project = var.project_id
123106
cluster = google_container_cluster.cluster[each.value.cluster].name
124107
autoscaling {

scaletest/terraform/new/gcp_db.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
resource "google_sql_database_instance" "db" {
22
name = "${var.name}-coder"
33
project = var.project_id
4-
region = local.clusters.primary.region
4+
region = local.deployments.primary.region
55
database_version = var.cloudsql_version
66
deletion_protection = false
77

@@ -13,7 +13,7 @@ resource "google_sql_database_instance" "db" {
1313
availability_type = "ZONAL"
1414

1515
location_preference {
16-
zone = local.clusters.primary.zone
16+
zone = local.deployments.primary.zone
1717
}
1818

1919
database_flags {

scaletest/terraform/new/gcp_vpc.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ resource "google_compute_network" "vpc" {
99
}
1010

1111
resource "google_compute_subnetwork" "subnet" {
12-
for_each = local.clusters
12+
for_each = local.deployments
1313
name = "${var.name}-${each.key}"
1414
project = var.project_id
1515
region = each.value.region
@@ -18,7 +18,7 @@ resource "google_compute_subnetwork" "subnet" {
1818
}
1919

2020
resource "google_compute_address" "coder" {
21-
for_each = local.clusters
21+
for_each = local.deployments
2222
project = var.project_id
2323
region = each.value.region
2424
name = "${var.name}-${each.key}-coder"

scaletest/terraform/new/k8s_certmanager.tf

Lines changed: 0 additions & 68 deletions
This file was deleted.

0 commit comments

Comments
 (0)