Multiple environment

I have 14 test environments. Each environment has an ECS cluster in AWS to which services must be deployed.
The names of clusters and all resources follow the naming convention “object name”-“environment name”.
During the deployment of these clusters, I automatically create an environment object in Gitlab and variables associated with the name of this environment (env specific variables)
I assumed that when I run a pipeline for a specific environment, this pipeline will be associated with a specific environment name, which means that during the execution of this pipeline, variables for this specific environment will be used. This way I can only have one yaml pipeline, which will use a different set of variables for different environments. It was my plan.
But now I’m surprised that I don’t see any object in Gitlab CI (presumably a pipeline object) that would associate a yaml file with a specific environment. After that, I could automatically create a pipeline object by linking it to only one test environment. This would be ideal especially with terraform.
Now I see only the ability to specify a list of environments inside the yaml pipeline for which the pipeline will work, which means that adding each new environment will require changing the yaml file, and I will not be able to specify for which environments the pipeline will automatically trigger and for which not.