An operations team needs to update the network configuration for a custom subnet named `prod-analytics-subnet` located in region `us-east1` within the Virtual Private Cloud (VPC) network `corp-vpc`. The requirements are:
1. Enable VPC Flow Logs on `prod-analytics-subnet` with an aggregation interval set to 5 seconds (`INTERVAL_5_SEC`).
2. Update the existing Cloud NAT service named `nat-config-east` on Cloud Router `nat-router-east` so that `prod-analytics-subnet` is included to provide outbound internet access for private virtual machines using automatically allocated external IP addresses.
Which TWO `gcloud` CLI commands must the team run to satisfy these operational requirements?
- `gcloud compute networks subnets update prod-analytics-subnet --region=us-east1 --enable-flow-logs --logging-aggregation-interval=INTERVAL_5_SEC`Cevap
- B`gcloud compute networks subnets expand-ip-range prod-analytics-subnet --region=us-east1 --enable-flow-logs --logging-aggregation-interval=INTERVAL_5_SEC`
- `gcloud compute routers nats update nat-config-east --router=nat-router-east --region=us-east1 --auto-allocate-nat-external-ips --add-subnetworks=prod-analytics-subnet`Cevap
- D`gcloud compute firewall-rules create allow-nat-egress --network=corp-vpc --direction=INGRESS --priority=1000 --action=ALLOW --rules=tcp:80,443`
Cevap
The two correct commands are `gcloud compute networks subnets update prod-analytics-subnet --region=us-east1 --enable-flow-logs --logging-aggregation-interval=INTERVAL_5_SEC` and `gcloud compute routers nats update nat-config-east --router=nat-router-east --region=us-east1 --auto-allocate-nat-external-ips --add-subnetworks=prod-analytics-subnet`.
To manage Google Cloud networking resources effectively, enabling or modifying VPC Flow Logs on an existing subnet requires running `gcloud compute networks subnets update` with the `--enable-flow-logs` flag and setting `--logging-aggregation-interval=INTERVAL_5_SEC`. To attach a subnet to an existing Cloud NAT configuration without replacing current settings, `gcloud compute routers nats update` must be used with the `--add-subnetworks` flag along with required parameters such as `--router` and `--region`.
Adım Adım Çözüm
Anahtar Kavram
Managing VPC Subnet Settings and Cloud NAT Resources
Tahmini Süre:1m 30s