Skip to content

jpuris/terraform-ansible-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Deploy an AWS EC2 instance with Grafana, Prometheus stack

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published