Im using Api Gateway and AWS Lambda and AWS RDS to build an API. My Lambda Function Code is Java. Currently im using the AWS Systems Manager Parameter Store successfully to connect to my Database. Therefore I created a parameter called "connection" which has the type String and holds my complete connection url. In Lambda functions i can access this parameter successfully this way:
GetParameterRequest parameterRequest = new GetParameterRequest().withName("connection").withWithDecryption(false);
AWSSimpleSystemsManagement ssmclient = AWSSimpleSystemsManagementClientBuilder.defaultClient();
GetParameterResult parameterResult = ssmclient.getParameter(parameterRequest);
String url = parameterResult.getParameter().getValue();
Now my question: In other lambda functions I want to send mails. Therefor I want to save the SMTP-Server and the username and the password and a default sender mail and so on.
Would it be possible to save this information as Type StringList like Key/Value Pairs (Map)? That something like this could be possible:
//Get StringList
GetParameterRequest parameterRequest = new GetParameterRequest().withName("mailInfo").withWithDecryption(false);
AWSSimpleSystemsManagement ssmclient = AWSSimpleSystemsManagementClientBuilder.defaultClient();
GetParameterResult parameterResult = ssmclient.getParameter(parameterRequest);
//Get values from the list
String smtp_server = parameterResult.getParameter("smtp").getValue();
String to_mail = parameterResult.getParameter("defaultToMail").getValue();
...
Thanks in advance.