0

There is a VPC connector enabled Route all traffic through the VPC connector and a firewall rule to allow all egress traffic for the VPC. Still, I am not able to connect to the RabbitMQ instance(cloudamqp) due to timeout.

  • Can your container connect to RabbitMQ when you run it on your workstation? – guillaume blaquiere Jul 01 '21 at 07:12
  • On my development machine, yes. I have just tested it. – turgayozgur Jul 01 '21 at 07:30
  • The RabbitMQ server is publicly accessible? Why do you use a serverless VPC connector? Does the rabbitMQ server check the client IP? – guillaume blaquiere Jul 01 '21 at 07:32
  • As I know, there is no IP restriction. I was created the VPC connecter to connect my Cloud SQL instances. The RabbitMQ instance created on the CloudAMQP dashboard so it is publicly accessible. Is there any extra step that I have to do to connect it? – turgayozgur Jul 01 '21 at 07:41
  • Firstly, if you need to connect your Cloud SQL instance on the private IP, you don't need to route all the traffic, only the private traffic. If you connect your Cloud SQL instance on the public IP, I don't recommend to use the IP but the Cloud Run Cloud SQL connector for that (encrypted and secure channel). Can you try to avoid the route all traffic to the serverless VPC connector and check if it works better? – guillaume blaquiere Jul 01 '21 at 07:46

1 Answers1

1

I realized that the issue is about using Cloud Run VPC accessor for all traffic without a NAT gateway. After creating a NAT gateway for the related VPC, the issue resolved.

Using the VPC accessor for only the internal traffic can also help in this case. But, if you need to use static IP to route outbound requests to external endpoints then you have to use Cloud Run + all traffic through VPC Accessor + NAT.