Multi-team use of Terraform for integrated deployments - Unique Identifiers for variables defined in terraform.tfvars

I’m working as part of a conglomerate of teams working towards building a Microservice Architecture application. Thus far, the main team has established the core of the architecture and now additional, independent teams are starting up and adding microservice capabilities to this architecture. Our desire is to use Terraform for our deployments, but the multi-team, multi-organization nature of our effort makes DevOps somewhat complicated. We are expecting each developer to provide their module declaration, any unique variable defaults that need to go in terraform.tfvars, and any terraform modules unique to their deployment (this will be optional though as there will be generics available). These separately-provided declarations, tfvars, and modules will be taken and merged into master deployment terraform configurations via our devops process.

The main concern that I want to address here (and to see if there are any in-built syntax or advised methods of mitigating this) is the potential inconsistency of the base terraform.tfvars variables. We’ve already seen a few times that variables need to be renamed or modified and we don’t want to limit that - we’re accepting that changes WILL happen. What I’m trying to look for is a way to tie an independent identifier to variables so, if some changes occur, we don’t break every single team in our group and require that each one’s module declaration need to be modified.

We have our own home-grown plan for this and I will lay it out here only to hopefully better describe what we want to do so if Terraform directly facilitates this in some way you can point us in that direction.

The main changes would occur in the base terraform.tfvars file and the child module declarations. Below is an example of how this would be used.

Image registry variable from terraform.tfvars version 1.0.1:

//id=private-registry
image_registry = "docker-private.private.com"

Image registry variable from terraform.tfvars version 1.0.2 (after variable had been restructured into a group to facilitate multiple image registries):

image_registries = {
  //id=private-registry
  "private" = "docker-private.private.com",
  //id=external-registry
  "external" = "docker-external.external.com"
}

The above would then be used within our DevOps process to generate a functional module declaration block for child component modules.

Module declaration block (before DevOps generation - note //id:noms-registry):

module "sub-component-module" {
  source = "./modules/sub-component/sub-component-db"
  ...
  image_registry = //id:noms-registry 
  ...
}

Sub-component module block after generation (for v 1.0.1):

module "sub-component-module" {
  source = "./modules/sub-component/sub-component-db"
  ...
  image_registry = var.image_registry
  ...
}

Sub-component module block after generation (for v 1.0.2):

module "sub-component-module" {
  source = "./modules/sub-component/sub-component-db"
  ...
  image_registry = var.image_registries.private
  ...
}

Does support for something like this exist? Is there an approach to using Terraform that would achieve this kind of thing without having to do too much independent legwork? Looking forward to discussing this!