diff --git a/README.md b/README.md index 4f19d12..6453a88 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,9 @@ -# TypeScript Node.js API → Docker → Amazon EKS (GitHub CICD for Infra) -> k8s +# TypeScript Node.js API → Docker → Amazon EKS (GitHub CICD for Infra) -> k8s manifest *(Kubernetes Deployment, Service, Ingress resources are deployed from local at the moment. GitHub CI/CD in future)* -Public url to see the 'very basic' node.js api app deployed on EKS: -http://ad1a9f084ef53444c8cdc00db8ecba84-a7930b60602a3012.elb.ap-southeast-2.amazonaws.com/ping - This repo containerises a simple Node.js API (Local Build), pushes the image to Docker Hub (From local), and provisions the infrastructure on **Amazon EKS (EC2 capacity)** with **Terraform** and **GitHub CI/CD**. -The VPC, Public Subnets, and Terraform remote-state bucket (S3 + DynamoDB) are assumed to exist already. +The VPC, Public Subnets, Route table, IGW and Terraform remote-state bucket (S3 + DynamoDB) are assumed to exist already. ## Prerequisites @@ -17,7 +14,7 @@ The VPC, Public Subnets, and Terraform remote-state bucket (S3 + DynamoDB) are a | **Docker v20.10.18+** | Buildx enabled (comes pre‑installed) | | **Docker Hub account** | Public repo: `nrampling/demo-node-app` | -## 1 · Initialise Terraform (one‑time per env) +## 1 · Initialise Terraform (one‑time per env) - From Local ```bash cd infra/eks @@ -33,7 +30,7 @@ docker buildx build --platform linux/amd64,linux/arm64 -t nrampling/demo-node-ap Update the image tag in `infra/eks/envs/dev.tfvars` -## 3 · Deploy with Terraform from directory infra/eks/ +## 3 · For local Deploy with Terraform from directory infra/eks/ (CI/CD option is explained further down) ```bash AWS_PROFILE=node-app-terraform-dev terraform plan -var-file=../envs/dev.tfvars @@ -74,9 +71,15 @@ kubectl -n ingress-nginx get svc This GitHub Actions workflow automates the infrastructure provisioning lifecycle for the demo Node.js app using Terraform. ### Workflow Triggers -Pull Requests to main: Run CI checks (format, validate, plan). +Upon changes to the files from the following path: + - 'infra/eks/**' + - 'infra/envs/**' + - '.github/workflows/eks_terraform.yaml' -Push to main: Auto-applies Terraform to deploy infrastructure in dev. +and upon the following GitHub actions: +- Pull Requests to main: Run CI checks (format, validate, plan). + +- Push to main: Auto-applies Terraform to deploy infrastructure in dev. ### Job: terraform-dev - Runs inside the infra/ directory diff --git a/infra/eks/.terraform.lock.hcl b/infra/eks/.terraform.lock.hcl index 1d42c6e..964d099 100644 --- a/infra/eks/.terraform.lock.hcl +++ b/infra/eks/.terraform.lock.hcl @@ -44,25 +44,6 @@ provider "registry.terraform.io/hashicorp/cloudinit" { ] } -provider "registry.terraform.io/hashicorp/kubernetes" { - version = "2.37.1" - hashes = [ - "h1:+37jC6JlkPyPvDHudK3qaj7ZVJ0Zy9zc9+oq8h1WayA=", - "zh:0ed097413c7fc804479e325966886b405dc0b75ad2b4f54ce4df1d8e4802b397", - "zh:17dcf4a685a00d2d048671124e8a1a8e836b58ecd2ef628a1c666fe0ced2e598", - "zh:36891284e5bced57c438f12d0b27856b0d4b70b562bd200b01919a6a89545be9", - "zh:3e49d86b508e641ba122d1b0af24cdc4d8ffa2ec1b30022436fb1d7c6ba696ea", - "zh:40be623e116708bdcb0fac32989db43720f031c5fe9a4dc63395078185d24403", - "zh:44fc0ac3bc39e289b67f9dde7ee9fef29eb8192197e5e68fee69098573021722", - "zh:957aa451573bcde5d57f6f8338ea3139010c7f61fefe8f6a140a8c267f056511", - "zh:c55fd85b7e8acaac17e30670ac3574b88b3530820dd004bcd2a5daa8624a46e9", - "zh:c743f06843a1f5ecde2b8ef639f4d3db654a334ef248dee57261c719ea843f3a", - "zh:c93cc71c64b838d89522ac5fb60f68e0e1e7f2fc39db6b0ead7afd78795e79ed", - "zh:eda1163c2266905adc54bc78cc3e7b606a164fbc6b59be607db933b302015ccd", - "zh:f569b65999264a9416862bca5cd2a6177d94ccb0424f3a4ef424428912b9cb3c", - ] -} - provider "registry.terraform.io/hashicorp/null" { version = "3.2.4" constraints = ">= 3.0.0"