Google Associate Cloud Engineer Question 262
Select 3Google Cloud PlatformYou are tasked with adding a new subnet to an existing VPC in your company's Google Cloud Platform environment. The VPC currently spans multiple regions, and the new subnet needs to be located in the us-central1 region with a CIDR range of 10.0.2.0/24. Which steps should you take to correctly add this subnet?
- A
Navigate to the 'VPC network' section in the Google Cloud Console and select the desired VPC.
- B
Click 'Edit' on the VPC and add the subnet with the specified CIDR under 'Custom subnets'.
- C
Click 'Add subnet', specify the name, region as us-central1, and the IP address range as 10.0.2.0/24.
- D
Use the gcloud command-line tool with the command: gcloud compute networks subnets create to add the subnet.
- E
Directly modify the VPC configuration file and deploy the changes.
Show answer and explanation
Correct answers: A, C, D
Explanation
To add a subnet to an existing VPC in Google Cloud, you can use either the Google Cloud Console or the gcloud CLI. In the console, you need to navigate to the VPC network section, select the VPC, and then use the 'Add subnet' option to provide the necessary details such as name, region, and IP range. Alternatively, using the gcloud command-line tool with the appropriate command and parameters is also a valid method. Direct modification of configuration files is not supported for this task.
- A. Correct.
This is the first step to access the VPC configuration where you can add subnets.
- B. Incorrect.
This option is incorrect because subnets are not added through the 'Edit' button, but rather by using the 'Add subnet' option.
- C. Correct.
This is a correct step where you specify the details for the new subnet including the region and IP address range.
- D. Correct.
This is a valid approach using the gcloud CLI, specifying the network, region, and IP range for the new subnet.
- E. Incorrect.
Modifying a VPC configuration file directly is not a supported method in GCP for adding subnets.