I'm not 100% sure of the ask but I think Teleport can do this sort of thing. https://goteleport.com/docs/
also -
AWS has AWS Systems Manager. Any system can run AWS SSM agent and SSM Documents define scripts that can be run on machines running SSM agent. On demand or scheduled, with some dynamic inputs etc.