We have 2 agent templates that use the same AMI but with a different instance profile.
If I set instance cap = 1 on both agent templates, and there is already one agent active for one of them, then the other agent will fail to start.
The log would loop on
I think the reason is that the query doesn't include instance profile.
I was able to work around the issue by adding a tag with the same value as instance profile.