> ## Documentation Index
> Fetch the complete documentation index at: https://docs.keephq.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# AWS ECS

## Step 1: Login to AWS Console

* Open your web browser and navigate to the AWS Management Console.
* Log in using your AWS account credentials.

## Step 2: Navigate to ECS

* Click on the "Services" dropdown menu in the top left corner.
* Select "ECS" from the list of services.

## Step 3: Create 3 Task Definitions

* In the ECS dashboard, navigate to the "Task Definitions" section in the left sidebar.

  ![Task Definition](https://mintcdn.com/keep-docs/UirrBJ_gA3WakT01/images/ecs-task-def-create.png?fit=max\&auto=format\&n=UirrBJ_gA3WakT01\&q=85\&s=a1080c1ba7b5ec5566eba37116944b16)
* Click on "Create new Task Definition".

  ![Create new task definition](https://mintcdn.com/keep-docs/UirrBJ_gA3WakT01/images/ecs-task-def-create-new.png?fit=max\&auto=format\&n=UirrBJ_gA3WakT01\&q=85\&s=e844f732ab20dccaa922fd584e0cfea3)

  ### Task Definition 1 (Frontend - KeepUI):

  * Task Definition Family: keep-frontend

    ![Task Definition Family](https://mintcdn.com/keep-docs/UirrBJ_gA3WakT01/images/ecs-task-def-frontend1.png?fit=max\&auto=format\&n=UirrBJ_gA3WakT01\&q=85\&s=3b943a0f953f13120d38938d47d7bbdc)
  * Configure your container definitions as below:
    * Infrastructure Requirements:
      * Launch Type: AWS Fargate
      * OS, Architecture, Network mode: Linux/X86\_64
      * Task Size:
        * CPU: 1 vCPU
        * Memory: 2 GB
      * Task Role and Task Execution Role are optional if you plan on using secrets manager for example then create a task execution role to allow access to the secret manager you created.

        ![Infrastructure Requirements](https://mintcdn.com/keep-docs/UirrBJ_gA3WakT01/images/ecs-task-def-frontend2.png?fit=max\&auto=format\&n=UirrBJ_gA3WakT01\&q=85\&s=89466b07daea00d6cded959fc48ce9ef)
    * Container Details:
      * Name: keep-frontend
      * Image URI: us-central1-docker.pkg.dev/keephq/keep/keep-api:latest
      * Ports Mapping:
        * Container Port: 3000
        * Protocol: TCP

          ![Container Details](https://mintcdn.com/keep-docs/UirrBJ_gA3WakT01/images/ecs-task-def-frontend3.png?fit=max\&auto=format\&n=UirrBJ_gA3WakT01\&q=85\&s=d79335c42524c12b11b56e155b404432)
      * Environment Variables: (This can be static or you can use parameter store or secrets manager)
        * DATABASE\_CONNECTION\_STRING
        * AUTH\_TYPE
        * KEEP\_JWT\_SECRET
        * KEEP\_DEFAULT\_USERNAME
        * KEEP\_DEFAULT\_PASSWORD
        * SECRET\_MANAGER\_TYPE
        * SECRET\_MANAGER\_DIRECTORY
        * USE\_NGROK
        * KEEP\_API\_URL
          (The below variable is optional if you don't want to use websocket)
        * PUSHER\_DISABLED
          (The below variables are optional if you want to use websocket)
        * PUSHER\_APP\_ID
        * PUSHER\_APP\_KEY
        * PUSHER\_APP\_SECRET
        * PUSHER\_HOST
        * PUSHER\_PORT

          ![Environment Variables](https://mintcdn.com/keep-docs/UirrBJ_gA3WakT01/images/ecs-task-def-frontend4.png?fit=max\&auto=format\&n=UirrBJ_gA3WakT01\&q=85\&s=32c366e136c3439a5d5e707f50cf3c0e)
    * Review and create your task definition.

  ### Task Definition 2 (Backend - keepAPI):

  * Configure your container definitions as below:
    * Task Definition Family: keep-frontend

      ![Task Definition Family](https://mintcdn.com/keep-docs/UirrBJ_gA3WakT01/images/ecs-task-def-backend1.png?fit=max\&auto=format\&n=UirrBJ_gA3WakT01\&q=85\&s=846a65b6e3d64d778690efbe54196136)
    * Infrastructure Requirements:
      * Launch Type: AWS Fargate
      * OS, Architecture, Network mode: Linux/X86\_64
      * Task Size:
        * CPU: 1 vCPU
        * Memory: 2 GB
      * Task Role and Task Execution Role are optional if you plan on using secrets manager for example then create a task execution role to allow access to the secret manager you created.

        ![Infrastructure Requirements](https://mintcdn.com/keep-docs/UirrBJ_gA3WakT01/images/ecs-task-def-backend2.png?fit=max\&auto=format\&n=UirrBJ_gA3WakT01\&q=85\&s=973d01e5153b923c11d80ade08aee26b)
    * Container Details:
      * Name: keep-backend
      * Image URI: us-central1-docker.pkg.dev/keephq/keep/keep-api:latest
      * Ports Mapping:
        * Container Port: 8080
        * Protocol: TCP

          ![Container Details](https://mintcdn.com/keep-docs/UirrBJ_gA3WakT01/images/ecs-task-def-backend3.png?fit=max\&auto=format\&n=UirrBJ_gA3WakT01\&q=85\&s=18e4171d611381a8dce35d96613ab84f)
      * Environment Variables: (This can be static or you can use parameter store or secrets manager)
        * DATABASE\_CONNECTION\_STRING
        * AUTH\_TYPE
        * KEEP\_JWT\_SECRET
        * KEEP\_DEFAULT\_USERNAME
        * KEEP\_DEFAULT\_PASSWORD
        * SECRET\_MANAGER\_TYPE
        * SECRET\_MANAGER\_DIRECTORY
        * USE\_NGROK
        * KEEP\_API\_URL
          (The below variable is optional if you don't want to use websocket)
        * PUSHER\_DISABLED
          (The below variables are optional if you want to use websocket)
        * PUSHER\_APP\_ID
        * PUSHER\_APP\_KEY
        * PUSHER\_APP\_SECRET
        * PUSHER\_HOST
        * PUSHER\_PORT

          ![Environment Variables](https://mintcdn.com/keep-docs/UirrBJ_gA3WakT01/images/ecs-task-def-backend4.png?fit=max\&auto=format\&n=UirrBJ_gA3WakT01\&q=85\&s=53fc97dd2fd0e19e72f3c925cfc7b40a)
    * Storage:
      * Volume Name: keep-efs
      * Configuration Type: Configure at task definition creation
      * Volume type: EFS
      * Storage configurations:
        * File system ID: Select an existing EFS filesystem or create a new one
        * Root Directory: /

          ![Volume Configuration](https://mintcdn.com/keep-docs/UirrBJ_gA3WakT01/images/ecs-task-def-backend5.png?fit=max\&auto=format\&n=UirrBJ_gA3WakT01\&q=85\&s=192681e183a88b8c9d16c4e6527b8752)
      * Container mount points:
        * Container: select the container you just created
        * Source volume: keep-efs
        * Container path: /app
        * Make sure that Readonly is not selected

          ![Container Mount](https://mintcdn.com/keep-docs/UirrBJ_gA3WakT01/images/ecs-task-def-backend6.png?fit=max\&auto=format\&n=UirrBJ_gA3WakT01\&q=85\&s=a391e8f8c0a4a0508cc28ea9234fa084)
    * Review and create your task definition.

  ### Task Definition 3 (Websocket): (This step is optional if you want to have automatic refresh of the alerts feed)

  * Configure your container definitions as below:
    * Task Definition Family: keep-frontend

      ![Task Definition Family](https://mintcdn.com/keep-docs/UirrBJ_gA3WakT01/images/ecs-task-def-websocket1.png?fit=max\&auto=format\&n=UirrBJ_gA3WakT01\&q=85\&s=5e382bcc89295f6de4063bb17b689ebb)
    * Infrastructure Requirements:
      * Launch Type: AWS Fargate
      * OS, Architecture, Network mode: Linux/X86\_64
      * Task Size:
        * CPU: 0.25 vCPU
        * Memory: 1 GB
      * Task Role and Task Execution Role are optional if you plan on using secrets manager for example then create a task execution role to allow access to the secret manager you created.

        ![Infrastructure Requirements](https://mintcdn.com/keep-docs/UirrBJ_gA3WakT01/images/ecs-task-def-websocket2.png?fit=max\&auto=format\&n=UirrBJ_gA3WakT01\&q=85\&s=6ee677be867cbbaa8c7bde9924682e14)
    * Container Details:
      * Name: keep-websocket
      * Image URI: quay.io/soketi/soketi:1.4-16-debian
      * Ports Mapping:
        * Container Port: 6001
        * Protocol: TCP

          ![Container Details](https://mintcdn.com/keep-docs/UirrBJ_gA3WakT01/images/ecs-task-def-websocket3.png?fit=max\&auto=format\&n=UirrBJ_gA3WakT01\&q=85\&s=3031541399cf467ad31a6346771981fe)
      * Environment Variables: (This can be static or you can use parameter store or secrets manager)
        * SOKETI\_DEBUG
        * SOKETI\_DEFAULT\_APP\_ID
        * SOKETI\_DEFAULT\_APP\_KEY
        * SOKETI\_DEFAULT\_APP\_SECRET
        * SOKETI\_USER\_AUTHENTICATION\_TIMEOUT

          ![Environment Variables](https://mintcdn.com/keep-docs/UirrBJ_gA3WakT01/images/ecs-task-def-websocket4.png?fit=max\&auto=format\&n=UirrBJ_gA3WakT01\&q=85\&s=689f9ed91d99be3edc476507ab29e693)
  * Review and create your task definition.

## Step 4: Create Keep Service

* In the ECS dashboard, navigate to the "Clusters" section in the left sidebar.
* Select the cluster you want to deploy your service to.
* Click on the "Create" button next to "Services".
* Configure your service settings.
* Review and create your service.

## Step 5: Monitor Your Service

* Once your service is created, monitor its status in the ECS dashboard.
* You can view task status, service events, and other metrics to ensure your service is running correctly.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.