You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 14, 2024. It is now read-only.
When the google provider does not have a default region configured (which is actually happening in examples/vpc_peering_common_with_network_tags example) the data source used within the lb_internal module returns a null value and interpolation fails:
data "google_client_config" "this" {}
resource "google_compute_health_check" "this" {
name = "${var.name}-${data.google_client_config.this.region}-check-tcp${var.health_check_port}"
project = var.project
tcp_health_check {
port = var.health_check_port
}
}
Error :
│ Error: Invalid template interpolation value
│
│ on ../../modules/lb_internal/main.tf line 4, in resource "google_compute_health_check" "this":
│ 4: name = "${var.name}-${data.google_client_config.this.region}-check-tcp${var.health_check_port}"
│ ├────────────────
│ │ data.google_client_config.this.region is null
│
│ The expression result is null. Cannot include a null value in a string template.
╵
╷
│ Error: Invalid template interpolation value
│
│ on ../../modules/lb_internal/main.tf line 4, in resource "google_compute_health_check" "this":
│ 4: name = "${var.name}-${data.google_client_config.this.region}-check-tcp${var.health_check_port}"
│ ├────────────────
│ │ data.google_client_config.this.region is null
│
│ The expression result is null. Cannot include a null value in a string template.
╵
Describe the solution you'd like
var.region is already used within the module so there is no use for the data source.
Thus - get rid of the data source and use var.region variable instead:
resource "google_compute_health_check" "this" {
name = "${var.name}-${var.region}-check-tcp${var.health_check_port}"
project = var.project
tcp_health_check {
port = var.health_check_port
}
}
Describe alternatives you've considered.
No response
Additional context
No response
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem?
When the
google
provider does not have a default region configured (which is actually happening inexamples/vpc_peering_common_with_network_tags
example) the data source used within thelb_internal
module returns a null value and interpolation fails:Error :
Describe the solution you'd like
var.region
is already used within the module so there is no use for the data source.Thus - get rid of the data source and use
var.region
variable instead:Describe alternatives you've considered.
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: