Thanks for getting in touch! I think the easiest way to get this environment variable into your Terraform step would be to first create an output variable in an earlier step, which you could then call in your subsequent Terraform step.
For example, you could have an earlier PowerShell script step (that can see your environment variables) set an output variable with
Set-OctopusVariable -name "VariableName" -value "EnvironmentVariable" and to call it use the syntax
You can also print out all variables (including environment variables) to your task log by creating a project variable named
OctopusPrintVariables with a value of
True, which is helpful for debugging and seeing what variables are available. Note that a new release has to be created to apply variable changes.
Would this approach work for you? Let me know what you think or if you have any further questions going forward.