Deploy NodeJS Application on AWS ECS Using GitHub Actions

Поділитися
Вставка
  • Опубліковано 10 вер 2024
  • In this video I will explain how you can deploy your Nodejs application to AWS ECS instance using GitHub Actions. I'll start by containerizing a NodeJS application, pushing it to Amazon Elastic Container Registry(ECR), and then using GitHub Actions to automate the deployment process on AWS ECS instance.
    Example Workflow: github.com/int...
    GitHub Repository: github.com/int...
    Steps: docs.github.co...
    Search Queries:
    What is docker
    Deploy Nodejs application to AWS ECS using GitHub Actions
    Deploy Nodejs application to AWS EC2 using GitHub Actions
    GitHub Actions
    How to create GitHub self-hosted runner
    How to set GitHub actions for CI/CD with AWS ECS
    How to set GitHub actions for CI/CD with AWS EC2
    CI/CD with GitHub Action
    Auto deploy nodejs app on AWS ECS
    Auto deploy nodejs app on AWS EC2
    Creating a continuous delivery pipeline with GitHub Actions
    CI/CD pipeline using GitHub Actions
    Docker benefits
    How to deploy applications using GitHub Actions
    Build docker image
    Deploy nodejs app on AWS EC2 instance
    Deploy nodejs app on AWS ECS instance
    Github actions workflow
    Github actions Docker
    Github actions aws
    Github actions build docker image
    Aws github actions
    Automatic deployment with github actions
    Build docker image with github actions
    Github actions ci/cd aws
    Deploy to ecs using github actions
    Github hosted runner
    How to configure github self hosted runner
    Understanding github actions
    Learn github actions
    Quickstart for github actions
    Workflow syntax for github actions
    Essential features of github actions
    Github actions deepdive
    Cicd basics
    Cicd github actions
    Cicd devops
    Cicd pipeline using github actions
    Cicd github actions aws
    Github actions deploy to AWS ec2
    Github actions deploy to AWS ECS
    Docker github actions
    Deploy github actions
    Github actions secrets
    Github actions self hosted runners
    Github hosted runners
    Github actions course
    Github actions beginner tutorial
    Github actions build and push docker image
    Docker tutorial
    Docker explained
    Docker container
    Docker nodejs
    Docker nodejs typescript
    Docker nodejs application
    Deploy Containerized Applications with Amazon EC2
    Deploy Containerized Applications with Amazon ECS
    AWS ECS using EC2
    Create and Push to ECR repository
    Create a ECS cluster
    Create a Task Definition
    Run the task
    Create a Service
    How to Deploy Applications using GitHub Actions to AWS ECS
    How to Deploy Applications using GitHub Actions to AWS EC2
    Deploying to Amazon Elastic Container Service
    AWS push docker image to ECR and deploy to ECS cluster
    how to deploy a docker app to AWS ECS
    how to deploy a docker app to AWS EC2
    deploy containerized applications with amazon ecs
    How to create Elastic Container Repository(ECR) in AWS
    Using Amazon Elastic Container Registry (Amazon ECR) to Store Container Images
    push docker images on AWS ECR
    how to push docker image to aws ECR
    how to create AWS ECR
    how to create AWS ECS instance
    how to create repository in AWS ECR
    how to create repository in AWS elastic container registry
    Auto build & push docker image to AWS ECR with GitHub Actions
    How to deploy a Node Express API to AWS ECS instance
    How to setup AWS ECS cluster with EC2 in AWS
    Setup AWS ECR and ECS
    How to setup ECS with EC2 instance
    Build a docker image and publish it to AWS ECR using GitHub Actions
    #aws #awsec2 #docker #devops #devopstutorial #cicd #integration #githubactions #github #dockertraining #nodejs #dockerfile #aws #dockercontainer #dockerhub #awsactions #ecr #awsecs #containers #amazonwebservices

