Hello,
Would someone help me with that error? Can’t solve it with many attempts:
lb.tf
VPC network
resource “google_compute_network” “great-ilb_network” {
name = “great-l7-ilb-network”
auto_create_subnetworks = false
project = var.project_id
}proxy-only subnet
resource “google_compute_subnetwork” “great-proxy_subnet” {
name = “great-l7-ilb-proxy-subnet”
ip_cidr_range = “10.0.0.0/24”
network = google_compute_network.great-ilb_network.self_link
}backend subnet
resource “google_compute_subnetwork” “great-ilb_subnet” {
name = “great-l7-ilb-subnet”
ip_cidr_range = “10.0.1.0/24”
region = var.region
network = google_compute_network.great-ilb_network.self_link
}MIG
resource “google_compute_instance_group_manager” “great-instance_group_manager” {
name = “my-great-instance-group-manager”
base_instance_name = “my-instance”
target_size = 3version {
instance_template = google_compute_instance_template.great-instance_template.self_link
}
}instance template
resource “google_compute_instance_template” “great-instance_template” {
name = “my-great-instance-template”
machine_type = var.vm_config.vm_typedisk {
source_image = “debian-cloud/debian-10”
auto_delete = true
}network_interface {
network = “default”
access_config {}
}metadata_startup_script = var.vm_config.vm_startup_script
}Backend Service
resource “google_compute_backend_service” “fancy-fe-frontend” {
name = “fancy-fe-frontend”
project = var.project_id
port_name = “frontend”
health_checks = [google_compute_http_health_check.great-fe-frontend-hc.self_link]
backend {
group = google_compute_instance_group_manager.great-instance_group_manager.instance_group
}
protocol = “HTTP”
timeout_sec = 10
load_balancing_scheme = “INTERNAL_MANAGED”
}HTTP Health Check
resource “google_compute_http_health_check” “great-fe-frontend-hc” {
name = “great-fancy-fe-frontend-hc”
project = var.project_id
check_interval_sec = 30
timeout_sec = 10
healthy_threshold = 1
port = 80
request_path = “/”
}Firewall Rule
resource “google_compute_firewall” “fw-fe” {
name = “fw-fe”
network = google_compute_network.great-ilb_network.self_link
allow {
protocol = “tcp”
ports = [“80”]
}
source_ranges = [“0.0.0.0/0”]
target_tags = [“frontend”]
}
Error:
module.load_balancer.google_compute_firewall.fw-fe: Modifications complete after 12s [id=projects/nomadic-ocean-415111/global/firewalls/fw-fe]
╷
│ Error: Error creating BackendService: googleapi: Error 400: Invalid value for field 'resource.healthChecks[0]': 'https://www.googleapis.com/compute/v1/projects/nomadic-ocean-415111/global/httpHealthChecks/great-fancy-fe-frontend-hc'. This HTTP backend service only supports HealthCheck, invalid
│
│ with module.load_balancer.google_compute_backend_service.fancy-fe-frontend,
│ on modules\lb\lb.tf line 53, in resource "google_compute_backend_service" "fancy-fe-frontend":
│ 53: resource "google_compute_backend_service" "fancy-fe-frontend" {
│