Scalr has now added native support for variable files in the workspace configuration! A common theme among our customers is to create reusable code and one of the core concepts of that is being able to inject variables per workspace to allow for the reusable code.
Previously, the way to do this was to pass in a shell variable and reference the file:
While this worked and will continue to work, the variable files are really part of the workspace configuration, which is why we have added the native support for it. Going forward, the best practice will be to add the .tfvar file(s) to the workspace configuration:
This now gives you the ability to add multiple files as part of the workspace configuration, and most importantly it is now part of the Scalr provider, which is the best practice in creating and maintaining workspaces. The ability to add files through the UI will follow very soon.
The combination of the Scalr module registry and variables in the workspace configuration now makes it even easier to structure your Terraform deployments at scale.