API Access to EC2 Console


Is there any way to access to the console of an EC2 instance via the API? I saw a couple tickets that looked like this was started, but I didn’t see any reference to this in the v2 API. I’m attempting to retrieve an instance’s ID using the console, which displays it, to then retrieve the Administrator password via the AWS CLI.

Having this ability would allow me to more easily automate end-to-end the provisioning and configuration of a Windows server using Ansible. Unless the ID or (even better) the password is accessible another way.

Expected outcome:

The ability to retrieve the console output.

Foreman and Proxy versions:


Foreman and Proxy plugin versions:

foreman-tasks 0.14.1
foreman_ansible 2.2.9
foreman_cockpit 2.0.3
foreman_hooks 0.3.14
foreman_memcache 0.1.1
foreman_remote_execution 1.6.4

Other relevant data:
[e.g. logs from Foreman and/or the Proxy, modified templates, commands issued, etc]
(for logs, surround with three back-ticks to get proper formatting, e.g.)


There’s a very old ticket to add this: Feature #3779: Expose console access through the API - Foreman

Thanks @ekohl! Yeah, I think that’s the one I saw. I’ll see if I can find another way to do this. I wouldn’t really need this feature as much if there was a way to retrieve the admin password using the EC2 plugin. I’ll open a ticket to see if that can be added.