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:
-
Go to AWS ECS Task Definitions
-
Click on
Create new Task Definition
:
- Select the
Fargate
option and click onNext Step
:
- 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:
Note: The Operating system family
should be Linux
.
- Find the “Volumes” section and click on
Add volume
- 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 onAdd
:
Note: If you don’t have a File System ID, click on Amazon EFS console link and create one.
- Find the section
Container definitions
and click onAdd container
:
- In the side sheet, in the beginning, define a container name and paste the public ecr AccessBot image URL:
- 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:
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
- In the
Storage and Logging
section, select the created volume and type “/errbot/data/grant_requests” in theContainer Path
-
Then, in the bottom of the side sheet, click on
Add
-
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:
-
Go to Clusters
-
Click on “Create Cluster”:
- Select the
Network only
option and click onNext Step
:
- Choose a name for the Cluster and click on
Create
:
- 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:
- In the created cluster page, under the
Services
tab, click onCreate
:
- In the
Create Service
page, select the Fargate option, choose a service name and set the number of tasks to 1:
-
At the bottom of the page, click on
Next step
-
At the top of the page, select a Cluster VPC, a Subnet and select the same Security Group used on the created EFS volume:
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.
-
Then, at the bottom of the page, click on
Next step
-
There’s no need to set any Auto Scaling configuration, just click on
Next step
:
-
On the
Preview
page, just click onCreate service
. Then, when it finishes, click onView service
-
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: