-
Notifications
You must be signed in to change notification settings - Fork 0
606 lines (495 loc) · 22.9 KB
/
eks_deploy_aws_infra.yaml
File metadata and controls
606 lines (495 loc) · 22.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
name: Deploy EKS Infrastructure
on:
push:
branches:
- main
env:
AWS_REGION: eu-west-1
TERRAFORM_VERSION: 1.10.3
KUBECTL_VERSION: 1.28.0
HELM_VERSION: 3.13.0
jobs:
test-eks-terraform-modules:
name: Test EKS Terraform Modules
runs-on: ubuntu-latest
# Skip this job if the commit message starts with 'ci:' or 'docs:'
if: |
github.event_name == 'push' &&
!startsWith(github.event.head_commit.message, 'ci:') &&
!startsWith(github.event.head_commit.message, 'docs:')
steps:
- name: Checkout code from the repository
uses: actions/checkout@v4
- name: Setup Terraform
uses: hashicorp/setup-terraform@v3
with:
terraform_version: ${{ env.TERRAFORM_VERSION }}
- name: Run Terraform module tests for EKS
run: |
if [ -f "run-tests.sh" ]; then
chmod +x run-tests.sh
./run-tests.sh
else
echo "No tests found for EKS modules (tests are optional)"
fi
working-directory: infra-eks
env:
AWS_ACCESS_KEY_ID: "mock-access-key"
AWS_SECRET_ACCESS_KEY: "mock-secret-key" # pragma: allowlist secret
AWS_DEFAULT_REGION: "eu-west-1"
deploy-terraform-state-bucket:
name: Deploy Terraform State Bucket
needs: test-eks-terraform-modules
uses: ./.github/workflows/eks_deploy_terraform_state_bucket.yaml # reusable workflow
with:
github_head_commit_message: ${{ github.event.head_commit.message }}
secrets:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
deploy-ecr:
name: Deploy ECR on AWS
needs: [test-eks-terraform-modules, deploy-terraform-state-bucket]
runs-on: ubuntu-latest
env: # required by some steps
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
ECR_REPO_URL: ecr_repository_url # Must match that of the output variable at ECR module
outputs:
ecr_repository_name: ${{ steps.get-ecr-output.outputs.ecr_repository_name }}
steps:
- name: Checkout code from the repository
uses: actions/checkout@v4
- name: Setup Terraform
uses: hashicorp/setup-terraform@v3
with:
terraform_version: ${{env.TERRAFORM_VERSION}}
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ env.AWS_REGION }}
- name: Initialise Terraform on ECR directory
run: terraform init -backend-config="../backend-config.hcl" -backend-config="region=${{ env.AWS_REGION }}"
working-directory: infra-eks/deployment/ecr
- name: Validate IaC changes on ECR directory
run: terraform plan -var-file="../common.tfvars"
working-directory: infra-eks/deployment/ecr
- name: Create ECR repository if it does not yet exist
run: terraform apply -var-file="../common.tfvars" -auto-approve
working-directory: infra-eks/deployment/ecr
- name: Fetch ECR repository name from Terraform output
id: get-ecr-output # make the output available to other jobs
run: |
ecr_repo_url=$(terraform output -raw ${{ env.ECR_REPO_URL }})
echo "ecr_repository_name=$ecr_repo_url" >> $GITHUB_OUTPUT
working-directory: infra-eks/deployment/ecr
env:
TF_IN_AUTOMATION: true # suppresses prompts
retrieve-ssl:
name: Retrieve SSL certificate
needs: [test-eks-terraform-modules, deploy-terraform-state-bucket]
runs-on: ubuntu-latest
env: # required by some steps
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
steps:
- name: Checkout code from the repository
uses: actions/checkout@v4
- name: Setup Terraform
uses: hashicorp/setup-terraform@v3
with:
terraform_version: ${{env.TERRAFORM_VERSION}}
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ env.AWS_REGION }}
- name: Initialise Terraform on SSL directory
run: terraform init -backend-config="../backend-config.hcl" -backend-config="region=${{ env.AWS_REGION }}"
working-directory: infra-eks/deployment/ssl
- name: Validate IaC changes on SSL directory
run: terraform plan -var-file="../common.tfvars" -var-file="../domain.tfvars" -var-file="../backend.tfvars"
working-directory: infra-eks/deployment/ssl
- name: Retrieve SSL certificate
run: terraform apply -var-file="../common.tfvars" -var-file="../domain.tfvars" -var-file="../backend.tfvars" -auto-approve
working-directory: infra-eks/deployment/ssl
build-and-push-app-docker-image-to-ecr:
name: Build and Push App Docker Image to ECR
needs: deploy-ecr
runs-on: ubuntu-latest
outputs:
image_tag: ${{ steps.set-tag.outputs.image_tag }}
env:
ECR_APP_IMAGE: ''
steps:
- name: Checkout code from the repository
uses: actions/checkout@v4
- name: Set Full ECR Image Tag
id: set-tag
run: |
# Extract environment from common.tfvars and construct ECR image tag
REPO_URL="${{ needs.deploy-ecr.outputs.ecr_repository_name }}"
ENVIRONMENT=$(grep "^environment" infra-eks/deployment/common.tfvars | cut -d'"' -f2)
IMAGE_TAG="${ENVIRONMENT}-${{ github.sha }}"
FULL_IMAGE="${REPO_URL}:${IMAGE_TAG}"
echo "ECR_APP_IMAGE=$FULL_IMAGE" >> $GITHUB_ENV
echo "image_tag=$IMAGE_TAG" >> $GITHUB_OUTPUT
echo "Image tag: $IMAGE_TAG"
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ env.AWS_REGION }}
- name: Login to AWS ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2
- name: Build the NestJS app
run: |
corepack enable
corepack prepare pnpm@latest --activate
pnpm install
pnpm build
- name: Build the Docker image
run: |
docker build -t ${{ env.ECR_APP_IMAGE }} -f Dockerfile .
- name: Push the Docker image to ECR
run: |
docker push ${{ env.ECR_APP_IMAGE }}
deploy-vpc:
name: Deploy the VPC on AWS
needs: deploy-ecr
runs-on: ubuntu-latest
env: # required by some steps
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
steps:
- name: Checkout code from the repository
uses: actions/checkout@v4
- name: Setup Terraform
uses: hashicorp/setup-terraform@v3
with:
terraform_version: ${{env.TERRAFORM_VERSION}}
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ env.AWS_REGION }}
- name: Initialise Terraform on the VPC directory
run: terraform init -backend-config="../../backend-config.hcl" -backend-config="region=${{ env.AWS_REGION }}"
working-directory: infra-eks/deployment/app/vpc
- name: Validate IaC changes on the VPC directory
run: terraform plan -var-file="../../common.tfvars"
working-directory: infra-eks/deployment/app/vpc
- name: Deploy the VPC
run: terraform apply -var-file="../../common.tfvars" -auto-approve
working-directory: infra-eks/deployment/app/vpc
deploy-eks-cluster:
name: Deploy EKS Cluster
needs: deploy-vpc
runs-on: ubuntu-latest
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
outputs:
cluster_id: ${{ steps.get-cluster-output.outputs.cluster_id }}
steps:
- name: Checkout code from the repository
uses: actions/checkout@v4
- name: Setup Terraform
uses: hashicorp/setup-terraform@v3
with:
terraform_version: ${{ env.TERRAFORM_VERSION }}
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ env.AWS_REGION }}
- name: Initialize Terraform on EKS cluster directory
run: terraform init -backend-config="../../backend-config.hcl" -backend-config="region=${{ env.AWS_REGION }}"
working-directory: infra-eks/deployment/app/eks_cluster
- name: Validate IaC changes on EKS cluster directory
run: terraform plan -var-file="../../common.tfvars" -var-file="../../backend.tfvars"
working-directory: infra-eks/deployment/app/eks_cluster
- name: Deploy EKS cluster
run: terraform apply -var-file="../../common.tfvars" -var-file="../../backend.tfvars" -auto-approve
working-directory: infra-eks/deployment/app/eks_cluster
# Export job outputs for downstream job consumption
- name: Fetch EKS cluster outputs
id: get-cluster-output
run: |
cluster_id=$(terraform output -raw cluster_id)
echo "cluster_id=$cluster_id" >> $GITHUB_OUTPUT
echo "EKS Cluster ID: $cluster_id"
working-directory: infra-eks/deployment/app/eks_cluster
env:
TF_IN_AUTOMATION: true
deploy-eks-node-group:
name: Deploy EKS Node Group
needs: deploy-eks-cluster
runs-on: ubuntu-latest
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
outputs:
node_group_id: ${{ steps.get-node-group-output.outputs.node_group_id }}
node_group_name: ${{ steps.get-node-group-output.outputs.node_group_name }}
steps:
- name: Checkout code from the repository
uses: actions/checkout@v4
- name: Setup Terraform
uses: hashicorp/setup-terraform@v3
with:
terraform_version: ${{ env.TERRAFORM_VERSION }}
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ env.AWS_REGION }}
- name: Initialize Terraform on EKS node group directory
run: terraform init -backend-config="../../backend-config.hcl" -backend-config="region=${{ env.AWS_REGION }}"
working-directory: infra-eks/deployment/app/eks_node_group
- name: Validate IaC changes on EKS node group directory
run: terraform plan -var-file="../../common.tfvars" -var-file="../../backend.tfvars"
working-directory: infra-eks/deployment/app/eks_node_group
- name: Deploy EKS node group
run: terraform apply -var-file="../../common.tfvars" -var-file="../../backend.tfvars" -auto-approve
working-directory: infra-eks/deployment/app/eks_node_group
- name: Fetch EKS node group outputs
id: get-node-group-output
run: |
node_group_id=$(terraform output -raw node_group_id)
node_group_name=$(terraform output -raw node_group_name)
echo "node_group_id=$node_group_id" >> $GITHUB_OUTPUT
echo "node_group_name=$node_group_name" >> $GITHUB_OUTPUT
echo "EKS Node Group ID: $node_group_id"
echo "EKS Node Group Name: $node_group_name"
working-directory: infra-eks/deployment/app/eks_node_group
env:
TF_IN_AUTOMATION: true
- name: Wait for node group to be active
run: |
echo "Waiting for node group to be active..."
aws eks wait nodegroup-active \
--cluster-name ${{ needs.deploy-eks-cluster.outputs.cluster_id }} \
--nodegroup-name ${{ steps.get-node-group-output.outputs.node_group_name }} \
--region ${{ env.AWS_REGION }}
echo "Node group is now active!"
install-aws-load-balancer-controller:
name: Install AWS Load Balancer Controller
needs: [deploy-eks-cluster, deploy-eks-node-group]
runs-on: ubuntu-latest
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
steps:
- name: Checkout code from the repository
uses: actions/checkout@v4
- name: Setup Terraform
uses: hashicorp/setup-terraform@v3
with:
terraform_version: ${{ env.TERRAFORM_VERSION }}
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ env.AWS_REGION }}
- name: Initialize Terraform on AWS LB Controller directory
run: terraform init -backend-config="../../backend-config.hcl" -backend-config="region=${{ env.AWS_REGION }}"
working-directory: infra-eks/deployment/app/aws_lb_controller
- name: Validate IaC changes on AWS LB Controller directory
run: terraform plan -var-file="../../common.tfvars" -var-file="../../backend.tfvars"
working-directory: infra-eks/deployment/app/aws_lb_controller
- name: Deploy AWS Load Balancer Controller
run: terraform apply -var-file="../../common.tfvars" -var-file="../../backend.tfvars" -auto-approve
working-directory: infra-eks/deployment/app/aws_lb_controller
deploy-k8s-application:
name: Deploy Kubernetes Application
needs: [deploy-ecr, retrieve-ssl, build-and-push-app-docker-image-to-ecr, deploy-eks-cluster, deploy-eks-node-group, install-aws-load-balancer-controller]
runs-on: ubuntu-latest
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
outputs:
application_url: ${{ steps.get-app-url.outputs.application_url }}
steps:
- name: Checkout code from the repository
uses: actions/checkout@v4
- name: Setup Terraform
uses: hashicorp/setup-terraform@v3
with:
terraform_version: ${{ env.TERRAFORM_VERSION }}
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ env.AWS_REGION }}
- name: Install kubectl
run: |
curl -LO "https://dl.k8s.io/release/v${{ env.KUBECTL_VERSION }}/bin/linux/amd64/kubectl"
chmod +x kubectl
sudo mv kubectl /usr/local/bin/
kubectl version --client
- name: Configure kubectl for EKS
run: |
aws eks update-kubeconfig \
--name ${{ needs.deploy-eks-cluster.outputs.cluster_id }} \
--region ${{ env.AWS_REGION }}
echo "KUBECONFIG=$HOME/.kube/config" >> $GITHUB_ENV
- name: Verify kubectl access
run: |
kubectl config current-context
kubectl get nodes
- name: Initialize Terraform on K8s app directory
run: terraform init -backend-config="../../backend-config.hcl" -backend-config="region=${{ env.AWS_REGION }}"
working-directory: infra-eks/deployment/app/k8s_app
- name: Create runtime tfvars with image tag
run: |
cat > runtime.auto.tfvars <<EOF
# Auto-generated runtime configuration
image_tag = "${{ needs.build-and-push-app-docker-image-to-ecr.outputs.image_tag }}"
EOF
echo "Created runtime.auto.tfvars with image_tag:"
cat runtime.auto.tfvars
working-directory: infra-eks/deployment/app/k8s_app
- name: Validate IaC changes on K8s app directory
run: terraform plan -var-file="../../common.tfvars" -var-file="../../domain.tfvars" -var-file="../../backend.tfvars"
working-directory: infra-eks/deployment/app/k8s_app
- name: Deploy Kubernetes application
run: terraform apply -var-file="../../common.tfvars" -var-file="../../domain.tfvars" -var-file="../../backend.tfvars" -auto-approve
working-directory: infra-eks/deployment/app/k8s_app
- name: Debug pods on failure
if: failure()
continue-on-error: true
run: |
echo "=== Pods ==="
kubectl get pods -n default || true
echo ""
echo "=== Pod Descriptions ==="
kubectl describe pods -n default || true
echo ""
echo "=== Pod Logs ==="
kubectl logs -n default --all-containers --tail=200 || true
echo ""
echo "=== Deployment Description ==="
kubectl describe deployment nestjs-app-deployment -n default || true
- name: Fetch application URL
id: get-app-url
run: |
application_url=$(terraform output -raw application_url || echo "Not available yet")
echo "application_url=$application_url" >> $GITHUB_OUTPUT
echo "Application URL: $application_url"
working-directory: infra-eks/deployment/app/k8s_app
env:
TF_IN_AUTOMATION: true
- name: Wait for Ingress to be ready
run: |
echo "Waiting for Ingress to provision ALB..."
kubectl wait --for=jsonpath='{.status.loadBalancer.ingress}' \
--timeout=600s ingress/nestjs-app-ingress || echo "Timeout waiting for Ingress"
continue-on-error: true
- name: Display deployment status
run: |
echo "=== Deployments ==="
kubectl get deployments
echo ""
echo "=== Services ==="
kubectl get services
echo ""
echo "=== Ingress ==="
kubectl get ingress
echo ""
echo "=== HPA ==="
kubectl get hpa
echo ""
echo "=== Pods ==="
kubectl get pods
deploy-routing:
name: Route to app via custom domain
needs: [deploy-eks-cluster, install-aws-load-balancer-controller, deploy-k8s-application]
runs-on: ubuntu-latest
env: # required by some steps
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
steps:
# Checkout the repository to enable the runner clone the project repo into its filesystem from the last repo
# commit, and make the files available to other steps of the workflow
- name: Checkout code from the repository
uses: actions/checkout@v4
- name: Setup Terraform
uses: hashicorp/setup-terraform@v3
with:
terraform_version: ${{env.TERRAFORM_VERSION}}
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ env.AWS_REGION }}
- name: Install kubectl
run: |
curl -LO "https://dl.k8s.io/release/v${{ env.KUBECTL_VERSION }}/bin/linux/amd64/kubectl"
chmod +x kubectl
sudo mv kubectl /usr/local/bin/
kubectl version --client
- name: Configure kubectl for EKS
run: |
aws eks update-kubeconfig \
--name ${{ needs.deploy-eks-cluster.outputs.cluster_id }} \
--region ${{ env.AWS_REGION }}
echo "KUBECONFIG=$HOME/.kube/config" >> $GITHUB_ENV
- name: Verify load balancer controller ingress config
run: |
kubectl get ingress -A
- name: Wait for ALB to be ready
run: |
kubectl wait \
--for=jsonpath='{.status.loadBalancer.ingress[0].hostname}' \
ingress/nestjs-app-ingress \
-n default \
--timeout=10m
- name: Initialise Terraform on the routing directory
run: terraform init -backend-config="../../backend-config.hcl" -backend-config="region=${{ env.AWS_REGION }}"
working-directory: infra-eks/deployment/app/routing
- name: Validate IaC changes on the routing directory
run: terraform plan -var-file="../../common.tfvars" -var-file="../../domain.tfvars" -var-file="../../backend.tfvars"
working-directory: infra-eks/deployment/app/routing
- name: Deploy the Route53 DNS record
run: terraform apply -var-file="../../common.tfvars" -var-file="../../domain.tfvars" -var-file="../../backend.tfvars" -auto-approve
working-directory: infra-eks/deployment/app/routing
deployment-summary:
name: Deployment Summary
needs: [deploy-ecr, retrieve-ssl, build-and-push-app-docker-image-to-ecr, deploy-vpc, deploy-eks-cluster, deploy-eks-node-group, install-aws-load-balancer-controller, deploy-k8s-application, deploy-routing]
runs-on: ubuntu-latest
if: always()
steps:
- name: Display deployment summary
run: |
cat << 'EOF'
╔════════════════════════════════════════════════════════════════╗
║ EKS Infrastructure Deployment Complete ║
╚════════════════════════════════════════════════════════════════╝
✓ Terraform State Bucket: Created
✓ ECR Repository: ${{ needs.deploy-ecr.outputs.ecr_repository_name }}
✓ SSL Certificate: Retrieved/Created
✓ VPC: Deployed with EKS-specific subnet tags
✓ Docker Image: Built and pushed to ECR
✓ EKS Cluster: ${{ needs.deploy-eks-cluster.outputs.cluster_id }}
✓ Node Group: ${{ needs.deploy-eks-node-group.outputs.node_group_name }}
✓ AWS Load Balancer Controller: Installed
✓ Application: Deployed
Application URL: ${{ needs.deploy-k8s-application.outputs.application_url }}
Next Steps:
1. Verify the application is accessible via the URL above
2. Check the ALB in AWS Console
3. Monitor pods: kubectl get pods -w
4. View logs: kubectl logs -f deployment/nestjs-app-deployment
╚════════════════════════════════════════════════════════════════╝
EOF