stack_master icon indicating copy to clipboard operation
stack_master copied to clipboard

Proposal: erb templating for parameter files

Open markussiebert opened this issue 5 years ago • 2 comments

Hi,

it would be easy to implement and easy to use erb templates for parameter_files. So we could use some variables inside (even load some other general parameter files inside).

prefix = '/my/prefix' 
test = 'testvalue'
%>

<%= File.read('../environment_indipendent_parameters.yml') %>
Parameter1: 
  parameter_store: '<%= prefix %>/param1'
Parameter2: 
  parameter_store: '<%= prefix %>/param2'
Parameter3: 
  parameter_store: '<%= prefix %>/param3'
Parameter4: 
  parameter_store: '<%= prefix %>/param4/<%= test %>'

What do you think of this idea? I have some use cases for this. Mainly for getting environment specifi parmeters with different prefix, or ParameterNames with different prefixes.

Sure, i can call erb within my pipeline - but it would be more comfortable to do erb on this files while loading them.

What do you think?

markussiebert avatar Feb 01 '19 16:02 markussiebert

The use case seems reasonable, but I'm concerned using ERB encourages people to add more complexity to their parameter files when they should be relatively simple.

I prefer Convention over Configuration, so I wonder how we can enable your behaviour without adding more possible configurations (and possible ways to do it wrong).

patrobinson avatar Feb 02 '19 12:02 patrobinson

Does #350 resolve this?

liamdawson avatar Feb 25 '21 02:02 liamdawson