КОМЕНТАРІ • 35

  • @tongtongshi3433
    @tongtongshi3433 5 місяців тому +2

    Thank you for your very detailed tutorial🎉 Looking forward for more hands on videos about Mern app using terraform and GitHub actions.

    • @IntegrationNinjas
      @IntegrationNinjas  5 місяців тому

      Glad it was helpful! Will explore more areas definitely.

  • @tongtongshi3433
    @tongtongshi3433 5 місяців тому +1

    I like the way that you troubleshoot the bug,because that is real life😂😂

    • @IntegrationNinjas
      @IntegrationNinjas  5 місяців тому

      True, these are real scenarios in a developer’s life.

  • @user-rh2kt3rq2j
    @user-rh2kt3rq2j 11 місяців тому +1

    Amai zing video, I was following it step by step and it worked really well. Thanks a lot

  • @wyo2151
    @wyo2151 9 місяців тому +1

    amazing explanation and troubleshooting. Thanks!

  • @darshankhatri9625
    @darshankhatri9625 Рік тому +2

    Very insightful, thanks for creating this 👍

  • @vbsdareautin
    @vbsdareautin 9 місяців тому +1

    this is amazing. Thanks for creating.

  • @rkstarji
    @rkstarji 3 місяці тому +1

    I'm getting below error, can you please help me
    Error: Credentials could not be loaded, please check your action inputs: Could not load credentials from any providers

    • @IntegrationNinjas
      @IntegrationNinjas  3 місяці тому

      Seems like your application running on ECS Fargate cannot retrieve credentials to access AWS services. Can be due to below reasons:
      Missing Task Role: The ECS task might not be assigned an IAM role with the necessary permissions.
      Incorrect Credential Provider Configuration: NodeJS application code might not be configured to use the credentials provided by ECS.
      Please check once.

  • @djoka000
    @djoka000 8 місяців тому +1

    Good tutorial, one small note is I think it'd be helpful if you included which IAM roles are needed for the credentials that get used in this GH Action

    • @IntegrationNinjas
      @IntegrationNinjas  8 місяців тому +2

      Hi George, below is the list of IAM roles used in this complete process:
      AmazonEC2ContainerRegistryFullAccess: Grants full access to Amazon ECR for pushing images.
      AmazonECS_FullAccess: Grants full access to ECS for updating task definitions and services.
      AmazonECSTaskExecutionRolePolicy: Allows tasks to pull images from ECR and access other AWS resources as needed by the application.

    • @djoka000
      @djoka000 8 місяців тому +1

      ​@@IntegrationNinjas Perfect, thank you very much! The fact you responded really shows that you're dedicated to helping people learn, respect 🫡
      Keep up the great work!

    • @IntegrationNinjas
      @IntegrationNinjas  8 місяців тому +1

      No Problem 🙂

    • @djoka000
      @djoka000 8 місяців тому

      @@IntegrationNinjas One more question - the initial deployment works, but then if I push another change to my Node.js project, it doesn't properly update, instead in the "Events" tab of my ECS service I see the following error message. Is that expected or did I mess something up?
      "service was unable to place a task because no container instance met all of its requirements. The closest matching container-instance is already using a port required by your task. "

    • @IntegrationNinjas
      @IntegrationNinjas  7 місяців тому +1

      Possible cause: You might not be updating the task definition in your GitHub Actions workflow when pushing new changes.
      Solution: Ensure your workflow updates the task definition with the new image tag.
      Or
      Your task definition might explicitly map a specific host port (e.g., 80) to the container port, even if the container uses a dynamic port internally. This fixed mapping can clash with other tasks or containers.

  • @sruthi201
    @sruthi201 2 місяці тому

    I am getting build a docker container error it showing unable to prepare context: path can you please tell me the solution

  • @nhuongtrieuhoang6611
    @nhuongtrieuhoang6611 8 місяців тому +2

    Can you new write for project : web,application and database, api ,...to ECS/EKS via github action ? How to write and input evn,variable and automation value. Thanks

    • @IntegrationNinjas
      @IntegrationNinjas  8 місяців тому +1

      Will upload a video soon on deployment process for MERN stack application.

  • @kunalacharya5291
    @kunalacharya5291 Рік тому +1

    Great interpretation, thanks

  • @userasd360
    @userasd360 3 місяці тому

    Since it is a service the deployment rolledback due to insufficient memory for that task. One thing we can do is stop the previous task running in that service and start a new deployment

  • @user-li9it6cf6o
    @user-li9it6cf6o Місяць тому

    great demo, but if we have some sensitive data as variable environment in the task definition file, how to handle it ??

    • @ArjunShankar1
      @ArjunShankar1 23 дні тому

      You can use AWS Secrets manager for this I believe

  • @user-cw8xe9bg1y
    @user-cw8xe9bg1y 7 місяців тому +1

    If i change some text how should i update?

    • @IntegrationNinjas
      @IntegrationNinjas  7 місяців тому +1

      You can commit your changes and workflow will be triggered automatically to redeploy those changes.

  • @ahmetatalay6434
    @ahmetatalay6434 6 місяців тому

    how to add in addition to loadbalancer ? By the way so verry well video thanks a lot.

  • @vinayraj3590
    @vinayraj3590 10 місяців тому +1

    Thanks bro

  • @Simple38
    @Simple38 Рік тому +1

    What needs a developer to say himself he has the knowledge of devops is integrating these services enough for him to say himself that he has the knowledge in devops ?

    • @IntegrationNinjas
      @IntegrationNinjas  Рік тому

      Claiming to have knowledge in DevOps involves more than just integrating services or tools.
      It requires a deep understanding of DevOps principles, proficiency in relevant tools and technologies, and the ability to implement DevOps practices effectively within an organization.
      DevOps is a multidisciplinary field that encompasses automation, collaboration, and a cultural shift toward DevOps practices, and a developer should be able to demonstrate competence in these areas before self-identifying as having DevOps knowledge.