Google Cloud Tutorial · Google Cloud Basics · Lesson 2 of 27
Organisation, Folders and Projects
How Google Cloud organises resources into an organisation, folders and projects, and how policies inherit.
Projects
Every resource (a VM, a bucket, a database) belongs to exactly one project. A project is the unit of:
- isolation: resources in different projects don't see each other by default;
- billing: each project is linked to a billing account;
- quotas and APIs: you enable each API (Compute Engine, Cloud Run…) per project.
Projects have a human-friendly name, a globally unique, permanent project ID (acme-orders-prod) and a
project number that Google uses internally.
Folders and the organisation
Companies group projects into folders (for example production, non-production, or per department) under one
organisation node linked to their Cloud Identity or Google Workspace domain. The organisation belongs to the
company, not to the employee who created the first project.
Organisation (acme.com)
├── Folder: production
│ ├── Project: acme-orders-prod
│ └── Project: acme-payments-prod
└── Folder: non-production
└── Project: acme-orders-dev
Inheritance
IAM roles and organisation policies set on the organisation or a folder apply to everything below. Granting
roles/viewer on the production folder gives read access to every production project. You can add access lower
down, but you can't remove an inherited grant at a lower level (only an IAM deny policy can block it).
parents = {"acme-orders-prod": "production", "acme-orders-dev": "non-production",
"production": "acme.com", "non-production": "acme.com"}
grants = { # node -> {principal: [roles]}
"acme.com": {"group:[email protected]": ["roles/iam.securityReviewer"]},
"production": {"group:[email protected]": ["roles/viewer"]},
"acme-orders-prod": {"group:[email protected]": ["roles/run.developer"]},
}
def effective_roles(node):
roles = {}
while node: # walk up to the organisation
for who, rs in grants.get(node, {}).items():
roles.setdefault(who, []).extend(f"{r} (from {node})" for r in rs)
node = parents.get(node)
return roles
for project in ["acme-orders-prod", "acme-orders-dev"]:
print(project)
for who, rs in effective_roles(project).items():
print(" ", who, "->", ", ".join(rs))
Output
acme-orders-prod group:[email protected] -> roles/run.developer (from acme-orders-prod) group:[email protected] -> roles/viewer (from production) group:[email protected] -> roles/iam.securityReviewer (from acme.com) acme-orders-dev group:[email protected] -> roles/iam.securityReviewer (from acme.com)
Test yourself
A role granted on a folder applies to…
only the folder itselfevery project and resource inside that folderonly projects created after the grantthe whole organisation
Show answer
Answer: every project and resource inside that folder
IAM policies inherit downwards through the hierarchy.