0
0
GCPcloud~30 mins

Folders for grouping projects in GCP - Mini Project: Build & Apply

Choose your learning style9 modes available
Folders for grouping projects
📖 Scenario: You work in a company that uses Google Cloud Platform (GCP) to manage many projects. To keep things organized, you want to group related projects under folders. This helps your team find and manage projects easily.
🎯 Goal: Create a folder structure in GCP to group projects by department. You will first define a folder, then add a label to it, then list projects under it, and finally set a policy to control access.
📋 What You'll Learn
Create a folder named departments under the organization
Add a label env:production to the folder
List projects under the departments folder
Set an IAM policy binding to allow a user to view projects in the folder
💡 Why This Matters
🌍 Real World
Organizing cloud projects into folders helps companies manage resources better and apply policies consistently.
💼 Career
Cloud engineers and administrators often create folder structures and manage access to keep cloud environments secure and organized.
Progress0 / 4 steps
1
Create a folder named departments
Write a gcloud command to create a folder named departments under the organization with ID 1234567890. Use the command gcloud resource-manager folders create --display-name=departments --organization=1234567890.
GCP
Need a hint?

Use the gcloud resource-manager folders create command with the --display-name and --organization flags.

2
Add a label env:production to the departments folder
Write a gcloud command to add the label env=production to the folder with ID 9876543210. Use the command gcloud resource-manager folders update 9876543210 --update-labels=env=production.
GCP
Need a hint?

Use the gcloud resource-manager folders update command with the folder ID and the --update-labels flag.

3
List projects under the departments folder
Write a gcloud command to list all projects under the folder with ID 9876543210. Use the command gcloud projects list --filter="parent.id=9876543210".
GCP
Need a hint?

Use gcloud projects list with the --filter flag to show projects under the folder.

4
Set an IAM policy binding to allow user user:alice@example.com to view projects in the folder
Write a gcloud command to add the IAM policy binding for the folder with ID 9876543210 to grant the role roles/viewer to the user alice@example.com. Use the command gcloud resource-manager folders add-iam-policy-binding 9876543210 --member='user:alice@example.com' --role='roles/viewer'.
GCP
Need a hint?

Use gcloud resource-manager folders add-iam-policy-binding with the folder ID, member, and role flags.