Option to create a project

This commit is contained in:
Julio Diez
2023-02-10 17:29:36 +01:00
parent 9dab5fa1ea
commit 6c470ece11
2 changed files with 20 additions and 3 deletions

View File

@@ -19,14 +19,22 @@ locals {
}
module "project" {
source = "../../../modules/project"
project_create = false
name = var.project_id
source = "../../../modules/project"
billing_account = (var.project_create != null
? var.project_create.billing_account_id
: null
)
parent = (var.project_create != null
? var.project_create.parent
: null
)
name = var.project_id
services = [
"run.googleapis.com",
"compute.googleapis.com",
"iap.googleapis.com"
]
project_create = var.project_create != null
}
# Cloud Run service

View File

@@ -43,6 +43,15 @@ variable "ingress_settings" {
default = "all"
}
variable "project_create" {
description = "Parameters for the creation of a new project."
type = object({
billing_account_id = string
parent = string
})
default = null
}
variable "project_id" {
description = "Project ID."
type = string