EC2 (Virtual Machines)

EC2 (Virtual Machines)

Overview

EC2 add-ons provide virtual machine instances for specialized workloads that need full operating system access, custom software, or workloads that don’t fit into containers. Tapitalee provisions Amazon EC2 instances in your VPC and provides SSH access through your public key.

Purpose and Benefits

  • Full OS Access: Complete control over the operating system environment
  • Custom Software: Run software that cannot be containerized easily
  • Persistent Compute: Long-running compute tasks outside of ECS
  • Specialized Hardware: Access to specific instance types with GPU or high-memory configurations
  • SSH Access: Direct secure shell access to instances using your SSH key

Use Cases

  • Build Servers: Custom build infrastructure
  • Database Proxies: Dedicated proxy servers for database connections
  • Bastion Hosts: Secure jump servers for system access
  • Legacy Applications: Applications that require traditional server environments
  • GPU Workloads: Machine learning inference or training

CLI Usage

Create EC2 Instance

tapit  create ec2 name=instance-name [size|open_ports|allowed_ip_ranges|ssh_public_key|storage|ami]='...'

Required Parameters

  • name: Instance name (alphanumeric with hyphens)

Optional Parameters

  • size: EC2 instance type (e.g. t3.micro, c6i.large, p3.2xlarge)
  • open_ports: Comma-separated list of ports to open in the security group
  • allowed_ip_ranges: CIDR ranges allowed to access the instance
  • ssh_public_key: SSH public key for access (e.g. contents of ~/.ssh/id_rsa.pub)
  • storage: Root volume size in GB
  • ami: Custom Amazon Machine Image ID

Examples

# Create a basic EC2 instance
tapit create ec2 name=build-server

# Create with specific instance type and SSH access
tapit create ec2 name=bastion size=t3.micro ssh_public_key='ssh-rsa AAAA...'

# Create with custom ports and allowed IPs
tapit create ec2 name=proxy size=t3.small open_ports=8080,8443 allowed_ip_ranges=10.0.0.0/8

# Create with larger storage
tapit create ec2 name=data-processor size=c6i.large storage=200

Modify EC2 Instance

tapit  set ec2 name=instance-name [size|open_ports|allowed_ip_ranges|storage|disabled]='...'

Modifiable Parameters

  • size: Change instance type (requires restart)
  • open_ports: Update open ports in security group
  • allowed_ip_ranges: Update allowed IP CIDR ranges
  • storage: Increase storage size (cannot decrease)
  • disabled: Stop (true) or start (false) the instance

Examples

# Upgrade instance size
tapit set ec2 name=build-server size=c6i.xlarge

# Stop the instance (saves compute costs)
tapit set ec2 name=build-server disabled=true

# Restart the instance
tapit set ec2 name=build-server disabled=false

# Update open ports
tapit set ec2 name=proxy open_ports=80,443,8080

Restart EC2 Instance

tapit  restart addon name=instance-name

Restarts the EC2 instance.

List and Show EC2 Instances

# List all addons (including EC2)
tapit list addons

# Show specific EC2 instance details
tapit show addon name=instance-name

Delete EC2 Instance

tapit delete addon name=instance-name

Warning: This permanently terminates the EC2 instance and deletes all data on it.

Snapshots

Tapitalee automatically takes daily EBS snapshots of EC2 instances, retaining 3 days of backups. You can also create manual snapshots:

# Create a manual snapshot
tapit create snapshot addon=instance-name name=before-upgrade

# List snapshots
tapit list snapshots addon=instance-name

IP Address

Tapitalee allocates a static public IP address (AWS Elastic IP) for each EC2 instance. This IP address does not change for the lifetime of the add-on.

To find the IP address of your instance, use the UI or run:

tapit show addon name=instance-name

No environment variables are injected into your app for EC2 instances.

Cost Optimization

  • Use disabled=true to stop instances when not needed (you still pay for EBS storage but not compute)
  • Choose the smallest instance type that meets your requirements