Google Cloud Professional Cloud Developer — Question 112
You are developing an ecommerce web application that uses App Engine standard environment and Memorystore for Redis. When a user logs into the app, the application caches the user's information (e.g., session, name, address, preferences), which is stored for quick retrieval during checkout.
While testing your application in a browser, you get a 502 Bad Gateway error. You have determined that the application is not connecting to Memorystore. What is the reason for this error?
Answer options
- A. Your Memorystore for Redis instance was deployed without a public IP address.
- B. You configured your Serverless VPC Access connector in a different region than your App Engine instance.
- C. The firewall rule allowing a connection between App Engine and Memorystore was removed during an infrastructure update by the DevOps team.
- D. You configured your application to use a Serverless VPC Access connector on a different subnet in a different availability zone than your App Engine instance.
Correct answer: B
Explanation
The correct answer is B because if the Serverless VPC Access connector is in a different region than the App Engine instance, they cannot communicate, leading to the connection failure. Option A is incorrect since a private IP can still be used by App Engine if properly configured. Option C is not necessarily the cause unless specifically stated, and option D would not cause a 502 error if the VPC connector is correctly set up within the same region.