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
module"internal-lb" {
source="../gcloud-lb-internal"project="${var.project}"region="${var.region}"name="${var.vpc}-es-lb-internal"network="${var.vpc}"subnetwork="${data.google_compute_subnetwork.link.name}"ports=["9200"]
health_port="9200"source_tags="${var.lb_source_tags}"target_tags=["${module.cluster.K8S_TAG}"]
# Related to number of instances / cluster_zones in module.clusterbackends=[
{ group ="${module.cluster.K8S_INSTANCE_GROUP_URLS[0]}" },
]
}
I have found that because of the data lookup within the module code, for the subnetwork name / self_link, this means that terraform always plans to recreate the forwawrding_rule.
Example (minus all the things that stay the same):
-/+ module.elastic.module.internal-lb.google_compute_forwarding_rule.default (new resource required)
id: "vpc-du-es-lb-internal" => <computed> (forces new resource)
network: "https://www.googleapis.com/compute/v1/projects/sopost-infra-dev/global/networks/vpc-du" => "${data.google_compute_network.network.self_link}" (forces new resource)
self_link: "https://www.googleapis.com/compute/v1/projects/sopost-infra-dev/regions/us-central1/forwardingRules/vpc-du-es-lb-internal" => <computed>
service_name: "" => <computed>
subnetwork: "https://www.googleapis.com/compute/v1/projects/sopost-infra-dev/regions/us-central1/subnetworks/elastic-sub" => "${data.google_compute_subnetwork.network.self_link}" (forces new resource)
Normally not an issue, but its not the quickest of actions to perform on google cloud, however I can see why you've done it that way (less inputs).
I happen to be wrapping this module and passing the the subnetwork to ensure everything is created in a specific subnetwork, but I get the same result when I hard code the value of subnetwork for the input.
Not sure how this is avoidable currently without taking the data lookups out and passing the value explicitly. Unless I am missing something?
The text was updated successfully, but these errors were encountered:
Using the module as follows:
I have found that because of the
data
lookup within the module code, for the subnetwork name / self_link, this means that terraform always plans to recreate theforwawrding_rule
.Example (minus all the things that stay the same):
Normally not an issue, but its not the quickest of actions to perform on google cloud, however I can see why you've done it that way (less inputs).
I happen to be wrapping this module and passing the the subnetwork to ensure everything is created in a specific subnetwork, but I get the same result when I hard code the value of
subnetwork
for the input.Not sure how this is avoidable currently without taking the data lookups out and passing the value explicitly. Unless I am missing something?
The text was updated successfully, but these errors were encountered: