blackstork-io / fabric

An open-source command-line tool for cybersecurity reporting automation and a configuration language for reusable templates. Reporting-as-Code
https://blackstork.io/fabric/
Apache License 2.0
12 stars 0 forks source link

Expose env vars as FCL variables #191

Closed traut closed 2 weeks ago

traut commented 4 weeks ago

Background

The function from_env_variable() we support currently allows template authors to load dynamic values from environment variables. While it is very useful, it lacks the flexibility we can achieve with FCL variables

Design

Expose env variables under env. namespace in FCL context, so it can be used with HCL attributes / templating

For example:

config data somesource {
  uril = "https://${env.SOMESOURCE_DOMAIN}/api"
  username = env.SOMESOURCE_USERNAME
  password = env.SOMESOURCE_PASSWORD
}

Also, from_env_variable() function should be retired