* security fixes * change netsec to be a virtual stage in resman * remove netsec bits from security stage, leave CAs in place * netsec - security profile groups * export regions to networking tfvars * netsec - trust stores * netsec refactor, untested * netsec plan working * netsec apply * netsec apply errors * netsec diagram * update diagram * move addon stages to addons folder * remove top-level assets folder * deprecate and remove fast plugins * addon tests * dynamic addon providers and cicd, untested * stage 1 addons in stage 0, refactor stage 0 cicd * addons and cicd refactor in stage 0 with tests * refactor stage 0 cicd * readd removed block * small bootstrap cicd fixes * refactor stage 1 cicd * resman tests * remove plugins from networking tests * fix fast tests * ngfw addon outputs * try to fix unrelated tflint error in bootstrap * remove common tfvars from bootstrap tests to fix linter errors * tfdoc * minimal readmes and links fixes * tfdoc * trim down test inventories * fix plan test * tfdoc * allow configuring output files names * fix tls inspection after adding count to project module * comment fixes * tfdoc
51 lines
1.6 KiB
HCL
51 lines
1.6 KiB
HCL
/**
|
|
* Copyright 2024 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.
|
|
*/
|
|
|
|
locals {
|
|
default_environment = [
|
|
for k, v in var.environments : v if v.is_default == true
|
|
][0]
|
|
tenants = {
|
|
for k, v in var.tenant_configs : k => merge(v, {
|
|
billing_account = merge(v.billing_account, {
|
|
id = coalesce(v.billing_account.id, var.billing_account.id)
|
|
# only set is_org_level when using the org billing account
|
|
is_org_level = (
|
|
v.billing_account.id == null ||
|
|
v.billing_account.id == var.billing_account.id
|
|
) ? var.billing_account.is_org_level : false
|
|
})
|
|
locations = coalesce(v.locations, var.locations)
|
|
organization = coalesce(v.cloud_identity, var.organization)
|
|
})
|
|
}
|
|
}
|
|
|
|
module "organization" {
|
|
source = "../../../modules/organization"
|
|
organization_id = "organizations/${var.organization.id}"
|
|
tags = {
|
|
(var.tag_names.tenant) = {
|
|
description = "Resource management tenant."
|
|
values = {
|
|
for k, v in local.tenants : k => {
|
|
description = v.descriptive_name
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|