Hey there,
I’ve created a module that exists within a github repo. However, instead of passing all the variables within that module block I’m trying to do something in the form of the following within the variables.tf that exists within the module that’s initalized
# Variable for directory on where to find yaml files
tfsettingsfile = "../../../environments/${terraform.workspace}.yaml"
# Loads yaml file of workspace. If none found it just sets the contents to a default content
tfsettingsfilecontent = "${fileexists(local.tfsettingsfile) ? file(local.tfsettingsfile) : "NoTFSettingsFileFound: true"}"
# decodes the yaml file
tfworkspacesettings = "${yamldecode(local.tfsettingsfilecontent)}"
vars = "${merge(local.default, local.tfworkspacesettings)}"
The goal is that the module will be able to read all the values from the local yaml file and use that instead of passing the variables 1 by 1 Is this possible does anyone have insight on how to do this?
When I do the terraform init and apply. I Keep getting the NoTFSettingsFileFound