Download instance_config.py from sundaycoil/ec2-auto-manager: direct link, hf CLI and curl.
- Browser
- Download file 1.72 kB
-
https://huggingface.co/sundaycoil/ec2-auto-manager/resolve/main/instance_config.py
- Command line
-
hf download hf://sundaycoil/ec2-auto-manager/instance_config.py
-
curl -L -o instance_config.py https://huggingface.co/sundaycoil/ec2-auto-manager/resolve/main/instance_config.py
1.72 kB
| """ | |
| EC2 Instance Configuration Templates | |
| """ | |
| # Instance configurations for different use cases | |
| INSTANCE_CONFIGS = { | |
| 'web_server': { | |
| 'name': 'WebServer-Production', | |
| 'ami_id': 'ami-0c55b159cbfafe1f0', # Amazon Linux 2 AMI | |
| 'instance_type': 't3.medium', | |
| 'key_name': 'production-key', | |
| 'security_groups': ['sg-0123456789abcdef0'], | |
| 'environment': 'production' | |
| }, | |
| 'database': { | |
| 'name': 'Database-MySQL', | |
| 'ami_id': 'ami-0c55b159cbfafe1f0', | |
| 'instance_type': 't3.large', | |
| 'key_name': 'production-key', | |
| 'security_groups': ['sg-0123456789abcdef1'], | |
| 'environment': 'production' | |
| }, | |
| 'dev_server': { | |
| 'name': 'DevServer-Testing', | |
| 'ami_id': 'ami-0c55b159cbfafe1f0', | |
| 'instance_type': 't3.small', | |
| 'key_name': 'dev-key', | |
| 'security_groups': ['sg-0123456789abcdef2'], | |
| 'environment': 'development' | |
| }, | |
| 'worker': { | |
| 'name': 'Worker-Node', | |
| 'ami_id': 'ami-0c55b159cbfafe1f0', | |
| 'instance_type': 't3.micro', | |
| 'key_name': 'worker-key', | |
| 'security_groups': ['sg-0123456789abcdef3'], | |
| 'environment': 'production' | |
| } | |
| } | |
| # User data scripts for instance initialization | |
| USER_DATA_SCRIPTS = { | |
| 'web_server': """#!/bin/bash | |
| yum update -y | |
| yum install -y httpd | |
| systemctl start httpd | |
| systemctl enable httpd | |
| echo "<h1>Web Server Running</h1>" > /var/www/html/index.html | |
| """, | |
| 'database': """#!/bin/bash | |
| yum update -y | |
| yum install -y mysql-server | |
| systemctl start mysqld | |
| systemctl enable mysqld | |
| """, | |
| 'worker': """#!/bin/bash | |
| yum update -y | |
| yum install -y python3 python3-pip | |
| pip3 install boto3 celery redis | |
| """ | |
| } | |