Deploying on Amazon Web Service

This guide explains how to deploy A2 on Amazon Web Service (AWS).

There are various ways to deploy Docker images on AWS platforms, such as AWS EC2, AWS App Runner, AWS Lightsail, and AWS EKS. This article will explain the simplest method, which is deploying on AWS ECS.

Registering Docker Image in ECR

To use Docker images in AWS, you need to register the image in the Elastic Container Registry (ECR). For detailed instructions on image registration, refer to the official AWS document, which covers repository creation and Docker image push.

Upon completion, you will see a screen like this in your ECR repository:

From now on, use the value in the URI column to deploy the image.

Setting up AWS ECS

1. Creating a Cluster

To use AWS Elastic Container Service, you first need to create a cluster. Navigate to Clusters > Create Cluster in ECS, and you will see a screen like this:

  1. Enter an appropriate name in Cluster name.
  2. Both AWS Fargate and EC2 can be used for Infrastructure, but this guide will use the simpler AWS Fargate.
  3. Create the cluster.

2. Defining a Task

To use the image, you need to define a task. Navigate to Task definition > Create new task definition in ECS.

  1. Task definition configuration
    • Enter an appropriate task name.
  2. Infrastructure requirements
    • Select AWS Fargate for Launch type.
    • Select Linux/X86_64 for Operating system/Architecture.
    • A task size of 8 vCPUs and 16GB of memory is recommended.
  3. Container
    • Enter an appropriate container name and the image URI registered in ECR.
    • Open the following ports:
      • TCP port 8000 - A2 Campaign Management System UI
    • Allocate all resources to the single container included in the task.
    • Enable the Use log collection option under Logging.
  4. Volume
    • A2’s data is stored at /var/a2/data, so define appropriate storage size and mount it to the /var/a2/data path to retain container data. • For retaining data, specify Configuration Type as Configure at deployment using AWS EBS. • Refer to the images below for detailed settings.

3. Deploying the Task

Deploy the task defined in step 2 to the cluster. This can be done through Clusters > Tasks > Run new task.

  1. Deployment Configuration
    • Specify the predefined task.
    • For Application Type, Task is recommended as Service cannot retain volumes.
  2. Networking
    • Create a new Security group and define inbound rules for each port to enable external communication with the container.
    • For testing, set Source to Anywhere, but it is recommended to restrict it to actual IPs for security.
    • Enable Public IP for automatic IP allocation.
  3. Volume
    • Specify and create the desired volume size to mount AWS EBS to the volume defined in the task.
    • Uncheck Delete on termination to retain data.

4. Completion

After completing all settings and deployment, you can use A2 via the assigned public IP.

By following this manual, you can successfully deploy A2 on AWS. If you have any additional questions, please feel free to contact our support team.