On boto3, how can I extend the ResourceModel ? What I do not need to do is subclass boto3.resources.factory.ec2.Instance and add the run method to it. This method will be used to remotely run commands in an EC2 instance represented by a Python object via SSH. I want to do it in a clean way, i.e. Without resorting to monkey patches or other obscure methods.
Update
Based on Daniel's answer , I came up with the following code. The latest version of Boto 3 and Spur is required to connect SSH ( pip install spur boto3 ).
from boto3 import session from shlex import split from spur import SshShell
source share