arehmandev / devops-test

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DevOps-Test

Hi Mickey (Captain)

Saw this repo and thought I'd give it a try since I was bored.

Clone it, cd into terraform, run 'terraform get && terraform plan && terraform apply', then wait shortly and use the elb link provided

What is this test all about?

This test is all about setting up Terraform templates to deploy a set of infrastructure elements on AWS. We would need an EC2 instance behind an ELB (Elastic Load Balancer) on a custom VPC with a Subnet. Also we will need a S3 bucket called DevOps-Test with a file uploaded to the bucket, named helloworld.

The EC2 instance will be based on Ubuntu 16.04 OS with Nginx as a webserver and php-fpm as a php fastcgi processor behind the web server. The code of the website will be the code on this repository, index.php. So, when we type on the url of our browser the domain associated with the ELB, index.php should be called.

The code on index.php connects with a S3 bucket and lists the objects on perkbox-devops-test S3 bucket. You should see a helloworld message on the screen of our browser, if everything goes alright after the web page loads.

It's extremely recommendable to do the setup manually first, verify it works and then move into the automation part with Terraform.

Create a fork from the current repository and submit a Pull Request with Terraform templates and instructions to execute them once you're done.

Instructions:

server {
        listen 80 default_server;
        listen [::]:80 default_server;

        index index.php
        server_name localhost;
        root /var/www/html;

        location / {
                try_files $uri $uri/ =404;
        }

        location ~ \.php$ {
                include snippets/fastcgi-php.conf;
                fastcgi_pass 127.0.0.1:9000;
        }

        location ~ /\.ht {
                deny all;
        }
}
  • Pull the code from this repository into /var/www/html

  • Use composer to download php dependencies

  • Don't modify index.php file

  • Ask anything you need. Asking the correct questions is considered part of the test.

References

About


Languages

Language:HCL 87.8%Language:Shell 9.3%Language:PHP 3.0%