EC2 (Virtual Machines)
Overview
EC2 (Elastic Compute Cloud) provides virtual machines for your application infrastructure. Tapitalee automatically provisions Amazon EC2 instances in your AWS account, offering scalable compute capacity for specialized workloads, background processing, or infrastructure components that require full control over the operating system.
Purpose and Benefits
- Full Control: Complete control over the operating system and software stack
- Scalability: Wide range of instance types optimized for different workloads
- Flexibility: Install any software or run any services you need
- Cost-Effective: Pay only for compute time used, with spot and reserved instance options
- Network Integration: Seamless integration with your Tapitalee application network
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, used for identification)
Optional Parameters
size: EC2 instance type (default:t3.micro)open_ports: Comma-separated list of ports to open (default:22,80,443)allowed_ip_ranges: CIDR blocks allowed to connect (default:0.0.0.0/0)ssh_public_key: SSH public key for secure access (default: generated)storage: Root volume size in GB (default:20)ami: Amazon Machine Image ID (default: latest Amazon Linux 2)
Examples
# Basic EC2 instance
tapit create ec2 name=web-server
# Custom instance with specific configuration
tapit create ec2 name=app-server size=t3.medium storage=50 open_ports=22,80,443,8080
# Ubuntu instance with custom SSH key
tapit create ec2 name=ubuntu-server ami=ami-0c02fb55956c7d316 ssh_public_key=`cat ~/.ssh/id_rsa.pub`Modify EC2 Instance (restarts the instance)
tapit set ec2 name=instance-name [size|open_ports|allowed_ip_ranges|storage|disabled]='...'Modifiable Parameters
size: Change instance typeopen_ports: Update firewall rulesallowed_ip_ranges: Modify allowed IP addressesstorage: Increase root volume sizedisabled: Disable (stop) or enable (start) the instance
List and Show EC2 Instances
# List all addons (including EC2)
tapit list addons
# Show specific EC2 instance details
tapit show addon name=instance-nameDelete EC2 Instance
tapit delete addon name=instance-nameWarning: This permanently deletes the EC2 instance and all data on the root volume. EBS snapshots are automatically created before deletion.
Cost control
# Stop instance to save costs
tapit set ec2 name=dev-instance disabled=true
# Start when needed
tapit set ec2 name=dev-instance disabled=falseSecurity Best Practices
- SSH Key Management: Use strong SSH keys and rotate regularly
- Firewall Configuration: Open only necessary ports
- Regular Updates: Keep operating system and software updated
- Access Control: Use IAM roles instead of access keys
- Monitoring: Enable CloudTrail and CloudWatch logging
- Backup Strategy: Regular backups and disaster recovery planning