If I implement a load balanced to have my domain. how do i block the automatically generated url for my api gateway?

157 Views Asked by At

I am implementing security to my Cloud Run services through an Api Gateway NEG and a load balanced I need block the automatically generated url for my api gateway so that they only access my services through the load balanced

From what I understand Cloud Armor can only be used with the load balancer and not directly with the APi gateway.

1

There are 1 best solutions below

1
Mirco On

You need to set the ingress for your services to "Internal and Load Balancing only". You can do this in the Google Console: enter image description here

Or, if you use Terraform by adding:

  metadata {
    annotations = {
      "run.googleapis.com/ingress" = "internal-and-cloud-load-balancing"
    }

  }

to the top level in your terraform resource.