Link Search Menu Expand Document

Deploy AccessBot on Fargate

Creating an ECS Task Definition

To deploy AccessBot on Fargate, first we need to configure a Task Definition following the next steps:

  1. Go to AWS ECS Task Definitions

  2. Click on Create new Task Definition:

image

  1. Select the Fargate option and click on Next Step:

image

  1. Fill the following fields of the first three sections of the step 2. The following screenshot is showing the minimum configuration that should be used:

image

Note: The Operating system family should be Linux.

  1. Find the “Volumes” section and click on Add volume

image

  1. In the Add volume modal, choose a name for the volume, select the EFS option as the volume type, select the File System ID and click on Add:

image

Note: If you don’t have a File System ID, click on Amazon EFS console link and create one.

  1. Find the section Container definitions and click on Add container:

image

  1. In the side sheet, in the beginning, define a container name and paste the public ecr AccessBot image URL:

image

  1. Now, in the Environment section, feel free to configure it the way you like. But here are the minimum environment variables that should be configured:

image

Note: The SDM_ENABLE_BOT_STATE_HANDLING is essential if you want to use manual approvals. For more information, please refer to the CONFIGURE_ACCESSBOT docs

  1. In the Storage and Logging section, select the created volume and type “/errbot/data/grant_requests” in the Container Path

image

  1. Then, in the bottom of the side sheet, click on Add

  2. And finally, click on the Create button at the bottom of the page

Creating an ECS Cluster

Now we need to create a cluster for the Fargate instance following the next steps:

  1. Go to Clusters

  2. Click on “Create Cluster”:

image

  1. Select the Network only option and click on Next Step:

image

  1. Choose a name for the Cluster and click on Create:

image

  1. You’ll be redirected to the Created Cluster page.

Creating an ECS Cluster Service

An ECS Cluster Service create tasks from a Task Definition revision. When the task goes down, the service will provision another one as a Replica.

To create a service, follow the steps below:

  1. In the created cluster page, under the Services tab, click on Create:

image

  1. In the Create Service page, select the Fargate option, choose a service name and set the number of tasks to 1:

image

  1. At the bottom of the page, click on Next step

  2. At the top of the page, select a Cluster VPC, a Subnet and select the same Security Group used on the created EFS volume:

image

Note: make sure the EFS and the cluster service being created belongs to the same Security Group, because both resources must communicate with other. Without that your container might not even start because it’ll not find the volume.

  1. Then, at the bottom of the page, click on Next step

  2. There’s no need to set any Auto Scaling configuration, just click on Next step:

image

  1. On the Preview page, just click on Create service. Then, when it finishes, click on View service

  2. Now, just wait the service to provision a task and wait its status to become running. When that happens, just wait a couple more seconds and AccessBot should be ready to use:

image