This document provides instructions for linking a billing account to a project in
GDC. This allows costs incurred by the project's
resources to be tracked and charged to the specified billing account.

## Before you begin

Ask your IAM Org Admin to grant you the following
required roles:

- **Billing Account Org Admin** : create, manage, and bind the
  `BillingAccount` resource in the `platform` namespace. Ask your IAM Org Admin
  to grant you the
  `organization-billing-account-admin` role in the `platform` namespace.

- **Billing Account Org User** : read, list, and bind the `BillingAccount`
  resource in the `platform` namespace. Ask your IAM Org Admin to grant you the
  `organization-billing-account-user` role in the `platform` namespace.

- **Billing Org Manager** : read, list, create, and update the
  `BillingAccountBinding` resource across namespaces (such as the `platform`
  namespace for organization-level billing or a project namespace for
  project-level billing). Ask your IAM Org Admin
  to grant you the `organization-billing-manager` role.

> [!NOTE]
> **Note:** Billing for all projects is managed by the same IAM role. To separate billing administration for different projects, one dedicated role is required for each project. Contact your IAM Org Admin to create additional roles for individual project administration requirements.

### Get the kubeconfig file

To run verification commands against the global API server,
[sign in and generate](https://docs.cloud.google.com/distributed-cloud/hosted/docs/1.16/gdcag/application/ao-user/iam/sign-in#global-resources-kubeconfig)
the kubeconfig file for the global API server if you don't have one.

> [!NOTE]
> **Note:** When managing `BillingAccount` and `BillingAccountBinding` custom resources (CRs) using YAML manifests, note that they are global resources and must be applied to the global API server. Don't apply or modify these YAML files directly using `kubectl apply` or `kubectl edit`. Instead, follow the Git-based Infrastructure as Code (IaC) workflow in the `IAC-R0004: Create and merge a merge request` runbook to commit them to the `infrastructure/global/orgs/ORG_NAME/oc/bil/` directory of the `iac` repository and go through the multi-party approval (MPA) process.

## Create a billing account

If you need to create a new billing account before linking it to a project,
follow the instructions in
[Create a new billing account](https://docs.cloud.google.com/distributed-cloud/hosted/docs/1.16/gdcag/platform/pa-user/billing/manage-billing-accounts#create-a-new-billing-account).

## Link project to billing account

To associate a project with an existing billing account, see the steps for
[Link a project](https://docs.cloud.google.com/distributed-cloud/hosted/docs/1.16/gdcag/platform/pa-user/billing/manage-billing-accounts#link-bil-account-to-project-or-org).

## Change the linked billing account for a project

If you need to change the billing account associated with a project, see
[Change the linked billing account](https://docs.cloud.google.com/distributed-cloud/hosted/docs/1.16/gdcag/platform/pa-user/billing/manage-billing-accounts#change-bil-account).