Skip to content

Clarified some steps in fast/stages/0-org-setup to make it easier for newcomers - #4049

Closed
caleonardo wants to merge 2 commits into
GoogleCloudPlatform:masterfrom
caleonardo:caleonardo/clarify-docs-0-org-setup
Closed

Clarified some steps in fast/stages/0-org-setup to make it easier for newcomers#4049
caleonardo wants to merge 2 commits into
GoogleCloudPlatform:masterfrom
caleonardo:caleonardo/clarify-docs-0-org-setup

Conversation

@caleonardo

Copy link
Copy Markdown

While going through Fast Fabric deployment, I've clarified a few parts of the README.md documentation. I hope this is helpful

@juliocc juliocc left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR. Overall this looks good and it does improve the experience for newcomers.

I left a few comments below.

Comment on lines +215 to +231
##### Provider Configuration for edge cases

In some cases, i.e: if you are running the bootstrap process from a Google Cloud Compute Engine (GCE VM), rather than your local laptop, the setup behaves differently. The issue is that Terraform detects it is running inside a GCE VM instance and falls back to using the GCE VM management project to track API quota usage. The workaround is to create a temporary `providers.tf` file in the `fast/stages/0-org-setup/` directory to explicitly declare the billing project to be used during bootstrap.

```terraform
# Temporary providers.tf file to resolve quota project issues during bootstrap
provider "google" {
user_project_override = true
billing_project = "[project id]"
}

provider "google-beta" {
user_project_override = true
billing_project = "[project id]"
}
```

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The way we usually manage this is by setting the default (or quota) project via gcloud.

I wouldn't suggest creating a provider file this way as it can cause issues later with the one that we generate/link later.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added this section because Terraform was ignoring the quota project I set via gcloud. Now, the machine I am running all this is a GCE VM (from a separate organization btw) and terraform was simply assuming the GCE VM's project as the quota project.

Do you know of another way to specify the quota project? Or do you think my use case is so niche that it might not be worth adding to the README.md?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My my concern is that you might end up with multiple provider files.

@ludoo wdyt?

@ludoo ludoo Jul 7, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 on not creating provider files, we configure the default project which is easier and works if left in place for subsequent runs

To create `iam:` part of the `/organization/.config.yaml` file, you can use following snippet:
##### IAM by Role (Authoritative)

The `iam:` block of the factory YAML file (`/organization/.config.yaml`) is authoritative, meaning that it will overwrite any existing IAM bindings on the resource, removing any binding for any role that is not explicitly listed. It is grouped by role name and contains a list of members.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

meaning that it will overwrite any existing IAM bindings on the resource, removing any binding for any role that is not explicitly listed

This (seems) incorrect. Perhaps leave the introductory text but don't explain what an authoritative binding is

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you confirm if these three use cases correspond to the Terraform resources linked here:

IAM by Role (Authoritative)
IAM by Principal (Authoritative)
IAM by Principal Additive (Non-Authoritative)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, not exactly. iam and iam_by_principals is authoritative (uses *_iam_binding) while iam_by_principals_additive is non-authoritative (uses *_iam_member)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

authoritative for the roles it includes, it's not a IAM policy so it's not authoritative for the resource, and I agree with Julio this is not the place to explain it

To create `iam_by_principals:` part of the factory YAML file, you can use following snippet:
##### IAM by Principal (Authoritative)

The `iam_by_principals:` block of the factory YAML file (`/organization/.config.yaml`) is authoritative, meaning that it will overwrite any existing IAM bindings on the resource, removing any binfing for any principal that is not explicitly listed. It behaves exactly like `iam:` and is provided as a convenience for those who prefer to group IAM bindings by principal.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as before

@ludoo ludoo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR, some good bits in here. Left a few comments on some critical edits.

TBH the skill we have should be the default ingress path for users, and when run can be prompted to answer many of the questions addressed here which IMHO are too low level for this specific doc (how our IAM interface works for example).

# - no admin access to billing account (don't set roles here or in org)
# Choose one of the following three modes of managing billing IAM:
# 1. at the org level: don't set the roles here. Delete the
# "iam_bindings_additive" block below and set roles in the organization

@ludoo ludoo Jul 7, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or simply delete the file, or change path for billing in factories_config (which preserves the file but ignores it)

# "iam_bindings_additive" block below
# 3. no admin access to billing account: if your billing account is either
# shared or externally managed, don't set roles here nor in org. Delete the
# "iam_bindings_additive" block below and don't set roles in the organization either.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see above

