Adding a new default in stack configuration
Synapse is configured from a stack configuration file stored in S3 and exposed through StackConfiguration.
The stack configurationis a property file generated at deployment time by the stackBuilder. This entry is about the
changes that need to be made to the stackBuilder so that the configuration properties appear in the stack
configuration file.
Assuming a property exposed in StackConfiguration as
public static String getMyProp() { return configuration.getProperty("org.sagebionetworks.mypropkey"); }
In the Synapse-StackBuilder project:
- In src/main/resources/stack-config-template.properties, add:
org.sagebionetworks.mypropertykey=\$\{org.sagebionetworks.mypropertykey\}
Note: If the value is encrypted, append ".encrypted" to the key. - In src/test/java/org/sagebionetworks/stack/TestHelper.java, add following to createDefaultProperties():
defaults.put("org.sagebionetworks.mypropertykey", "someValue");
Note: The key can be added as a constant to src/main/java/org/sagebionetworks/stack/Constants.java. - mvn clean install
- Add the key and default value to prod.default.properties in S3
Note: If the value needs to be encrypted, append ".plaintext" to the key.