Skip to content
This repository was archived by the owner on Jan 13, 2025. It is now read-only.

Commit a94e54e

Browse files
authored
Create cluster.tf
1 parent 378b351 commit a94e54e

1 file changed

Lines changed: 52 additions & 0 deletions

File tree

terraform/cluster.tf

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# cluster.tf
2+
3+
resource "google_compute_network" "default" {
4+
name = "webwallet-network"
5+
6+
auto_create_subnetworks = false
7+
enable_ula_internal_ipv6 = false
8+
}
9+
10+
resource "google_compute_subnetwork" "default" {
11+
name = "webwallet-subnetwork"
12+
13+
ip_cidr_range = "10.0.0.0/16"
14+
region = "us-central1"
15+
16+
stack_type = "IPV4_ONLY"
17+
ipv6_access_type = null
18+
19+
network = google_compute_network.default.id
20+
secondary_ip_range {
21+
range_name = "services-range"
22+
ip_cidr_range = "192.168.0.0/24"
23+
}
24+
25+
secondary_ip_range {
26+
range_name = "pod-ranges"
27+
ip_cidr_range = "192.168.1.0/24"
28+
}
29+
}
30+
31+
resource "google_container_cluster" "default" {
32+
name = "webwallet-cluster"
33+
location = "us-central1"
34+
enable_autopilot = true
35+
36+
network = google_compute_network.default.id
37+
subnetwork = google_compute_subnetwork.default.id
38+
39+
ip_allocation_policy {
40+
stack_type = "IPV4"
41+
services_secondary_range_name = google_compute_subnetwork.default.secondary_ip_range[0].range_name
42+
cluster_secondary_range_name = google_compute_subnetwork.default.secondary_ip_range[1].range_name
43+
}
44+
45+
deletion_protection = false
46+
}
47+
48+
resource "time_sleep" "wait_service_cleanup" {
49+
depends_on = [google_container_cluster.default]
50+
51+
destroy_duration = "180s"
52+
}

0 commit comments

Comments
 (0)