generated from amazon-archives/__template_MIT-0
-
Notifications
You must be signed in to change notification settings - Fork 101
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
I have stored /DEV/APP/CLIENT/KEYSTORE/PASSWORD and /DEV/APP/CLIENT/TRUSTSTORE/PASSWORD in SSM Param Store, with secure strings as value.
I am retrieving them in Lambda function as:
Map<String, String> values = ssmProvider.recursive().withDecryption().getMultiple("/DEV/APP/CLIENT/");
String keyStorePassword = values.get("KEYSTORE/PASSWORD");
String trustStorePassword = values.get("TRUSTSTORE/PASSWORD");Expected Behavior
The expected behavior is that the keys as shown above KEYSTORE/PASSWORD and TRUSTSTORE/PASSWORD should be present
Current Behavior
While debugging, I found the keys to be as KEYSTOREPASSWORD and TRUSTSTOREPASSWORD.
However, if I remove the appending / from the path and use /DEV/APP/CLIENT :
ssmProvider.recursive().withDecryption().getMultiple("/DEV/APP/CLIENT")I get the expected results
Steps to Reproduce (for bugs)
Just ran a Test class with a main method inside a Maven project:
import software.amazon.awssdk.regions.Region;
import software.amazon.awssdk.services.ssm.SsmClient;
import software.amazon.lambda.powertools.parameters.ParamManager;
import software.amazon.lambda.powertools.parameters.SSMProvider;
import java.util.Map;
public class Test {
private static final SsmClient ssmClient = SsmClient.builder()
.region(Region.US_EAST_2)
.build();
private static final SSMProvider ssmProvider = ParamManager.getSsmProvider(ssmClient);
public static void main(String[] args) {
Map<String, String> values = ssmProvider.recursive().withDecryption().getMultiple("/DEV/APP/CLIENT/");
String keyStorePassword = values.get("KEYSTORE/PASSWORD");
String trustStorePassword = values.get("TRUSTSTORE/PASSWORD");
System.out.println(keyStorePassword);
System.out.println(trustStorePassword);
}
}Environment
- Powertools version used: 1.11.0
- Packaging format (Layers, Maven/Gradle): Maven
- AWS Lambda function runtime: Java 11
- Debugging logs : Received NPE because of
nullvalue afterget()operation on Map
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working