> ## 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.
  <img src="https://mintcdn.com/keep-docs/UirrBJ_gA3WakT01/images/ecs-task-def-create.png?fit=max&auto=format&n=UirrBJ_gA3WakT01&q=85&s=a1080c1ba7b5ec5566eba37116944b16" alt="Task Definition" width="200" height="200" data-path="images/ecs-task-def-create.png" />
* Click on "Create new Task Definition".

  <img src="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" alt="Create new task definition" width="2194" height="424" data-path="images/ecs-task-def-create-new.png" />

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

  * Task Definition Family: keep-frontend
    <img src="https://mintcdn.com/keep-docs/UirrBJ_gA3WakT01/images/ecs-task-def-frontend1.png?fit=max&auto=format&n=UirrBJ_gA3WakT01&q=85&s=3b943a0f953f13120d38938d47d7bbdc" alt="Task Definition Family" width="2194" height="650" data-path="images/ecs-task-def-frontend1.png" />
  * 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.
        <img src="https://mintcdn.com/keep-docs/UirrBJ_gA3WakT01/images/ecs-task-def-frontend2.png?fit=max&auto=format&n=UirrBJ_gA3WakT01&q=85&s=89466b07daea00d6cded959fc48ce9ef" alt="Infrastructure Requirements" width="1466" height="1264" data-path="images/ecs-task-def-frontend2.png" />
    * Container Details:
      * Name: keep-frontend
      * Image URI: us-central1-docker.pkg.dev/keephq/keep/keep-api:latest
      * Ports Mapping:
        * Container Port: 3000
        * Protocol: TCP
          <img src="https://mintcdn.com/keep-docs/UirrBJ_gA3WakT01/images/ecs-task-def-frontend3.png?fit=max&auto=format&n=UirrBJ_gA3WakT01&q=85&s=d79335c42524c12b11b56e155b404432" alt="Container Details" width="1466" height="1206" data-path="images/ecs-task-def-frontend3.png" />
      * 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
          <img src="https://mintcdn.com/keep-docs/UirrBJ_gA3WakT01/images/ecs-task-def-frontend4.png?fit=max&auto=format&n=UirrBJ_gA3WakT01&q=85&s=32c366e136c3439a5d5e707f50cf3c0e" alt="Environment Variables" width="1046" height="1142" data-path="images/ecs-task-def-frontend4.png" />
    * Review and create your task definition.

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

  * Configure your container definitions as below:
    * Task Definition Family: keep-frontend
      <img src="https://mintcdn.com/keep-docs/UirrBJ_gA3WakT01/images/ecs-task-def-backend1.png?fit=max&auto=format&n=UirrBJ_gA3WakT01&q=85&s=846a65b6e3d64d778690efbe54196136" alt="Task Definition Family" width="2028" height="618" data-path="images/ecs-task-def-backend1.png" />
    * 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.
        <img src="https://mintcdn.com/keep-docs/UirrBJ_gA3WakT01/images/ecs-task-def-backend2.png?fit=max&auto=format&n=UirrBJ_gA3WakT01&q=85&s=973d01e5153b923c11d80ade08aee26b" alt="Infrastructure Requirements" width="1476" height="1264" data-path="images/ecs-task-def-backend2.png" />
    * Container Details:
      * Name: keep-backend
      * Image URI: us-central1-docker.pkg.dev/keephq/keep/keep-api:latest
      * Ports Mapping:
        * Container Port: 8080
        * Protocol: TCP
          <img src="https://mintcdn.com/keep-docs/UirrBJ_gA3WakT01/images/ecs-task-def-backend3.png?fit=max&auto=format&n=UirrBJ_gA3WakT01&q=85&s=18e4171d611381a8dce35d96613ab84f" alt="Container Details" width="1756" height="1136" data-path="images/ecs-task-def-backend3.png" />
      * 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
          <img src="https://mintcdn.com/keep-docs/UirrBJ_gA3WakT01/images/ecs-task-def-backend4.png?fit=max&auto=format&n=UirrBJ_gA3WakT01&q=85&s=53fc97dd2fd0e19e72f3c925cfc7b40a" alt="Environment Variables" width="1452" height="1192" data-path="images/ecs-task-def-backend4.png" />
    * 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: /
          <img src="https://mintcdn.com/keep-docs/UirrBJ_gA3WakT01/images/ecs-task-def-backend5.png?fit=max&auto=format&n=UirrBJ_gA3WakT01&q=85&s=192681e183a88b8c9d16c4e6527b8752" alt="Volume Configuration" width="1634" height="1254" data-path="images/ecs-task-def-backend5.png" />
      * Container mount points:
        * Container: select the container you just created
        * Source volume: keep-efs
        * Container path: /app
        * Make sure that Readonly is not selected
          <img src="https://mintcdn.com/keep-docs/UirrBJ_gA3WakT01/images/ecs-task-def-backend6.png?fit=max&auto=format&n=UirrBJ_gA3WakT01&q=85&s=a391e8f8c0a4a0508cc28ea9234fa084" alt="Container Mount" width="1954" height="556" data-path="images/ecs-task-def-backend6.png" />
    * 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
      <img src="https://mintcdn.com/keep-docs/UirrBJ_gA3WakT01/images/ecs-task-def-websocket1.png?fit=max&auto=format&n=UirrBJ_gA3WakT01&q=85&s=5e382bcc89295f6de4063bb17b689ebb" alt="Task Definition Family" width="2110" height="590" data-path="images/ecs-task-def-websocket1.png" />
    * 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.
        <img src="https://mintcdn.com/keep-docs/UirrBJ_gA3WakT01/images/ecs-task-def-websocket2.png?fit=max&auto=format&n=UirrBJ_gA3WakT01&q=85&s=6ee677be867cbbaa8c7bde9924682e14" alt="Infrastructure Requirements" width="1470" height="1266" data-path="images/ecs-task-def-websocket2.png" />
    * Container Details:
      * Name: keep-websocket
      * Image URI: quay.io/soketi/soketi:1.4-16-debian
      * Ports Mapping:
        * Container Port: 6001
        * Protocol: TCP
          <img src="https://mintcdn.com/keep-docs/UirrBJ_gA3WakT01/images/ecs-task-def-websocket3.png?fit=max&auto=format&n=UirrBJ_gA3WakT01&q=85&s=3031541399cf467ad31a6346771981fe" alt="Container Details" width="1772" height="1140" data-path="images/ecs-task-def-websocket3.png" />
      * 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
          <img src="https://mintcdn.com/keep-docs/UirrBJ_gA3WakT01/images/ecs-task-def-websocket4.png?fit=max&auto=format&n=UirrBJ_gA3WakT01&q=85&s=689f9ed91d99be3edc476507ab29e693" alt="Environment Variables" width="1772" height="838" data-path="images/ecs-task-def-websocket4.png" />
  * 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.
