Loading...
Loading...
lattice template use lattice/aws-linuxThis will create a new workspace using this template configuration.
Deploy Linux-based AI agents on AWS EC2 instances with this agent definition template.
By default, this template authenticates to AWS using the provider's default authentication methods.
The simplest way (without making changes to the template) is via environment variables (e.g. AWS_ACCESS_KEY_ID) or a credentials file. If you are running Lattice on a VM, this file must be in /home/lattice/aws/credentials.
To use another authentication method, edit the template.
The following sample policy allows Lattice to create EC2 instances and modify instances provisioned by Lattice:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": [
"ec2:GetDefaultCreditSpecification",
"ec2:DescribeIamInstanceProfileAssociations",
"ec2:DescribeTags",
"ec2:DescribeInstances",
"ec2:DescribeInstanceTypes",
"ec2:CreateTags",
"ec2:RunInstances",
"ec2:DescribeInstanceCreditSpecifications",
"ec2:DescribeImages",
"ec2:ModifyDefaultCreditSpecification",
"ec2:DescribeVolumes"
],
"Resource": "*"
},
{
"Sid": "LatticeResources",
"Effect": "Allow",
"Action": [
"ec2:DescribeInstanceAttribute",
"ec2:UnmonitorInstances",
"ec2:TerminateInstances",
"ec2:StartInstances",
"ec2:StopInstances",
"ec2:DeleteTags",
"ec2:MonitorInstances",
"ec2:CreateTags",
"ec2:RunInstances",
"ec2:ModifyInstanceAttribute",
"ec2:ModifyInstanceCreditSpecification"
],
"Resource": "arn:aws:ec2:*:*:instance/*",
"Condition": {
"StringEquals": {
"aws:ResourceTag/Lattice_Provisioned": "true"
}
}
}
]
}
This agent definition provisions the following resources:
Lattice uses aws_ec2_instance_state to start and stop the VM. This agent definition is fully persistent, meaning the full filesystem is preserved when the workspace restarts.
Note This template is designed to be a starting point! Edit the Terraform to extend the template to support your agent use case.