Skip to content

Commit

Permalink
Add direct VPC egress
Browse files Browse the repository at this point in the history
  • Loading branch information
joecorall authored Jul 10, 2024
1 parent fe6b781 commit 01f81f5
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions modules/cloudrun/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,20 @@ terraform {
}
}

locals
direct_vpc = <<EOT
[
{
"network": "default",
"subnetwork" : "default",
"tags": [
"lnmp"
]
}
]
EOT
}

data "google_service_account" "service_account" {
account_id = "cr-microservices"
}
Expand Down Expand Up @@ -46,6 +60,8 @@ resource "google_cloud_run_service" "cloudrun" {
"autoscaling.knative.dev/minScale" : var.min_instances,
"autoscaling.knative.dev/maxScale" : var.max_instances,
"run.googleapis.com/cpu-throttling" : true,
"run.googleapis.com/network-interfaces" : local.direct_vpc,
"run.googleapis.com/vpc-access-egress" : "all-traffic",
}
}
spec {
Expand Down

0 comments on commit 01f81f5

Please sign in to comment.