canada-ca / accelerators_accelerateurs-gcp

[GCP] Tools and templates to accelerate GC service delivery. Outils et modèles pour accélérer la prestation de services du GC.
MIT License
10 stars 8 forks source link

Adjust bootstrap.sh to add the Billing Account Administrator role to the TF Service Account for both the Billing view as well as existing IAM view #38

Open fmichaelobrien opened 2 years ago

fmichaelobrien commented 2 years ago

For accounts where the billing account is associated externally (not via direct credit card link) - we need to automate/verify that the "Billing Account Administrator" role is also set on the billing view - just like it already is in the IAM view.

see bootstrap.sh

gcloud organizations add-iam-policy-binding ${org_id}  --member=serviceAccount:${act} --role=roles/billing.admin

This is not sufficient to set the billing view context role - the following terraform permission error will occur

Error: failed pre-requisites: missing permission on "billingAccounts/0........": billing.resourceAssociations.create
│
│   with module.administration.module.project-factory.google_project.main,
│   on .terraform/modules/administration/modules/core_project_factory/main.tf line 65, in resource "google_project" "main":
│   65: resource "google_project" "main" {

update https://github.com/canada-ca/accelerators_accelerateurs-gcp/blob/main/deployment-templates/Terraform/guardrails/README.md

Screen Shot 2022-06-13 at 3 04 03 PM