Conditionally creates billing sink if the billing account is of type resource (#3130)

* updated billing.tf file to conditionally creates billing sink if the billing account resides out of org

* replace resources with modules

* replace individual iam resources with billing_iam local passed in the module

* update module name and path and move iam from local to module call

* update README.md

* Add log_bucket option to billing_account variable, and update billing account IAM assignments

* update 0-bootstrap README to reflect changes to billing account module

* Update current bootstrap tests to reflect the change to billing_account variable

* Create test for the case when billing account log bucket is created

* running fmt

---------

Co-authored-by: Ludovico Magnocavallo <ludomagno@google.com>
This commit is contained in:
Ali-Aburub
2025-07-21 18:09:36 +03:00
committed by GitHub
parent eae95187e5
commit ae6b3ee18d
8 changed files with 2279 additions and 51 deletions

View File

@@ -2493,6 +2493,7 @@ outputs:
force_create:
dataset: false
project: false
log_bucket: false
id: 000000-111111-222222
is_org_level: true
no_iam: false

View File

@@ -0,0 +1,23 @@
billing_account = {
id = "000000-111111-222222"
is_org_level = false
force_create = {
dataset = true
project = true
log_bucket = true
}
}
essential_contacts = "gcp-organization-admins@fast.example.com"
groups = {
gcp-support = "group:gcp-support@example.com"
}
org_policies_config = {
import_defaults = false
}
organization = {
domain = "fast.example.com"
id = 123456789012
customer_id = "C00000000"
}
outputs_location = "/fast-config"
prefix = "fast"

File diff suppressed because it is too large Load Diff

View File

@@ -1604,6 +1604,7 @@ outputs:
force_create:
dataset: false
project: false
log_bucket: false
id: 000000-111111-222222
is_org_level: true
no_iam: false

View File

@@ -23,5 +23,8 @@ tests:
inventory:
- simple.yaml
- managed_org_policies.yaml
external_billing_account:
inventory:
- external_billing_account.yaml
iam_by_principals:
cicd: