I know you can inject environment variables with the @Value
annotation like this
@Value("#{systemEnvironment['AWS_ENV']}")
private String envTarget;
If I am using a Spring annotation however can I inject the environment variable in-line into the String value? For example something like this:
@PropertySource("classpath:secrets-${#{systemEnvironment['AWS_ENV']}.properties")
Obviously the above doesn't work as it tries to resolve systemEnvironment['AWS_ENV']
as a jvm property. Anyone have any ideas?