terramate icon indicating copy to clipboard operation
terramate copied to clipboard

[FEATURE] Support `condition` in `import` blocks

Open ottramst opened this issue 2 years ago • 2 comments

Describe the solution you'd like

Would like to see conditional imports. Example:

import {
  condition = global.environment == "staging"
  source = "/environments/staging/config.tm.hcl"
}

This could be leveraged to pull in specific globals based on some metadata etc.

ottramst avatar Aug 24 '22 09:08 ottramst

Hi @ottramst,

Thanks for reaching out with new ideas :rocket:

This feature is already on our backlog. We are working on other features at the moment, like vendoring support and improved ternary support, but as soon as we have conditional importing we will let you know :smiley:

katcipis avatar Aug 24 '22 11:08 katcipis

Hi @ottramst,

a first refactoring to make this available soon is now in review.

we still do not have n ETA on the final feature though. please stay tuned ;)

mariux avatar Sep 16 '22 09:09 mariux