I was tasked to spin up Windows 2019 servers (as per AWS documentation, this has SSM agent preinstalled) and disable port 3389 for RDP because the only access they want is via Amazon Systems Manager Session Manager.
I have attached the AmazonSSMManagedInstanceCore role which gives Session Manager permissions to access this server programmatically, but I still have issues accessing this server via Session Manager. Possible errors are:
- The agent is not installed,
- The required IAM role is not attached etc. But I have done all this and am still unable to access this server.
So I want to be able to edit the UserData with a bootstrapping script that installs SSM agent and see if that fixes the issue.
My guess is maybe someone tampered with the server and deleted the SSM agent file.
This doesn't answer the question about a bootstrap script, as I am still researching on that
But I solved the issue I had with
AWS Systems Manager Session Manager
.FYI: I still would love a bootstrap script that will install SSM Agent to Amazon EC2 Windows Servers upon launch.