Skip to content

Instantly share code, notes, and snippets.

@ariesmcrae
Created May 16, 2017 07:27
Show Gist options
  • Save ariesmcrae/285f8babffc0ea7f8a09735e6ae099f8 to your computer and use it in GitHub Desktop.
Save ariesmcrae/285f8babffc0ea7f8a09735e6ae099f8 to your computer and use it in GitHub Desktop.
This will get environment variables from AWS Lambda
//http://docs.aws.amazon.com/lambda/latest/dg/env_variables.html
public static Sql2o getSql2oInstance() {
//These will get environment values from the AWS Lambda,
//which are declared in the Lambda web page.
final String host = System.getenv("host");
final String port = System.getenv("port");
final String schema = System.getenv("schema");
final String username = System.getenv("username");
final String password = System.getenv("password");
return new Sql2o("jdbc:mariadb://" + host + ":" + port + "/" + schema, username, password);
}
@afifim
Copy link

afifim commented Aug 22, 2018

is there a way to update an environment variable. I cant find system.setenv or any anything similar to update.
The goal is hash data that can be updated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment