2022-01-21 09:40:11 -08:00
|
|
|
# Copyright 2022 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
|
|
|
|
#
|
|
|
|
# https://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.
|
|
|
|
|
2022-02-02 06:31:54 -08:00
|
|
|
# tfdoc:file:description common project.
|
2022-01-31 21:41:33 -08:00
|
|
|
|
2022-02-09 08:01:25 -08:00
|
|
|
module "common-project" {
|
|
|
|
source = "../../../modules/project"
|
|
|
|
parent = var.folder_id
|
|
|
|
billing_account = var.billing_account_id
|
|
|
|
prefix = var.prefix
|
|
|
|
name = "cmn"
|
|
|
|
group_iam = {
|
|
|
|
(local.groups.data-engineers) = [
|
2022-01-21 09:40:11 -08:00
|
|
|
"roles/dlp.reader",
|
|
|
|
"roles/dlp.user",
|
|
|
|
"roles/dlp.estimatesAdmin",
|
2022-02-09 08:01:25 -08:00
|
|
|
]
|
|
|
|
(local.groups.data-security) = [
|
2022-01-21 09:40:11 -08:00
|
|
|
"roles/dlp.admin",
|
2022-02-09 08:01:25 -08:00
|
|
|
]
|
2022-01-21 09:40:11 -08:00
|
|
|
}
|
2022-02-09 08:01:25 -08:00
|
|
|
iam = {
|
2022-01-21 09:40:11 -08:00
|
|
|
"roles/dlp.user" = [
|
2022-02-09 08:01:25 -08:00
|
|
|
module.load-sa-df-0.iam_email,
|
|
|
|
module.transf-sa-df-0.iam_email
|
2022-01-21 09:40:11 -08:00
|
|
|
]
|
|
|
|
}
|
|
|
|
services = concat(var.project_services, [
|
2022-02-02 07:51:14 -08:00
|
|
|
"datacatalog.googleapis.com",
|
2022-01-21 09:40:11 -08:00
|
|
|
"dlp.googleapis.com",
|
|
|
|
])
|
|
|
|
}
|
|
|
|
|
2022-02-08 08:46:34 -08:00
|
|
|
# To create KMS keys in the common projet: uncomment this section and assigne key links accondingly in local.service_encryption_keys variable
|
2022-01-21 09:40:11 -08:00
|
|
|
|
2022-02-02 07:51:14 -08:00
|
|
|
# module "cmn-kms-0" {
|
2022-01-31 09:58:55 -08:00
|
|
|
# source = "../../../modules/kms"
|
2022-02-11 15:50:38 -08:00
|
|
|
# project_id = module.common-project.project_id
|
2022-01-31 09:58:55 -08:00
|
|
|
# keyring = {
|
|
|
|
# name = "${var.prefix}-kr-global",
|
2022-02-11 15:50:38 -08:00
|
|
|
# location = "global"
|
2022-01-31 09:58:55 -08:00
|
|
|
# }
|
|
|
|
# keys = {
|
|
|
|
# pubsub = null
|
|
|
|
# }
|
|
|
|
# }
|
2022-01-31 08:11:06 -08:00
|
|
|
|
2022-02-02 07:51:14 -08:00
|
|
|
# module "cmn-kms-1" {
|
2022-01-31 09:58:55 -08:00
|
|
|
# source = "../../../modules/kms"
|
2022-02-11 15:50:38 -08:00
|
|
|
# project_id = module.common-project.project_id
|
2022-01-31 09:58:55 -08:00
|
|
|
# keyring = {
|
|
|
|
# name = "${var.prefix}-kr-mregional",
|
2022-02-11 15:50:38 -08:00
|
|
|
# location = var.location
|
2022-01-31 09:58:55 -08:00
|
|
|
# }
|
|
|
|
# keys = {
|
|
|
|
# bq = null
|
|
|
|
# storage = null
|
|
|
|
# }
|
|
|
|
# }
|
2022-01-21 09:40:11 -08:00
|
|
|
|
2022-02-02 07:51:14 -08:00
|
|
|
# module "cmn-kms-2" {
|
2022-01-31 09:58:55 -08:00
|
|
|
# source = "../../../modules/kms"
|
2022-02-02 07:51:14 -08:00
|
|
|
# project_id = module.cmn-prj.project_id
|
2022-01-31 09:58:55 -08:00
|
|
|
# keyring = {
|
|
|
|
# name = "${var.prefix}-kr-regional",
|
2022-02-11 15:50:38 -08:00
|
|
|
# location = var.region
|
2022-01-31 09:58:55 -08:00
|
|
|
# }
|
|
|
|
# keys = {
|
|
|
|
# composer = null
|
|
|
|
# dataflow = null
|
|
|
|
# }
|
|
|
|
# }
|