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:
@@ -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
|
||||
|
||||
@@ -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"
|
||||
2172
tests/fast/stages/s0_bootstrap/external_billing_account.yaml
Normal file
2172
tests/fast/stages/s0_bootstrap/external_billing_account.yaml
Normal file
File diff suppressed because it is too large
Load Diff
@@ -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
|
||||
|
||||
@@ -23,5 +23,8 @@ tests:
|
||||
inventory:
|
||||
- simple.yaml
|
||||
- managed_org_policies.yaml
|
||||
external_billing_account:
|
||||
inventory:
|
||||
- external_billing_account.yaml
|
||||
iam_by_principals:
|
||||
cicd:
|
||||
|
||||
Reference in New Issue
Block a user