I'm starting a session using AWSSimpleSystemsManagementAsync
as follows:
Map<String, List<String>> parameters = new HashMap<>();
parameters.put("portNumber", Arrays.asList("80"));
parameters.put("localPortNumber", Arrays.asList("8080"));
StartSessionResult result =
getSsmClient()
.startSession(
new StartSessionRequest()
.withTarget(sb.toString())
.withDocumentName("AWS-StartPortForwardingSession")
.withParameters(parameters));
sessionId = result.getSessionId();
This seems to work and mimics what I can do manually:
aws ssm start-session --target "Your Instance ID" --document-name AWS-StartPortForwardingSession --parameters "portNumber"=["80"],"localPortNumber"=["8080"]
When I run manually I do open my browser at localhost:8080 to interact with my application as I need to but I'm struggling to do this type of thing via the SDK as opening the browser after starting the session doesn't seem to work as it does manually.
Hopefully, I'm just missing something.