add support for optional project suffix
This commit is contained in:
@@ -25,7 +25,7 @@ module "land-project" {
|
||||
parent = var.folder_id
|
||||
billing_account = var.billing_account_id
|
||||
prefix = var.prefix
|
||||
name = "lnd"
|
||||
name = "lnd${local.project_suffix}"
|
||||
group_iam = {
|
||||
(local.groups.data-engineers) = [
|
||||
"roles/bigquery.dataEditor",
|
||||
|
||||
@@ -38,7 +38,7 @@ module "load-project" {
|
||||
parent = var.folder_id
|
||||
billing_account = var.billing_account_id
|
||||
prefix = var.prefix
|
||||
name = "lod"
|
||||
name = "lod${local.project_suffix}"
|
||||
group_iam = {
|
||||
(local.groups.data-engineers) = [
|
||||
"roles/compute.viewer",
|
||||
|
||||
@@ -32,7 +32,7 @@ module "orch-project" {
|
||||
parent = var.folder_id
|
||||
billing_account = var.billing_account_id
|
||||
prefix = var.prefix
|
||||
name = "orc"
|
||||
name = "orc${local.project_suffix}"
|
||||
group_iam = {
|
||||
(local.groups.data-engineers) = [
|
||||
"roles/bigquery.dataEditor",
|
||||
|
||||
@@ -32,7 +32,7 @@ module "transf-project" {
|
||||
parent = var.folder_id
|
||||
billing_account = var.billing_account_id
|
||||
prefix = var.prefix
|
||||
name = "trf"
|
||||
name = "trf${local.project_suffix}"
|
||||
group_iam = {
|
||||
(local.groups.data-engineers) = [
|
||||
"roles/bigquery.jobUser",
|
||||
|
||||
@@ -92,7 +92,7 @@ module "lake-0-project" {
|
||||
parent = var.folder_id
|
||||
billing_account = var.billing_account_id
|
||||
prefix = var.prefix
|
||||
name = "dtl-0"
|
||||
name = "dtl-0${local.project_suffix}"
|
||||
group_iam = local.lake_group_iam
|
||||
iam = local.lake_0_iam
|
||||
services = local.lake_services
|
||||
@@ -107,7 +107,7 @@ module "lake-1-project" {
|
||||
parent = var.folder_id
|
||||
billing_account = var.billing_account_id
|
||||
prefix = var.prefix
|
||||
name = "dtl-1"
|
||||
name = "dtl-1${local.project_suffix}"
|
||||
group_iam = local.lake_group_iam
|
||||
iam = local.lake_iam
|
||||
services = local.lake_services
|
||||
@@ -122,7 +122,7 @@ module "lake-2-project" {
|
||||
parent = var.folder_id
|
||||
billing_account = var.billing_account_id
|
||||
prefix = var.prefix
|
||||
name = "dtl-2"
|
||||
name = "dtl-2${local.project_suffix}"
|
||||
group_iam = local.lake_group_iam
|
||||
iam = local.lake_iam
|
||||
services = local.lake_services
|
||||
@@ -137,7 +137,7 @@ module "lake-plg-project" {
|
||||
parent = var.folder_id
|
||||
billing_account = var.billing_account_id
|
||||
prefix = var.prefix
|
||||
name = "dtl-plg"
|
||||
name = "dtl-plg${local.project_suffix}"
|
||||
group_iam = local.lake_plg_group_iam
|
||||
iam = {}
|
||||
services = local.lake_services
|
||||
|
||||
@@ -19,5 +19,5 @@ module "exp-project" {
|
||||
parent = var.folder_id
|
||||
billing_account = var.billing_account_id
|
||||
prefix = var.prefix
|
||||
name = "exp"
|
||||
name = "exp${local.project_suffix}"
|
||||
}
|
||||
|
||||
@@ -234,7 +234,8 @@ Description of commands:
|
||||
| [location](variables.tf#L47) | Location used for multi-regional resources. | <code>string</code> | | <code>"eu"</code> |
|
||||
| [network_config](variables.tf#L63) | Shared VPC network configurations to use. If null networks will be created in projects with preconfigured values. | <code title="object({ host_project = string network_self_link = string subnet_self_links = object({ load = string transformation = string orchestration = string }) composer_ip_ranges = object({ cloudsql = string gke_master = string web_server = string }) composer_secondary_ranges = object({ pods = string services = string }) })">object({…})</code> | | <code>null</code> |
|
||||
| [project_services](variables.tf#L96) | List of core services enabled on all projects. | <code>list(string)</code> | | <code title="[ "cloudresourcemanager.googleapis.com", "iam.googleapis.com", "serviceusage.googleapis.com", "stackdriver.googleapis.com" ]">[…]</code> |
|
||||
| [region](variables.tf#L107) | Region used for regional resources. | <code>string</code> | | <code>"europe-west1"</code> |
|
||||
| [project_suffix](variables.tf#L107) | Suffix used only for project ids. | <code>string</code> | | <code>null</code> |
|
||||
| [region](variables.tf#L113) | Region used for regional resources. | <code>string</code> | | <code>"europe-west1"</code> |
|
||||
|
||||
## Outputs
|
||||
|
||||
|
||||
@@ -35,6 +35,7 @@ locals {
|
||||
groups_iam = {
|
||||
for k, v in local.groups : k => "group:${v}"
|
||||
}
|
||||
project_suffix = var.project_suffix == null ? "" : "-${var.project_suffix}"
|
||||
service_encryption_keys = var.service_encryption_keys
|
||||
shared_vpc_project = try(var.network_config.host_project, null)
|
||||
# this is needed so that for_each only uses static values
|
||||
|
||||
@@ -104,6 +104,12 @@ variable "project_services" {
|
||||
]
|
||||
}
|
||||
|
||||
variable "project_suffix" {
|
||||
description = "Suffix used only for project ids."
|
||||
type = string
|
||||
default = null
|
||||
}
|
||||
|
||||
variable "region" {
|
||||
description = "Region used for regional resources."
|
||||
type = string
|
||||
|
||||
Reference in New Issue
Block a user