Deploying JFrog Artifactory OSS on AWS Fargate with EFS and ALB.

Nanthan Rasiah
3 min readFeb 22, 2021

The purpose of this post is to explain how to set up JFrog Artifactory on AWS serverless architecture using AWS Fargate, EFS and Application Load Balancer.

JFrog Artifactory OSS is a free Artifactory edition used for managing binary packages that are created throughout the development and release process. Artifactory is part of development ecosystem and eases CI/CD process by managing lifecycles of binary resources.

AWS Fargate is a serverless technology that provides on-demand, right-sized compute capacity for containers and removes the need for infrastructure management. It lets you focus on your application development and all the server management is handled by AWS.

Amazon EFS is a fully-managed regional file sharing service which provides scalable, cost optimised elastic storage solution in AWS cloud. It grows and shrinks automatically as you add and remove files and removes the need for capacity management.

Application Load Balancer(ALB) is a software based load balancer which operates at application layer, layer 7 in OSI model and distributes HTTP/HTTPS traffic across multiple targets based on the content of the request.

JFrog Artifactory OSS provides docket image (releases-docker.jfrog.io/jfrog/artifactory-oss:latest) which can be deployed into AWS Fargate ECS configured with EFS to store binaries. ALB is used to for securely routing HTTPS traffic to Artifactory.

The following diagram describes Artifactory deployment set up in AWS serverless platform.

The following provides instructions, scripts and CloudFormation templates to deploy JFrog Artifactory OSS on AWS Fargate with EFS and ALB. Creating VPC and public subnets, private subnets, internet gateway, NAT gateways are out of the scope of this post and it assumes all the networking resources are already created.

  1. Create a repository in ECR using the following CLI.

2. Pull the artifactory image from jfrog docker registry using docker pull command.

3. Create tag on the image and push the image to ECR using the below commands.

4. Create ECS Cluster, ECS Task Execution Role and ECS Security Group using the following CloudFormation templates. Resources exported in output section will be used to cross reference them in other templates.

5. Create Elastic File System(EFS), Security Group, Mount Target and Access Point using the following CloudFormation. Mount Targets need to be created in each subnet for high availability.

6. Create certificate in AWS Certificate Manager using the following CloudFormation Template. You need to provide valid domain name as parameter. Domain name should be validated manually in DNS. Otherwise stack creation won’t be succeeded. Pls refer for DNS validation instruction: (https://docs.aws.amazon.com/acm/latest/userguide/gs-acm-validate-dns.html).

7. Create Application Load Balancer, Default HTTPS Listener and Default Target Group using the following template. Note default target group and listener are just created as it is not possible to create load balancer without them.

8. Create ECS Task Definition, Container Definition, ECS Service, Task Role, Target Group and HTTPS Listener using the following CloudFormation template. This will deploy the Artifactory image into AWS Fargate and allow to access application via load balancer.

Above commands and CloudFormation templates allows to deploy JFrog Artifactory on AWS Fargate ECS cluster with EFS volumes and access the application securely via Application Load Balancer which is configured with HTTPS listener for SSL termination. Above set up permits to deploy more ECS services in the ECS cluster and use the same ALB for load balancing.

References
1. https://jfrog.com/artifactory
2. https://aws.amazon.com/fargate
3. https://aws.amazon.com/efs
4. https://aws.amazon.com/elasticloadbalancing
5. https://aws.amazon.com/cloudformation
6.https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/walkthrough-crossstackref.html
7. https://aws.amazon.com/ecr

--

--

Nanthan Rasiah

Ex. AWS APN Ambassador | Architect | AWS Certified Pro | GCP Certified Pro | Azure Certified Expert | AWS Certified Security & Machine Learning Specialty