It would be very hard to install PostgreSQL on it without it. Not shown in the diagram is the NAT gateway that’s necessary to make sure we can access the internet from the DB host. We’ll also run Ansible configuration changes from this box.Īs only the management and web hosts need to be exposed to the internet, we can put the database host in a private subnet. We’ll use that as an SSH bastion to connect to the other machines. In line with this practice, we’ll add a third EC2 instance to be a ‘management host’.
To keep in line with best practices, we’ll want to make only the absolutely necessary ports open. We’ll create a two-tier environment on AWS: a web server, and a database server. There are some difficulties on Windows with the SSH configuration for Terraform. This blog post was written on Ubuntu it should work as well on macOS. If you’re interested in seeing how to prepare this application for production, let me know in the comments!
The environment we’ll describe here is configured for development, not production. Today, we’ll take our app to AWS, and we’ll set up a remote development environment. In the last two blog posts of this series we discussed how to set up a local VM-based development environment for a cloud application, and then built a Flask-RESTful app within this environment.