Google Professional Cloud Developer Question 333
Select 3Google Cloud PlatformYou are tasked with deploying a Node.js application to a serverless environment using Google Cloud Functions. The application requires a specific runtime version and needs to access a Cloud SQL database securely. Which deployment considerations should you prioritize?
- A
Specify the required Node.js runtime version in the deployment configuration.
- B
Enable the Cloud SQL Admin API and configure a service account with the necessary permissions.
- C
Ensure the application is packaged as a Docker container before deployment.
- D
Configure the function to use the appropriate VPC connector for secure access to the Cloud SQL database.
- E
Assign the 'Owner' role to the Cloud Function for accessing Cloud SQL.
Show answer and explanation
Correct answers: A, B, D
Explanation
When deploying applications to Google Cloud Functions, it is critical to specify the runtime version to ensure compatibility. Securely accessing Cloud SQL requires enabling the necessary APIs, configuring service accounts with the right permissions, and using a VPC connector for private network access. Packaging the application as a Docker container is not relevant for Cloud Functions, and assigning broad roles like 'Owner' should be avoided due to security best practices.
- A. Correct.
Correct: Google Cloud Functions requires specifying the runtime version during deployment to ensure compatibility with your application.
- B. Correct.
Correct: Enabling the Cloud SQL Admin API and configuring a service account with the correct permissions is essential for secure communication with the Cloud SQL database.
- C. Incorrect.
Incorrect: Google Cloud Functions does not require applications to be packaged as Docker containers. This is only needed when using Cloud Run or other container-based services.
- D. Correct.
Correct: Using a VPC connector allows the function to securely access Cloud SQL instances within a private network.
- E. Incorrect.
Incorrect: Assigning the 'Owner' role is not a best practice as it grants excessive permissions. Instead, more granular roles like Cloud SQL Client should be used.