Skip to content

Latest commit

 

History

History
107 lines (71 loc) · 1.86 KB

README.md

File metadata and controls

107 lines (71 loc) · 1.86 KB

About The Project

This mini project Deploy an AWS EC2 instance with Grafana, Prometheus stack

Getting Started

Prerequisites

SSH key setup

Make sure you've got both the private key and public key ready to be used

$HOME/.ssh/id_rsa
$HOME/.ssh/id_rsa.pub

One can generate key pair with following command

$ ssh-keygen

More details at ssh.com

AWS CLI profile

Make sure to have a valid AWS CLI profile set up named terransible

$ cat $HOME/.aws/credentials
[terransible]
aws_access_key_id = CHANGE-ME
aws_secret_access_key = CHANGE-ME
region = CHANGE-ME

Usage

Github repository

Clone the repository

git clone [email protected]:jpuris/terraform-ansible-example.git

Terraform Plan

Run the terraform plan

$ cd terraform
$ terraform init
$ terraform plan

Deploying the infrastructure

Apply the terraform infrastructure

$ terraform apply

Accessing the created resources

SSH into EC2

$ echo "ssh ubuntu@`grep aws ../ansible/hosts` -i ~/.ssh/id_rsa"

Grafana URL

$ echo "`grep aws ../ansible/hosts`:3000"

Prometheus URL

$ echo "`grep aws ../ansible/hosts`:9090"

Cleanup

Remove the created infrastructure

$ terraform destroy

License

Distributed under the MIT License. See LICENSE.txt for more information.

Acknowledgments