Where are the values of the terraform variables found?

Hi team,

I was doing the Lake Formation and Iceberg lab and tracing the terraform files and I realised that I do not know where the value of the variables are.

I see we have a variables.tf but:

  1. The variables do not have a default value
  2. We did not run terraform apply -var "variable_name=abc" to directly specify the values
  3. .tfvars file which sets the variable values not found in the project structure

I seem to be having a bit of knowledge gap here. How are the variables in variable.tf getting their values?

Hello @jkwd

It’s nice that you are going the extra mile to learn more :slightly_smiling_face:
They are introduced and saved as environment variables in the EC2 instance when you run source scripts/setup_jupyter_env.sh. If you are curious, take a look at lines 52 to 74 in the scripts/setup_jupyter_env.sh file.

Happy learning!

1 Like

I see ok. I did wonder if it was in the env variables but i echo $source_database instead of $TF_VAR_source_database so I didn’t manage to find it. Found the relevant documentation for it. Thanks for your guidance!

1 Like