I'm trying to get the current aws ssm sessionId after starting a session. I can see that when I start it it gets printed, like this
Starting session with SessionId: test@test.com-0ftz59d2285d67fb5
But I don't know where this comes from.
I can also see that I can grab it from the ssm-session worker but I'm trying to get it in a cleaner way:
[ssm-user@ip-100-66-11-11 bin]$ sudo systemctl status amazon-ssm-agent
● amazon-ssm-agent.service - amazon-ssm-agent
Loaded: loaded (/usr/lib/systemd/system/amazon-ssm-agent.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2021-03-08 09:54:44 UTC; 2h 48min ago
Main PID: 3092 (amazon-ssm-agen)
CGroup: /system.slice/amazon-ssm-agent.service
├─ 875 /usr/bin/ssm-session-worker test@test.com-0ftz59d2285d67fb5 i-0a7bb9a9064ccc96
├─ 886 bash -l
├─3092 /usr/bin/amazon-ssm-agent
└─3272 /usr/bin/ssm-agent-worker