You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
│ ├── dev_config.tfvars # Variable values for 'Dev' environment
21
21
│ ├── prod_config.tfvars # Variable values for 'Prod' environment
22
22
├── scripts/ # Shell scripts for configuration and log validation
@@ -47,6 +47,38 @@ tech_eazy_devops_git-user-9/
47
47
48
48
---
49
49
50
+
## 🔑 **Step: Configure Terraform Variables**
51
+
52
+
Before triggering deployment, update the Terraform configuration files for your AWS environment:
53
+
54
+
1. Open `terraform/variables.tf`
55
+
2. Set the default values for common variables like EC2 Key Pair name:
56
+
57
+
```hcl
58
+
variable "key_name" {
59
+
default = "your-ec2-keypair-name" # Set your AWS Key Pair name
60
+
}
61
+
```
62
+
63
+
3. Edit `terraform/dev_config.tfvars` and `terraform/prod_config.tfvars`:
64
+
65
+
* Example (`dev_config.tfvars`):
66
+
67
+
```hcl
68
+
key_name = "your-ec2-keypair-name"
69
+
```
70
+
71
+
* Example (`prod_config.tfvars`):
72
+
73
+
```hcl
74
+
key_name = "your-ec2-keypair-name"
75
+
```
76
+
77
+
⚠️ Ensure your EC2 Key Pair exists in the selected AWS region.
78
+
*ap-south-1 (Mumbai) is being used by default in this project, so kindly create a ec2 key pair on this region for smoother experience during execution. Otherwise kindly change ap-south-1 at all places to your preferred region*
79
+
80
+
---
81
+
50
82
## 🔐 **How to Get SSH Private Key from .pem File**
51
83
52
84
When you create an AWS EC2 Key Pair, AWS provides a `.pem` file. To use this in GitHub Actions, you must convert it to a format that can be stored as a secret.
@@ -83,31 +115,70 @@ The deployment is managed via GitHub Actions.
* Deploys a second EC2 instance with **read-only access to S3**.
103
168
* Uses AWS CLI to pull logs from the S3 bucket to the instance.
104
-
7.**Log Validation via SSH** –
169
+
170
+
7.**Log Validation via SSH**
105
171
106
172
* SSH into the Verifier EC2 instance.
107
173
* Validates that required logs exist in S3.
108
174
* Prints the last 20 lines of each log for inspection.
175
+
109
176
8.**App Health Check** – Ensures the application is healthy (HTTP 200 response).
177
+
110
178
9.**Destroy Infrastructure** – After validation, destroys all provisioned resources and cleans up Terraform workspaces.
111
179
180
+
112
181
This workflow fully automates the lifecycle: provisioning, deployment, validation, and cleanup, ensuring no manual intervention is needed during the process.
0 commit comments