Standardise reuse variable from project module and implement for net-vpc (#3205)

* exposing the network_id from the net-vpc module for use with tag bindings

* convert vpc_create to vpc_reuse

* Changed the reuse vars to standardised attributes

* fixed readme tests and schemas

* modified apigee blueprint to use vpc_reuse with network_id passthrough

---------

Co-authored-by: Ludovico Magnocavallo <ludomagno@google.com>
This commit is contained in:
Liam Nesteroff
2025-07-03 09:12:05 +10:00
committed by GitHub
parent 7e20abc19d
commit f07e4f64e9
43 changed files with 190 additions and 106 deletions

View File

@@ -172,7 +172,7 @@ variable "project_reuse" {
description = "Reuse existing project if not null. If name and number are not passed in, a data source is used."
type = object({
use_data_source = optional(bool, true)
project_attributes = optional(object({
attributes = optional(object({
name = string
number = number
services_enabled = optional(list(string), [])
@@ -182,9 +182,9 @@ variable "project_reuse" {
validation {
condition = (
try(var.project_reuse.use_data_source, null) != false ||
try(var.project_reuse.project_attributes, null) != null
try(var.project_reuse.attributes, null) != null
)
error_message = "Reuse datasource can be disabled only if project attributes are set."
error_message = "Reuse datasource can be disabled only if attributes are set."
}
}