Skip to content

Commit 2c8b30f

Browse files
authored
Merge pull request #29 from NgaNaNa/feature/k8s-deployment-service-ingress
updates readme
2 parents 4f092eb + 11e3428 commit 2c8b30f

File tree

2 files changed

+40
-12
lines changed

2 files changed

+40
-12
lines changed

README.md

Lines changed: 40 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ docker buildx build --platform linux/amd64,linux/arm64 -t nrampling/demo-node-ap
3333
Update the image tag in `infra/eks/envs/dev.tfvars`
3434

3535

36-
## 3 · Deploy with Terraform from directory infra/eks
36+
## 3 · Deploy with Terraform from directory infra/eks/
3737

3838
```bash
3939
AWS_PROFILE=node-app-terraform-dev terraform plan -var-file=../envs/dev.tfvars
@@ -66,8 +66,47 @@ Lookup for url for the exposed k8s Service for ingress-nginx controller
6666
```bash
6767
kubectl -n ingress-nginx get svc
6868
```
69+
70+
71+
---
72+
73+
## GitHub Actions for Terraform CI/CD – EKS Infra
74+
This GitHub Actions workflow automates the infrastructure provisioning lifecycle for the demo Node.js app using Terraform.
75+
76+
### Workflow Triggers
77+
Pull Requests to main: Run CI checks (format, validate, plan).
78+
79+
Push to main: Auto-applies Terraform to deploy infrastructure in dev.
80+
81+
### Job: terraform-dev
82+
- Runs inside the infra/ directory
83+
84+
- terraform init: Uses a backend config with an S3 bucket passed as a secret.
85+
86+
- On PRs:
87+
- Checks formatting consistency.
88+
- Validates Terraform configuration.
89+
- Creates an execution plan using envs/dev.tfvars
90+
- Automatically comments the plan and outcomes back to the PR using actions/github-script.
91+
92+
- On Plan Failure:
93+
- Marks the PR check as failed (exit 1).
94+
95+
- On Push to Main:
96+
- Executes terraform apply with dev.tfvars, auto-approving without manual input.
97+
98+
### Security and Permissions
99+
GitHub token permissions are explicitly set to allow reading content and commenting on PRs.
100+
101+
### Notes
102+
Production-related jobs (terraform-prod-ci and terraform-prod-cd) are defined but commented out (Preparation for future)
103+
The workflow is scoped to infrastructure compute resource only deployments, not application code or Docker builds.
104+
105+
---
106+
69107
---
70108

109+
71110
# Amazon ECS Infrastructure Provisioning using Terraform
72111

73112
*(Please note, the PR trigger for automatically deploying changes to ECS (Infra resources) has been commented out (Disabled). This was introduced while I am working on GitHub CICD automation for deploying infra resources for AWS EKS. See above )*
@@ -127,14 +166,6 @@ alb_dns_name = dev-app-alb-123456.ap-southeast-2.elb.amazonaws.com
127166
cluster_name = dev-ecs-cluster
128167
```
129168

130-
Open:
131-
132-
```
133-
http://dev-app-alb-123456.ap-southeast-2.elb.amazonaws.com/ping
134-
```
135-
136-
once the ALB target turns **healthy**.
137-
138169
---
139170

140171
## Contributing
@@ -198,5 +229,3 @@ The workflow is scoped to infrastructure compute resource only deployments, not
198229
## Author
199230

200231
Nga Rampling
201-
202-
# Testing

infra/eks/cluster.tf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ module "eks" {
1010

1111
cluster_endpoint_private_access = true
1212
cluster_endpoint_public_access = true
13-
# cluster_endpoint_public_access_cidrs = []
1413

1514
enable_cluster_creator_admin_permissions = true
1615

0 commit comments

Comments
 (0)