- one organization
- credentials with admin access to the organization and one billing account
- credentials with admin access to the organization
- one billing account

@ludoo ludoo Jul 7, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BA is optional

The admin principal is typically a group that includes the user running the first apply, but any kind of principal is supported. More principals (network admins, security admins, etc.) are present in some of the [default factories datasets](#default-factory-datasets), and others can be added if needed by editing the YAML configuration files.
You have sufficient permissions to manage billing IAM on either:
- an Organization-associated / Organization-level Billing Account: owned and managed directly within your Google Cloud Organization
- a Cross-Organization Billing or Reseller Billing Subaccount: externally managed billing account

@ludoo ludoo Jul 7, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with reseller accounts you almost never manage them, you only use them

You have sufficient permissions to manage billing IAM on either:
- an Organization-associated / Organization-level Billing Account: owned and managed directly within your Google Cloud Organization
- a Cross-Organization Billing or Reseller Billing Subaccount: externally managed billing account
Get familiar with the [IAM relationship between organizations, projects and Cloud Billing accounts](https://docs.cloud.google.com/billing/docs/how-to/billing-access#relationships-between-resources) and refer to the [billing section](#billing-account-iam) for more details or non-standard configurations.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is too much detail to give here, and not needed imho


If you do not have sufficient permissions to manage billing IAM (common in "brownfield" environments or when using External / Reseller Billing Subaccounts), the IAM bindings need to be assigned via an external flow. Therefore, you need to remove billing IAM bindings from the YAML configuration files:
1. remove billing IAM bindings (`iam_bindings_additive:`) from file `datasets/[dataset_name]/billing-accounts/default.yaml` and
2. remove billing IAM bindings (`iam: > roles/billing.creator:`) from file `datasets/[dataset_name]/organization/.config.yaml`

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

harmless if they stay, so optional

##### If you cannot manage billing IAM

If you do not have sufficient permissions to manage billing IAM (common in "brownfield" environments or when using External / Reseller Billing Subaccounts), the IAM bindings need to be assigned via an external flow. Therefore, you need to remove billing IAM bindings from the YAML configuration files:
1. remove billing IAM bindings (`iam_bindings_additive:`) from file `datasets/[dataset_name]/billing-accounts/default.yaml` and

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just remove the file or redirect the factory to a dummy path, easier and cleaner

Comment on lines +215 to +231
##### Provider Configuration for edge cases

In some cases, i.e: if you are running the bootstrap process from a Google Cloud Compute Engine (GCE VM), rather than your local laptop, the setup behaves differently. The issue is that Terraform detects it is running inside a GCE VM instance and falls back to using the GCE VM management project to track API quota usage. The workaround is to create a temporary `providers.tf` file in the `fast/stages/0-org-setup/` directory to explicitly declare the billing project to be used during bootstrap.

```terraform
# Temporary providers.tf file to resolve quota project issues during bootstrap
provider "google" {
user_project_override = true
billing_project = "[project id]"
}

provider "google-beta" {
user_project_override = true
billing_project = "[project id]"
}
```

@ludoo ludoo Jul 7, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 on not creating provider files, we configure the default project which is easier and works if left in place for subsequent runs

#### Importing org policies

If your dataset includes org policies which are already set in the organization, the first apply will fail with a `409 Conflict` error. In this case, you must either comment them out in the relevant YAML files or configure this stage to import them. To figure out which policies are set, run `gcloud org-policies list --organization [your org id]`, then set the `org_policies_imports` variable in your tfvars file. The following is an example.
If your dataset includes org policies which are already set in the organization, the first apply will fail with a `409 Conflict` error. In this case, you must either comment them out in the relevant factory YAML files (`fast/stages/0-org-setup/datasets/<YOUR_CHOSEN_DATASET>/organization/org-policies/*.yaml`) or configure this stage to import them.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should link to the instructions for importing from here

To create `iam:` part of the `/organization/.config.yaml` file, you can use following snippet:
##### IAM by Role (Authoritative)

The `iam:` block of the factory YAML file (`/organization/.config.yaml`) is authoritative, meaning that it will overwrite any existing IAM bindings on the resource, removing any binding for any role that is not explicitly listed. It is grouped by role name and contains a list of members.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

authoritative for the roles it includes, it's not a IAM policy so it's not authoritative for the resource, and I agree with Julio this is not the place to explain it

@ludoo

ludoo commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

I'm closing this as it got no traction for the last 3 weeks. Feel free to reopen once comments have been accounted for.

@ludoo ludoo closed this Jul 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants