# Copyright 2025 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# yaml-language-server: $schema=../../../schemas/billing-account.schema.json

id: $defaults:billing_account
# authoritative IAM must be used with care here, as it resets permissions
# three modes of managing billing IAM
# - at the org level (don't set anything here, set roles in the org)
# - at the billing account level (set the roles below)
# - no admin access to billing account (don't set roles here or in org)
iam_bindings_additive:
  billing_admin_org_admins:
    role: roles/billing.admin
    member: $iam_principals:gcp-organization-admins
  billing_admin_org_sa:
    role: roles/billing.admin
    member: $iam_principals:service_accounts/iac-0/iac-org-rw
  billing_viewer_org_ro:
    role: roles/billing.viewer
    member: $iam_principals:service_accounts/iac-0/iac-org-ro
  billing_user_security_sa:
    role: roles/billing.user
    member: $iam_principals:service_accounts/iac-0/iac-security-rw
  billing_user_networking_sa:
    role: roles/billing.user
    member: $iam_principals:service_accounts/iac-0/iac-networking-rw
  billing_user_pf_sa:
    role: roles/billing.user
    member: $iam_principals:service_accounts/iac-0/iac-pf-rw
# logging_sinks:
#   test:
#     description: Test sink
#     destination: $project_ids:log-0
#     type: project
