Project : aws-terraform-nginx-ansible-docker-jenkins

 list of requirements :

Automate provisioning and configuration of NGINX server in Docker container with SSL certificate in AWS cloud using Jenkins, Ansible, Terraform.
 
Assumptions:
1.  The available free version of Linux
2.  The latest available version of NGINX for Linux
3.  EC2 instance size is t2.micro (free tier)
4.  Must create and use free tier of private AWS account
5.  The SSL certificate is self-signed
6.  The AWS Security Group is default
 
Acceptance Criteria:
1.  Post-provisioning report demonstrates evidence of
a.  No provisioning errors
b.  Sequence of provisioning steps
c.  Up and running instance of NGINX
d.  Listening on ports 80 and 443
e.  Response on ports 80 and 443
f.  content of active instance configuration file
2.  Run automated pipeline 3 times in a row and receive the same result (fully remove provisioned EC2 with components after every deployment, automation is optional for removal)
 
This one was actually fun to work on. So let's try to meet each of these criteria.
 

Assumptions to complete this tutorial:

  1. You have an AWS account set up and have IAM profiles on your local.
  2. You have Jenkins installed and know how to basically use it
  3. You have Github (and CLI) with ssh keys set up.
  4. You have terraform installed
  5. You have Docker Installed
  6. Basic knowledge of EC2 and security groups
  7. A key pair already set up to utilize. In this example, mine is devops.pem
 
Our project directory will look like this by the end:
.
├── ansible
│   └── static-site
│   └── site.yaml
├── Jenkinsfile
├── nginx
│   ├── Dockerfile
│   └── static-site
│   ├── index.css
│   ├── index.html
│   └── nginx.conf
└── terraform
└── static-site
├── main.tf
├── terraform.tfstate
├── terraform.tfstate.backup
└── variables.tf

 
Prior to beginning, as always, setup your github repo and get ready to showcase your effort.
gh repo create scottyfullstack/nginx-jenkins-ansible-terraform
Then inside that git repo run the following to get the proper ignore file to ignore the terraform junk:
wget -O .gitignore https://raw.githubusercontent.com/github/gitignore/master/Terraform.gitignore

 Now here, you can go with below parts to complete the journey of the project:

Part 1: NGINX, OpenSSL, and the static site all bundled into Docker

Part 2 : Terraform

Part 3: Ansible and Dynamic Inventory

Part 4: Jenkins Pipeline

Comments

Popular posts from this blog

Terraform

Different Types of Reports in Scrum - Agile

Scrum Master Interview help - Bootcamp