Deploying Ubuntu VMs
Details methods for deploying Ubuntu instances required for the trial steps
6 minute read
The trial requires users have access to two instances of Ubuntu 22.04 LTS (Jammy Jellyfish) to on which the Trustgrid agent is installed. There are numerous ways to acheive this, but below are a few methods to streamline the process.
Deploy on AWS
The below methods assume you have access to an AWS account. The EC2 resources required fall under the AWS Free Tier program so costs should be minimal.
AWS via Terraform
Users familiar with Hashicorp Terraform can spin up EC2 instances in multiple regions using the below Terraform example.
Requirements
- Terraform installed
- AWS CLI with a profile configured.
- The below process assumes you name this profile
default
- The below process assumes you name this profile
- SSH key pair with both private and public key.
- The below assumes the keys are located in your home SSH directory (~/.ssh) and called
mykey
(private key) andmykey.pub
(public key)
- The below assumes the keys are located in your home SSH directory (~/.ssh) and called
Terraform Deploy Process
- Create a new directory
- With your preferred text editor, copy the below terraform code into a new file and save as
main.tf
. - From a terminal run the below commands:
terraform init
terraform apply -var="admin_ssh_key_pub=$(cat ~/.ssh/mykey.pub)" -var="aws_profile='default'
(Replace the public key path and aws_profile name as needed)- When prompted, enter
yes
to create all the defined resources.
- Terraform will output the public IP addresses of the two EC2 instances. Connect to both instances with a command like
ssh -i ~/.ssh/mykey ubuntu@ipaddress
and proceed with the inital agent setup
Be sure to Terraform cleanup process below to remove all resources to avoid incurring AWS costs
Terraform Code
The terraform code above includes a number of variables with default values that can be overridden if desired. Most notably
aws_region_agent1
and aws_region_agent2
which control where each of the agents is deployed.
Feel free to adjust these variables as desired.Terraform Cleanup
- Open a terminal and navigate to the directory you created the
main.tf
Terraform file during the initial deployment. - Run the command
terraform destroy -var="admin_ssh_key_pub=$(cat ~/.ssh/mykey.pub)" -var="aws_profile='default'
. - When prompted enter
yes
.
Terraform will proceed to terminate the EC2 instances and delete all the associated VPC resources.
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.