Skip to content

Commit

Permalink
fix for gcloud cli
Browse files Browse the repository at this point in the history
  • Loading branch information
amanpruthi committed Jun 18, 2024
1 parent 0fdd8a7 commit d1f3b9c
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions modules/private_link/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@ resource "null_resource" "install_dependencies" {
curl -O https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-cli-387.0.0-linux-x86_64.tar.gz
tar -xf google-cloud-cli-387.0.0-linux-x86_64.tar.gz
./google-cloud-sdk/install.sh -q
EOT
}
}

# Fetch Load Balancer Details using gcloud module
resource "null_resource" "fetch_lb_details" {
resource "null_resource" "fetch_lb_detail" {
provisioner "local-exec" {
command = <<EOT
gcloud compute forwarding-rules list --format=json > lb_details.json
Expand All @@ -36,13 +37,13 @@ resource "null_resource" "fetch_lb_details" {
}


data "external" "filtered_lb_names" {
data "external" "filtered_lb_name" {
program = ["sh", "-c", "cat filtered_lb_names.txt | jq -R -s '{\"load_balancer_name\": .}'"]
depends_on = [null_resource.fetch_lb_details]
depends_on = [null_resource.fetch_lb_detail]
}

locals {
forwardingRules = data.external.filtered_lb_names.result["load_balancer_name"]
forwardingRules = data.external.filtered_lb_name.result["load_balancer_name"]
}


Expand All @@ -60,7 +61,7 @@ resource "google_compute_service_attachment" "default" {
connection_limit = consumer_accept_lists.value
}
}
depends_on = [data.external.filtered_lb_names]
depends_on = [data.external.filtered_lb_name]
}

resource "google_compute_subnetwork" "default" {
Expand Down

0 comments on commit d1f3b9c

Please sign in to comment.