{"id":31366350,"url":"https://github.com/anevis/aws-ami-linux-x86_64-nodejs","last_synced_at":"2025-09-27T10:20:34.686Z","repository":{"id":316755996,"uuid":"1064708340","full_name":"anevis/aws-ami-linux-x86_64-nodejs","owner":"anevis","description":"Create and push an Amazon Machine Image (AMI) to AWS Market place","archived":false,"fork":false,"pushed_at":"2025-09-26T13:30:27.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-26T15:08:41.234Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/anevis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-26T12:41:05.000Z","updated_at":"2025-09-26T13:30:31.000Z","dependencies_parsed_at":"2025-09-26T15:09:02.681Z","dependency_job_id":"cb96e726-33e7-417b-8dfa-e75adff0f199","html_url":"https://github.com/anevis/aws-ami-linux-x86_64-nodejs","commit_stats":null,"previous_names":["anevis/aws-ami-linux-x86_64-nodejs"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/anevis/aws-ami-linux-x86_64-nodejs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anevis%2Faws-ami-linux-x86_64-nodejs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anevis%2Faws-ami-linux-x86_64-nodejs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anevis%2Faws-ami-linux-x86_64-nodejs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anevis%2Faws-ami-linux-x86_64-nodejs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anevis","download_url":"https://codeload.github.com/anevis/aws-ami-linux-x86_64-nodejs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anevis%2Faws-ami-linux-x86_64-nodejs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":277215232,"owners_count":25780740,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-27T02:00:08.978Z","response_time":73,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-09-27T10:20:30.856Z","updated_at":"2025-09-27T10:20:34.678Z","avatar_url":"https://github.com/anevis.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AWS AMI Linux x86_64 with Node.js\n\nCreate and publish an Amazon Machine Image (AMI) based on Amazon Linux 2023 x86_64 with the latest Node.js LTS for running Node.js web applications.\n\n## 🚀 Features\n\n- **Amazon Linux 2023 x86_64** - Latest stable Linux distribution from AWS\n- **Node.js LTS** - Latest Long Term Support version of Node.js\n- **AWS CLI v2** - Latest AWS Command Line Interface for cloud operations\n- **Production Ready** - Pre-configured with PM2, Forever, and Nodemon\n- **Web Server Ready** - Nginx configured as reverse proxy\n- **Firewall Configured** - Ports 80, 443, 3000, and 8080 open\n- **Sample Application** - Includes a sample Node.js app for testing\n- **Systemd Integration** - Service templates for easy app deployment\n\n## 📋 Prerequisites\n\n- [Packer](https://www.packer.io/downloads) installed\n- AWS CLI configured with appropriate credentials\n- AWS account with EC2 permissions\n\n## 🛠️ Quick Start\n\n### 1. Clone the repository\n\n```bash\ngit clone https://github.com/anevis/aws-ami-linux-x86_64-nodejs.git\ncd aws-ami-linux-x86_64-nodejs\n```\n\n### 2. Configure AWS credentials\n\n```bash\naws configure\n```\n\n### 3. Build the AMI\n\n```bash\n./build.sh\n```\n\n## ⚙️ Customization\n\n### Using Variables\n\nCopy the example variables file and customize:\n\n```bash\ncp variables.pkrvars.hcl.example variables.pkrvars.hcl\n```\n\nEdit `variables.pkrvars.hcl`:\n\n```hcl\nregion = \"us-west-2\"\ninstance_type = \"t3.small\"\nami_name = \"my-custom-nodejs-ami-{{timestamp}}\"\nami_description = \"My custom Node.js AMI\"\n```\n\n### Manual Build\n\n```bash\n# Initialize Packer\npacker init aws-ami-nodejs.pkr.hcl\n\n# Validate configuration\npacker validate aws-ami-nodejs.pkr.hcl\n\n# Build AMI\npacker build aws-ami-nodejs.pkr.hcl\n```\n\n## 🎯 What's Included\n\n### Software Components\n\n- **Node.js LTS** - Latest Long Term Support version\n- **npm** - Node Package Manager\n- **AWS CLI v2** - Latest AWS Command Line Interface\n- **PM2** - Production process manager\n- **Forever** - Simple CLI tool for continuous running\n- **Nodemon** - Development tool for auto-restarting\n- **Nginx** - Web server and reverse proxy\n- **Firewalld** - Firewall management\n\n### Directory Structure\n\n```\n/opt/nodejs/              # Node.js applications directory  \n/opt/nodejs/sample-app/   # Sample application\n/etc/nginx/conf.d/        # Nginx configuration\n/etc/systemd/system/      # Systemd service templates\n```\n\n### Helper Scripts\n\n- `/usr/local/bin/nodejs-app-deploy` - Deploy Node.js applications\n\n## 🚀 Using the AMI\n\n### Launch Instance\n\n```bash\naws ec2 run-instances \\\n  --image-id ami-xxxxxxxxx \\\n  --instance-type t3.micro \\\n  --key-name your-key-name \\\n  --security-group-ids sg-xxxxxxxxx\n```\n\n### Deploy Your Application\n\n1. Upload your Node.js application to `/opt/nodejs/your-app/`\n2. Use the helper script:\n\n```bash\nnodejs-app-deploy your-app /opt/nodejs/your-app\n```\n\n3. Your app will be available at `http://your-instance-ip/`\n\n### Manual Service Management\n\n```bash\n# Start your application\nsudo systemctl start nodejs-app@your-app\n\n# Enable auto-start on boot\nsudo systemctl enable nodejs-app@your-app\n\n# Check status\nsudo systemctl status nodejs-app@your-app\n```\n\n## 🏗️ Architecture\n\n```\nInternet → EC2 Security Group → Nginx (Port 80) → Node.js App (Port 3000)\n```\n\n- **Nginx** handles incoming HTTP requests on port 80\n- **Reverse proxy** forwards requests to Node.js app on port 3000\n- **Firewall** allows HTTP (80), HTTPS (443), and development ports (3000, 8080)\n- **Systemd** manages Node.js application lifecycle\n\n## 📁 File Structure\n\n```\n├── aws-ami-nodejs.pkr.hcl          # Main Packer configuration\n├── build.sh                        # Build script\n├── variables.pkrvars.hcl.example   # Variables template\n├── scripts/\n│   ├── install-nodejs.sh          # Node.js installation script\n│   └── configure-system.sh        # System configuration script\n└── README.md                       # This file\n```\n\n## 🔧 Troubleshooting\n\n### Common Issues\n\n1. **Packer not found**: Install Packer from [packer.io](https://www.packer.io/downloads)\n2. **AWS credentials**: Run `aws configure` or set environment variables\n3. **Permissions**: Ensure your AWS user has EC2 and IAM permissions\n4. **Region**: Make sure your AWS CLI region matches the Packer configuration\n\n### Logs\n\n- Build logs: Check Packer output during build\n- Instance logs: `/var/log/cloud-init-output.log`\n- Application logs: `journalctl -u nodejs-app@your-app`\n\n## 📝 License\n\nMIT License - see [LICENSE](LICENSE) file for details.\n\n## 🤝 Contributing\n\n1. Fork the repository\n2. Create a feature branch\n3. Make your changes\n4. Test the build\n5. Submit a pull request\n\n## 📞 Support\n\nFor questions and support, please open an issue in the GitHub repository.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanevis%2Faws-ami-linux-x86_64-nodejs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanevis%2Faws-ami-linux-x86_64-nodejs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanevis%2Faws-ami-linux-x86_64-nodejs/lists"}