Devops challenge
This repository contains configuration files defining the infrastructure as a code of the challenge for DevOps Engineer job position at Pagar.me.
Create a monitoring infrastructure. The objective is to deploy an Elastic Stack (ELK) and be able to aggregate log data from an EC2 instance.
What will be evaluated:
Install and setup the version manager asdf by running the following commands:
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.8.0
echo ". $HOME/.asdf/asdf.sh" >> ~/.bashrc
Now install Terraform and Packer by running:
asdf plugin add terraform
asdf install terraform 0.13.5
asdf global terraform 0.13.5
asdf plugin add packer
asdf install packer 1.6.5
asdf global packer 1.6.5
Initialize Terraform modules in the desired directory (e.g. isac.aws/us-east-1/dev
) by running:
terraform init
To apply all the infrastructure, run the following command:
terraform apply -auto-approve
To destroy all the infrastructure, run the following command:
terraform destroy -auto-approve
Add the following content to your ~/.ssh/config
file changing the variables accordingly
# Elasticsearch Tunnel
Host estunnel
HostName <EC2 IP address>
User ec2-user
IdentitiesOnly yes
IdentityFile <my .pem key>
LocalForward 9200 <Elasticsearch endpoint>
Then run the following command to create an SSH tunnel which allows you to reach Elasticsearch endpoint at https://localhost:9200
ssh estunnel -N