Created
May 16, 2017 07:27
-
-
Save ariesmcrae/285f8babffc0ea7f8a09735e6ae099f8 to your computer and use it in GitHub Desktop.
This will get environment variables from AWS Lambda
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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