Use type: ec2
to run your code on an EC2 instance
protocol
you use when creating, modifying, and
running your instance.
There are two protocol
options: ssh
, and ssm
. The ssh
protocol manages your
instance via the SSH / SCP protocols, whereas the ssm
protocol manages your instance
via AWS Systems Manager.
You’ll need to make sure your account has the necessary privileges to create resources
for your requested protocol. Contact your account administrator to help out with this.
You can use the following policy document to provision your account with the necessary
permissions:
SSH IAM policy document
SSM IAM policy document
infra
accepts the following keys:
type
: this should always be ec2
instance_type
: the EC2 instance type. This defaults to t2.micro
. The list of all
available EC2 instance types can be found here.ami_image
: the Amazon machine image to use. This defaults to ami-0889a44b331db0194
.
You should be able to find a list of available AMIs for your region via the AWS
console (EC2 >> Images >> AMI Catalog).ami_image
must be an Amazon Linux AMI. We’re working on adding support for
other Linux-based images (e.g., Debian, Ubuntu, etc.)python_version
: the Python version to use. This is optional. If this isn’t specified,
this your code will run using the Python version native to the EC2 instance. The latest
version is always used, i.e.,:
python_version: 3
—> version 3.12.0
is usedpython_version: 3.1
—> version 3.1.5
is usedpython_version: 3.11.6
—> version 3.11.6
is usedpython_version
will be deprecated starting in version 0.0.9
. Instead, users can
customize their Python version using a Docker image, e.g., python:3.10.8-slim-bullseye
.protocol
: the protocol to use to modify and manage your instance. Accepted options
are ssh
and ssm
. Defaults to ssh
if not specified.
instance_profile
: instance profile to attach to your EC2 instance if the ssm
protocol is used. If not specified, then Alto will create an instance profile for you.