Google Associate Cloud Engineer Question 264
Single answerGoogle Cloud PlatformYou are tasked with adding a new subnet to an existing Virtual Private Cloud (VPC) network in Google Cloud Platform. The VPC network is in custom mode and currently contains subnets in us-central1 and europe-west1. You need to create a new subnet in the asia-northeast1 region with a CIDR range of 10.4.0.0/16. Which of the following steps should you take to accomplish this task?
- A
Navigate to VPC networks in the Google Cloud Console, select the existing VPC, and click 'Add subnet'. Enter the necessary details and click 'Create'.
- B
Use the
gcloud compute networks subnets createcommand, specifying the VPC name, region, and CIDR range. - C
Navigate to the Cloud Deployment Manager, create a new configuration file that includes the new subnet, and deploy it.
- D
Use the
gcloud compute networks createcommand with the--subnet-mode=autoflag to automatically create subnets in all regions.
Show answer and explanation
Correct answer: B
Explanation
To add a new subnet to an existing VPC network in Google Cloud, you can use the gcloud compute networks subnets create command, which allows you to specify the VPC name, region, and the desired CIDR range. This method is efficient and aligns with the responsibilities of an Associate Cloud Engineer, who should be comfortable using command-line tools for managing Google Cloud resources.
- A. Incorrect.
This option is partially correct. While you can add a subnet via the Google Cloud Console, the question is geared towards command-line usage, which is more relevant for an Associate Cloud Engineer.
- B. Correct.
This is the correct method for adding a subnet to an existing VPC using the command line. It specifies the VPC, region, and CIDR range.
- C. Incorrect.
This option involves using Cloud Deployment Manager, which is unnecessary for simply adding a subnet to an existing VPC.
- D. Incorrect.
This option is incorrect because it creates a new VPC with automatic subnets, which does not meet the requirement of adding a subnet to an existing VPC.