I am using Terraform to deploy an 3-tiers application on Azure: Frontend, Backend, and DB. It works well. The application is a product, and I need several instances for several customers.
My problem is, I have a hard time understanding applying several sets of values (variables.tf) to the same script, in order to get several environments.
I would like to have the following structure:
- main.tf
- customer1
- variables.tf
- customer2
- variables.tf
And select whether I deploy customer1 or customer2. I read about terraform workspaces, and started creating one workspace per customer. But I don't understand how to apply a different set of values for the same scripts depending on the working workspace. It's difficult to find a comprehensive example online, what I am trying to do should be the bread and butter of terraform.
Thanks!