🔌 AWS EC2 Executor#


This executor plugin interfaces Covalent with an EC2 instance over SSH. This plugin is appropriate for executing workflow tasks on an instance that has been auto-provisioned and configured by the plugin.

To use this plugin with Covalent, simply install it using pip:

pip install covalent-ec2-plugin

Users will also need to have Terraform installed on their local machine in order to use this plugin. The following shows an example of how a user might modify their Covalent configuration to support this plugin:

username = "ubuntu"
profile = "default"
credentials_file = "/home/user/.aws/credentials"
key_name = "ssh_key"
ssh_key_file = "/home/user/.ssh/ssh_key.pem"

This configuration assumes that the user has created a private key file for connecting to the instance via SSH that is stored on their local machine at /home/user/.ssh/ssh_key.pem. The configuration also assumes that the user uses the default AWS profile and credentials file located at /home/user/.aws/credentials to authenticate to their AWS account.

Within a workflow, users can decorate electrons using the minimal default settings:

import covalent as ct

def my_task():
    import socket
    return socket.get_hostname()

or use a class object that makes use of a custom AWS user profile to deploy a specific instance type within a specific subnet in a VPC:

executor = ct.executor.EC2Executor(

def my_custom_task(x, y):
    return x + y