AWS Deployment

October 5, 2023 ยท View on GitHub

Used AWS Services

ECS

Amazon ECS is a fully managed container orchestration service that makes it easy for you to deploy, manage, and scale containerized applications.

Overview

ServiceImageUrl
OpenSCDlfenergy/compas-open-scdhttps://hub.docker.com/r/lfenergy/compas-open-scd
Cim Mappinglfenergy/compas-cim-mappinghttps://hub.docker.com/r/lfenergy/compas-cim-mapping
Auto Alignmentlfenergy/compas-scl-auto-alignmenthttps://hub.docker.com/r/lfenergy/compas-scl-auto-alignment
Scl Validatorlfenergy/compas-scl-validatorhttps://hub.docker.com/r/lfenergy/compas-scl-validator
Scl Data Servicelfenergy/compas-scl-data-servicehttps://hub.docker.com/r/lfenergy/compas-scl-data-service

Setup

Prerequisites

Look up your profile id on AWS (login on https://aws.amazon.com and it should be in the dropdown menu under your username). Now change the executionRoleArn to something like this:

"executionRoleArn": "arn:aws:iam::[PROFILE_ID]:role/ecsTaskExecutionRole",

Change the executionRoleArn in the following files:

Go to the Elastic Container Service in the AWS console. Here you can create a new cluster. After creating the new cluster, you can click on it to get inside the cluster. You should have task definitions in the menu on the sidebar. Within task definitions, you can create the tasks. Click on Create new task definition with JSON and paste the first json file in. Now create task definitions for the other json files mentioned above.

Back in you cluster, click on Deploy under the Services tab. For launch type, choose Fargate. Application type should be Task. Family should be one of the newly created Task Definitions.

If you don't have a load balancer set up yet, you can create a load balancer now. Choose ALB, or Application Load Balancer as type. Check the mapping inside the nginx proxy to use the correct mappings for each service.

When deploying the Services, make sure that the target groups have the correct healthcheck.