fbpx

Infrastructure scripts

In the previous article we described the reasons that made us change the provider. 

In this article we will describe how we built our infrastructure as code.

As a first step let’s create a bash script to run the playbook:

With the flexibility of AWS & Ansible we can easily craft an isolated multi environment:

Then we need a playbook for each infrastructure’s component :

Now let’s dig into some details for each playbook.

VPC (Virtual Private Cloud) 

This is the playbook for VPC creation and network routing:

All instances in an env have a private network class. We also set up a gateway to connect our vpc with the internet.

It only remains to create a routing rule:

Good. We now have a fully functional vpc, one for each environment.

EC2 (Elastic Compute Cloud)

With the following playbook we build some EC2 instances to host our applications:

ELB (Elastic Load Balancer)

Having VPC and EC2 instances in place, we need a load balancer to distribute load on our backends. It’s pretty easy with AWS:

In the next article we’ll show you another chapter of our migration to AWS.

Stay tuned!

Loreno Edelmondo
Loreno Edelmondo
Articoli: 24

2 commenti

    • These scripts are for the infrastructure. We do deploy with other scripts. In practice, we download the code from github and configure the environment. Maybe we will do an article on deploy.

Lascia una risposta

Il tuo indirizzo email non sarà pubblicato. I campi obbligatori sono contrassegnati *

Questo sito usa Akismet per ridurre lo spam. Scopri come i tuoi dati vengono elaborati.