This Qwiklabs challenge lab tests your ability to create and manage core Google Cloud resources. Below is a concise, step-by-step guide (with both Console and CLI options) to complete all tasks successfully:
Prerequisites
Ensure you’re logged into the Google Cloud Console with your Qwiklabs account and have the gcloud CLI configured (if using CLI).
Task 1: Create a Project
Replace xxxxxxxxx with your unique Qwiklabs ID.
- Console:
- Go to Project Selector → New Project.
- Name:
qwiklabs-gcp-00-xxxxxxxxx→ Click Create.
- CLI:
gcloud projects create qwiklabs-gcp-00-xxxxxxxxx --name="My Lab Project" gcloud config set project qwiklabs-gcp-00-xxxxxxxxx # Set as default
Task 2: Set Up VPC Network & Subnet
- Console:
- Go to VPC Networks → Create VPC Network.
- Name:
my-vpc→ Subnet mode: Custom. - Add Subnet: Name
my-subnet, Region (e.g.,us-central1), IP range10.0.0.0/24→ Create.
- CLI:
gcloud compute networks create my-vpc --subnet-mode=custom gcloud compute networks subnets create my-subnet \ --network=my-vpc \ --region=us-central1 \ --range=10.0.0.0/24
Task3: Deploy Compute Engine Instance
- Console:
- Go to Compute Engine → Instances → Create Instance.
- Name:
my-instance, Region:us-central1, Zone:us-central1-a(same region as subnet). - Machine type:
e2-micro, Boot disk: Debian 10. - Networking: Select
my-vpcandmy-subnet→ Create.
- CLI:
gcloud compute instances create my-instance \ --zone=us-central1-a \ --machine-type=e2-micro \ --image-family=debian-10 \ --image-project=debian-cloud \ --subnet=my-subnet
Task4: Configure Firewall Rule (Allow HTTP)
- Console:
- Go to VPC Networks → Firewall Rules → Create Firewall Rule.
- Name:
allow-http, Network:my-vpc. - Target: All instances in the network, Source IP:
0.0.0.0/0. - Protocols: Check
tcp, Port:80→ Create.
- CLI:
gcloud compute firewall-rules create allow-http \ --network=my-vpc \ --allow=tcp:80 \ --source-ranges=0.0.0.0/0
Task5: Set Up Cloud Storage Bucket
Bucket names are globally unique—add your Qwiklabs ID to avoid conflicts.
- Console:
- Go to Cloud Storage → Buckets → Create Bucket.
- Name:
my-bucket-xxxxxxxxx, Region:us-central1, Storage class: Standard → Create.
- CLI:
gsutil mb -l us-central1 gs://my-bucket-xxxxxxxxx/
Task6: Manage IAM Access
Add a test user (replace test-user@example.com with a valid email) with Storage Object Viewer role.
- Console:
- Go to IAM & Admin → IAM → Add.
- Enter email → Select role: Storage → Storage Object Viewer → Save.
- CLI:
gcloud projects add-iam-policy-binding qwiklabs-gcp-00-xxxxxxxxx \ --member=user:test-user@example.com \ --role=roles/storage.objectViewer
Key Notes
- Bucket Uniqueness: If your bucket name is taken, append more unique characters (e.g., your full Qwiklabs ID).
- Firewall Propagation: Wait 1-2 minutes for rules to apply before testing HTTP access.
- Zone Consistency: Ensure your instance’s zone is in the same region as the subnet (e.g.,
us-central1-aforus-central1).
By following these steps, you’ll complete the lab and demonstrate core Google Cloud resource management skills!


作者声明:本文包含人工智能生成内容。