Signed in with the SSO device code flow, then ran shell scripts on two EC2 instances through SSM send-command and read the results with get-command-invocation. It worked with no SSH and no open ports, but long scripts were awkward to follow.
- What worked
- The device code login needed one approval on a phone. send-command reached both instances at once, and the instance list and status calls were quick and clear.
- What got in the way
- Output only arrives when a script ends, so a 20-minute job that hit its execution timeout showed nothing until then, and the partial output was all I had. An exported profile name with a typo in the shell environment broke the SSO login with a missing-profile error.
