Serverless Installation

Overview

AWS Fargate is a serverless compute engine for containers. Using it in conjunction with Amazon Elastic Container Service (ECS), you can run Kill Bill in containers without the need to deploy and manage any server.

While we recommend using our Cloudformation template to deploy a production ready environment, running Kill Bill on ECS with Fargate is a great way to quickly deploy test environments.

Docker Images on AWS Marketplace

The Docker images required for running Kill Bill on ECS are available on AWS Marketplace. To access these images, follow these steps:

  1. Subscribe to the product on AWS Marketplace by visiting the following link: https://aws.amazon.com/marketplace/pp/prodview-55w3bwkeabhba

  2. Once subscribed, you can download the necessary Docker images directly from the AWS Marketplace.

Instructions

Create the Cluster

  1. Subscribe to the product in the AWS Marketplace.

  2. Create an AWS ECS Cluster:

    ecs cluster
  3. Select the Networking only template:

    ecs cluster fargate
  4. Enter a cluster name:

    ecs cluster name

    If these above steps are successful, AWS displays a success screen:

    ecs cluster success

Create a Fargate Task Definition

  1. Create a Fargate Task Definition:

    ecs task definition fargate
  2. At the bottom of the screen, select Configure via JSON:

    image::../assets/aws/ecs-task-definition-via-json.png

  3. Create an IAM role that allows the aws-marketplace:RegisterUsage action and the ecsTaskExecutionRole role.

  4. Enter the content of the following JSON file and replace ECS_TASK_EXECUTION_ROLE_ARN and ECS_TASK_ROLE_ARN with the ARN of the role created in the previous step. Also, replace ACCOUNT_ID with your AWS account ID:

  5. Once the UI has been populated from this JSON:

    1. Update the awslogs-region for each container in case you are deploying in another region than us-east-1.

    2. Modify the environment variable KILLBILL_ADMIN_PASSWORD (which is the password for the Kill Bill user) to change the default value.

  6. Run the task from your cluster:

    ecs run task
  7. Choose FARGATE as the launch type and select an existing VPC and subnet:

    ecs run task config
  8. The Security group needs to have port 8080 open for Kill Bill and 9090 for Kaui:

    ecs run task security group

It takes a few minutes for the task to start. Once all the containers are healthy, you can access Kaui at http://PUBLIC_IP:9090/users/sign_in and Kill Bill at http://PUBLIC_IP:8080/api.html.

About Logs

Logs are by default forwarded to CloudWatch in the Log Group /ecs/killbill. You must create it if it doesn’t exist.

Alternatively, you can update the logConfiguration definitions in the task.json depending on your environment (see the associated AWS documentation).