- Troubleshooting SSM Agent - AWS System Manager When you saw the error like this below, you must attach the IAM Role with policy name AmazonSSMManagedEC2InstanceDefaultPolicy to EC2 instance.
SSM Agent is not online
The SSM Agent was unable to connect to a Systems Manager endpoint to register itself with the service.
Ref: https://stackoverflow.com/questions/62340499/amazon-linux-2-instances-wont-appear-in-systems-manager
- In terraform code, if you wants attch IAM Role to EC2 instance, you must use the following syntax:
iam_instance_profile = "learn-ec2-sessionmanager"