Rxborole/TravelMemory-Terraform-Ansible ? reverse-engineered prompt

Reverse engineered prompt

Build me a full deployment setup for the TravelMemory MERN app on AWS, using Terraform to create the infrastructure and Ansible to configure the servers. I want one control EC2 instance that I can SSH into and run everything from, then a public web EC2 for the app and a private MongoDB EC2 with no public IP.

Please set up the VPC, public and private subnets, internet gateway, NAT gateway, route tables, security groups, and the needed IAM role and outputs. Then use Ansible to install and configure Git, Node.js, npm, PM2, and Nginx on the web server, deploy the React and Express app, and make it run properly behind Nginx. On the database server, install MongoDB 8.0, create the database and app user, and make sure only the web server can reach it on the Mongo port.

Keep the setup secure and practical, and use the README details as the source of truth. If you need current AWS or package info, look up the latest docs online.

Are you gonna build this?

make sure you review the code using coderabbit

Try freeSponsored — opens CodeRabbit in a new tab