Terraform Based Grafana Deployment on AWS

Terraform

Project Overview:

In this project, I designed and deployed a Grafana monitoring server on AWS EC2 using Terraform (Infrastructure as Code).The entire infrastructure — including networking security and software installation — was automated, ensuring repeatability and consistency.To maintain secure and scalable state management, I configured Amazon S3 as the Terraform backend, enabling safe storage of infrastructure state files.

Architecture Overview

- Terraform provisions an EC2 instance
- A security group allows SSH and port 3000 for Grafana
- Grafana is installed automatically during instance creation
- Terraform state is stored securely in Amazon S3
- Grafana is accessed via browser using the EC2 public IP

Technologies Used

- AWS EC2
- Terraform
- Grafana
- SSh
-Amazon Linux

Steps taken to complets this project :

1. Terraform Project Setup

Terraform
Terraform
Terraform

- Initialized a Terraform project
- Configured the AWS provider
- Defined the deployment region
- Structured the files for clarity and maintainability
- Provisioned an EC2 instance using Terraform
- Attached the security group - Associated a key pair for SSH accessed
- On the security group configured inbound for port 22(SSH) and Port 3000


2. Remote Backend Configuration (S3)

Terraform Terraform

- Created an S3 bucket to store Terraform state
- Configured Terraform backend to use S3
- Enabled safer collaboration and state persistence


3. SSh Access and Verification

Terraform
Terraform
Terraform

- Shhed into the EC2 instance
- Updated the system
- installed Grafana - Verified Grafana service status
- Confirmed successful installation


4. Accessing Grafana Dashboard

Terraform
Terraform
Terraform
Terraform
Terraform
Terraform
Terraform

- Opened browser using EC2 public IP on port 3000
- Logged into Grafana web interface
- Confirmed application avalaibility


Project Outcomes

- Successfully deployed a production-style Grafana server
- Automated infrastructure provisioning using Terraform
- Implemented secure access using AWS Security Groups
- Used S3 backend for Terraform state management