code: def put_file(client, source_file, destination_file):
      
      try:
          sftp_client = client.open_sftp()
          sftp_client.put(source_file, destination_file)
      except Exception as error:
          raise IpaUtilsException(
              'Error copying file to instance: {0}.'.format(error)
          )
      finally:
          with ignored(Exception):
              sftp_client.close()
docs: Copy file to instance using Paramiko client connection.