Certopolis

AWS Certified CloudOps Engineer – Associate

Why an EC2 instance is not a Systems Manager managed node

The Systems Manager User Guide lists three requirements for a managed node. SSM Agent must be installed and running. The instance needs IAM permissions, normally an instance profile with AmazonSSMManagedInstanceCore. And the agent must reach the Systems Manager endpoints over HTTPS on port 443, through outbound internet access or interface VPC endpoints.

What are the three requirements?

First, SSM Agent has to be installed and running on a supported operating system. Some AWS managed AMIs launch with the agent preinstalled; on others you install it.

Second, an EC2 instance needs an IAM instance profile that lets it talk to the Systems Manager service. AWS checks for the managed policy AmazonSSMManagedInstanceCore, or a custom policy with the same permissions. On-premises servers and other non-EC2 machines use an IAM service role instead.

Third, the agent must connect to a Systems Manager endpoint to register. SSM Agent starts every connection itself, so no inbound rule to the instance is needed for Systems Manager.

Also confirm you are in the same Region as the instance. To test registration, run aws ssm describe-instance-associations-status for the instance; it returns results only after the agent has registered.

What network path does the agent need?

With outbound internet access, the instance must be able to send HTTPS on port 443 to ssm.region.amazonaws.com, ssmmessages.region.amazonaws.com and ec2messages.region.amazonaws.com.

Without it, create interface VPC endpoints: com.amazonaws.region.ssm, com.amazonaws.region.ssmmessages and com.amazonaws.region.ec2messages. Systems Manager also uses com.amazonaws.region.s3 to update SSM Agent. With AWS PrivateLink you do not need an internet gateway or a NAT device.

The security group attached to the VPC endpoint must allow incoming connections on port 443 from the instance's private subnet. If it does not, the instance cannot reach the endpoints. With a custom DNS server, forward queries for amazonaws.com to the Amazon DNS server for the VPC.

What is Default Host Management Configuration?

It lets Systems Manager manage EC2 instances without an instance profile on each one. It applies a default IAM role for all instances in the account and Region where it is turned on. It must be turned on Region by Region, and instances can take up to 30 minutes to start using the role.

It has prerequisites. The instance must use Instance Metadata Service Version 2 (IMDSv2); Version 1 is not supported. SSM Agent must be version 3.2.582.0 or later.

SSM Agent tries instance profile permissions first. If an attached instance profile allows ssm:UpdateInstanceInformation, the instance does not use the Default Host Management Configuration permissions, so remove that permission from the profile.

Where the exam catches people

  • Opening inbound ports on the instance for Systems Manager: SSM Agent initiates all connections, so only outbound HTTPS matters.
  • Creating the interface endpoints but leaving their security group closed: it must allow inbound 443 from the instance's subnet.
  • Expecting Default Host Management Configuration to work with IMDSv1: it supports IMDSv2 only.
  • Assuming every AMI has SSM Agent: only some AWS managed AMIs come with it preinstalled.
  • Turning on Default Host Management Configuration once for the account: it is activated separately in each Region.

Written from these sources

Try 3 questions on this

Pick an answer to see why each option is right or wrong.

  1. A company's AWS account holds 400 Amazon EC2 instances in one Region, launched by many teams. Some instances have no IAM instance profile, and others have team-specific profiles that grant only Amazon S3 access. Every instance requires IMDSv2 and runs a current SSM Agent. A SysOps administrator must make all of them Systems Manager managed nodes without attaching or editing an instance profile on any instance. Which solution will meet these requirements?

    Right. In the game that’s Renown for your Deployment, Provisioning, and Automation building.

    Not that one: D is right. In the game your Deployment, Provisioning, and Automation building would lose a little Renown, and this question would come back later.

    Show the full explanation and doc quotes

    Default Host Management Configuration answers exactly that. Once it is on for the account and Region, Systems Manager hands every instance a default role, so the agent can register without an instance profile. Its prerequisites are met here: the instances use IMDSv2 and a current agent. The S3-only profiles do not get in the way, because the agent falls back to the default role when a profile does not allow it to report instance information.

    Written from docs.aws.amazon.com/systems-manager/latest/userguide/fleet-manager-default-host-management-configuration.html

  2. A SysOps administrator launches 12 Amazon EC2 instances from the latest Red Hat Enterprise Linux 9 AMI into a private subnet whose route table sends internet-bound traffic to a NAT gateway. The launch template attaches an instance profile that includes the AmazonSSMManagedInstanceCore policy. After 30 minutes, none of the instances appears in Fleet Manager, and Run Command cannot select them. Which action should the SysOps administrator take to resolve this issue?

    Right. In the game that’s Renown for your Deployment, Provisioning, and Automation building.

    Not that one: C is right. In the game your Deployment, Provisioning, and Automation building would lose a little Renown, and this question would come back later.

    Show the full explanation and doc quotes

    The instance profile carries AmazonSSMManagedInstanceCore, and the NAT gateway gives the subnet outbound HTTPS to the public ssm, ssmmessages and ec2messages endpoints. What is missing is the agent itself: AWS lists the AMIs that ship with SSM Agent (Amazon Linux 2 and 2023, Ubuntu, SUSE, recent Windows Server and others), and Red Hat Enterprise Linux is not among them. Installing the agent from user data and enabling its service lets each instance register within minutes.

    Written from docs.aws.amazon.com/systems-manager/latest/userguide/fleet-manager-troubleshooting-managed-nodes.html

  3. A company uses Default Host Management Configuration in this Region and attaches no instance profiles. A SysOps administrator launches an instance from the golden AMI (SSM Agent 3.1.1446.0, IMDSv2 required) into a private subnet with no NAT gateway. The subnet has interface endpoints for ssm, ssmmessages and ec2messages with private DNS. The instance's and the endpoints' security groups each allow all outbound and no inbound traffic. The instance never registers. Which actions should the SysOps administrator take to fix this issue? (Select TWO.)

    Right. In the game that’s Renown for your Deployment, Provisioning, and Automation building.

    Not that one: B,E is right. In the game your Deployment, Provisioning, and Automation building would lose a little Renown, and this question would come back later.

    Show the full explanation and doc quotes

    The credentials: with no instance profile, the instance depends on Default Host Management Configuration, which serves only instances running SSM Agent 3.2.582.0 or later; 3.1.1446.0 is older, so the golden AMI needs a current agent before the relaunched instance can register.

    Written from docs.aws.amazon.com/systems-manager/latest/userguide/fleet-manager-troubleshooting-managed-nodes.html

Ask for something