com.networknt.aws.lambda.Configuration Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of env-config Show documentation
Show all versions of env-config Show documentation
Environmental Config for Lambda for seldom changed properties
The newest version!
package com.networknt.aws.lambda;
import org.yaml.snakeyaml.Yaml;
import java.io.InputStream;
import java.util.Map;
public class Configuration {
private final Yaml yaml = new Yaml();
private Map> config;
private static Configuration INSTANCE = new Configuration();
public static Configuration getInstance() {
return INSTANCE;
}
private Configuration() {
load();
}
private void load() {
InputStream inputStream = Configuration.class.getClassLoader().getResourceAsStream("app.yml");
config = yaml.load(inputStream);
}
public Map getStageConfig(String env) {
return config.get(env);
}
public Map> getConfig() { return config; }
}