# Copyright 2026 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/project.schema.json

name: prod-iac-core-0
iam_by_principals:
  $iam_principals:gcp-organization-admins:
    - roles/iam.serviceAccountTokenCreator
    - roles/iam.workloadIdentityPoolAdmin
  $iam_principals:service_accounts/iac-0/iac-org-rw:
    - roles/cloudbuild.builds.editor
    - roles/iam.serviceAccountAdmin
    - roles/iam.workloadIdentityPoolAdmin
    - roles/owner
    - roles/storage.admin
services:
  - accesscontextmanager.googleapis.com
  - bigquery.googleapis.com
  - bigquerystorage.googleapis.com
  - cloudbilling.googleapis.com
  - cloudkms.googleapis.com
  - cloudresourcemanager.googleapis.com
  - compute.googleapis.com
  - container.googleapis.com
  - essentialcontacts.googleapis.com
  - iam.googleapis.com
  - iamcredentials.googleapis.com
  - logging.googleapis.com
  - monitoring.googleapis.com
  - orgpolicy.googleapis.com
  - pubsub.googleapis.com
  - serviceusage.googleapis.com
  - storage-component.googleapis.com
  - storage.googleapis.com
  - sts.googleapis.com
buckets:
  iac-org-state:
    description: Terraform state for the org-level automation.
    versioning: true
    iam:
      roles/storage.admin:
        - $iam_principals:service_accounts/iac-0/iac-org-rw
      $custom_roles:storage_viewer:
        - $iam_principals:service_accounts/iac-0/iac-org-ro
  iac-outputs:
    description: Terraform state for the org-level automation.
    versioning: true
    iam:
      roles/storage.admin:
        - $iam_principals:service_accounts/iac-0/iac-org-rw
service_accounts:
  iac-org-rw:
    display_name: IaC service account for org setup (read-write).
datasets:
  billing_export:
    friendly_name: Billing export
log_buckets:
  audit-logs:
    log_analytics:
      enable: true
    retention: 31
