Why do I receive a “No Instances in Tag" message from my Systems Manager maintenance window?

Last updated: 2021-04-29

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. How can I fix this issue?

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.

Resolution

To troubleshoot an instance that isn't reporting as Online, see Why is my EC2 instance not appearing under Managed Instances in the Systems Manager console?

To identify a mismatched tag, use AWS CloudTrail to help isolate the exact value that is passed by the maintenance window.

  1. Open the CloudTrail console, and then choose Event history to view events in the Region where you created the maintenance window.
  2. 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.
  3. Choose the hyperlinked Event name to view the API call in JSON format.
  4. 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.
  5. Update the maintenance window targets or the EC2 instance tag so that both values match exactly.