Google Associate Cloud Engineer Question 261
Single answerGoogle Cloud PlatformYou are a cloud engineer managing your company's Google Cloud Platform resources. Your company has an existing Virtual Private Cloud (VPC) network, 'prod-vpc', and you need to add a new subnet to this VPC for a newly planned application deployment in the 'us-central1' region. Which of the following steps should you take to successfully add the subnet?
- A
Navigate to the VPC network details page in the Google Cloud Console and click 'Add Subnet'.
- B
Use the 'gcloud compute networks subnets create' command, specifying the VPC name and region.
- C
Use the 'gcloud compute networks list' command to view existing networks before adding a subnet.
- D
Create a new VPC network since subnets cannot be added to an existing VPC.
Show answer and explanation
Correct answer: B
Explanation
To add a subnet to an existing VPC in Google Cloud, you can use the 'gcloud compute networks subnets create' command. This allows you to specify the VPC network name ('prod-vpc'), the region ('us-central1'), and other necessary details such as the subnet range. This step is essential for configuring network segmentation and defining IP allocation within your VPC.
- A. Incorrect.
While you can manage VPC networks in the Google Cloud Console, adding a subnet is done through the 'Create Subnet' button, not 'Add Subnet'.
- B. Correct.
This is the correct method using the Google Cloud SDK. The 'gcloud compute networks subnets create' command allows you to specify details such as the VPC name and region.
- C. Incorrect.
Listing networks is useful for verification but does not add a subnet.
- D. Incorrect.
This statement is incorrect. You can add subnets to an existing VPC network in Google Cloud.