Why do I receive a “No Instances in Tag" message from my Systems Manager maintenance window?
2 minute read
0
I created a maintenance window that runs an AWS Systems Manager Run Command targeting Amazon Elastic Compute Cloud (Amazon EC2) instance tags. When the command runs, I receive a "No Instances in Tag" message.
Short description
When you run a maintenance window targeting instances that use Amazon EC2 instance tags, the instance IDs for managed instances resolve when the command runs. The instance ID won't resolve as a target if the instance isn't reporting to Systems Manager as Online. When a maintenance window can't resolve instance ID targets, you receive the "No Instances in Tag" message.
The "No Instances in Tag" message also appears when the EC2 resource tag and the tag registered as a maintenance window target are mismatched. Systems Manager uses a string match method to resolve targets to tags. As a result, the tags are case-sensitive and character-sensitive. Any extra spaces entered into either the EC2 resource tag or the maintenance window target tag result in a "No Instance in Tag" message.
To identify a mismatched tag, use AWS CloudTrail to help isolate the exact value that is passed by the maintenance window.
Open the CloudTrail console, and then choose Event history to view events in the Region where you created the maintenance window.
Change the search dropdown filter to Event name. For Enter an event name, enter SendCommand to view all Run Command API events. It's a best practice to set the time filter to the time that the maintenance window ran.
Choose the hyperlinked Event name to view the API call in JSON format.
Navigate to the "targets" section of the API call to view the exact tag values passed from the maintenance window. Then, compare the API call tag value to the EC2 instance tag assigned to your instance.