问题原文
原帖链接 · jminardi · CC BY-SA 4.0
I have a DB server running as a Compute Engine VM, and an API running on Cloud Run. Both are part of the same project. I want the DB VM to only be accessible from the Cloud Run code.
At first I thought this should just work because the firewall has a "default-allow-internal" rule that should apply to every machine in the project. However I was still getting connection failures.
Then I tried adding a new ingress rule that targeted the service account and allowed connections from the service account. This also didn't work.
I modified the rule to allow connections from my personal IP just to confirm the DB VM was working and my firewall rules worked, and everything worked as expected.
Finally I looked into filtering by "source tag" but the option was not selectable and I couldn't seem to be able to add source tags to the Cloud Run instance.
Is it possible for me to achieve my goal of restricting access to the DB VM to only allow incoming connections from the Cloud Run machine?
已采纳解答
原帖链接 · tsplus · CC BY-SA 4.0
You can configure Serverless VPC Acces to connect Cloud Run with Compute Engine VM, updated Sep 2020. https://cloud.google.com/vpc/docs/configure-serverless-vpc-access
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
