'Bring Lambda environment variables to application.properties file
First of all I am new to Lambda function in AWS and all. I need to access the lambda environment variables into my spring-boot's application.properties file to put RDS username, pass etc. Can someone please give me any hint ?
datasource:
url: ${DBURL}
username: ${UNAME}
password: ${PASS}
Solution 1:[1]
Your example should work as it is in your question, are you getting any errors?
Alternatively, you could rename your environment variables to:
SPRING_DATASOURCE_URL, SPRING_DATASOURCE_USERNAME, and SPRING_DATASOURCE_PASSWORD and Spring Boot will automatically pick up those values and use them, without needing anything in application.properties.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Mark B |
