AWS ECS Configuration

This document provides a summary of deploying the Arculus FIDO2 Server on AWS ECS Fargate.

For deployment overview and other deployment options, see 3. Deployment.

For the complete step-by-step guide, see CUSTOMER_DEPLOYMENT_GUIDE.mdarrow-up-right.

Architecture Overview

spinner

Prerequisites

AWS Account Requirements

  • AWS account with appropriate permissions

  • AWS CLI installed and configured

  • Required IAM permissions:

    • CloudFormation

    • ECS

    • EC2 (security groups, VPC)

    • Elastic Load Balancing

    • IAM (roles, policies)

    • CloudWatch Logs

    • Secrets Manager

    • S3

Network Infrastructure

Required VPC setup:

Component
Requirement

VPC

With public and private subnets

Availability Zones

Minimum 2 AZs

Internet Gateway

For public subnets

NAT Gateway

For private subnet internet access

SSL Certificate

Obtain or create an SSL certificate in AWS Certificate Manager:

MongoDB Database

Supported options:

  • MongoDB Atlas (cloud-managed)

  • Amazon DocumentDB

  • Self-managed MongoDB

CloudFormation Stack Structure

The deployment uses nested CloudFormation stacks:

Stack Parameters

Parameter
Description
Example

Environment

Deployment environment

prod, staging, dev

ApplicationName

Resource naming prefix

arculus-auth

VpcId

Target VPC

vpc-xxx

PrivateSubnets

ECS service subnets

subnet-xxx,subnet-yyy

PublicSubnets

Load balancer subnets

subnet-aaa,subnet-bbb

CertificateArn

SSL certificate ARN

arn:aws:acm:...

DomainName

Application domain

auth.example.com

MongoDBHost

Database hostname

cluster.mongodb.net

MongoDBUsername

Database username

admin

MongoDBPassword

Database password

(secure value)

ImageTag

Docker image tag

latest

Deployment Steps

Step 1: Push Docker Images to ECR

Step 2: Create S3 Bucket for Templates

Step 3: Configure Parameters

Edit parameters/prod.json:

Step 4: Deploy Stack

Resource Sizing

Environment Mappings

Environment
PyFIDO CPU
PyFIDO Memory
Desired Count

dev

256

512 MB

1

staging

512

1024 MB

2

prod

1024

2048 MB

3

Scaling Considerations

  • CPU: Increase for high computation (signature verification)

  • Memory: Increase for high concurrent sessions

  • Task Count: Scale horizontally for high availability

Networking

Security Groups

Resource
Inbound
Source

ALB

443 (HTTPS)

0.0.0.0/0

ALB

5001 (PyFIDO)

0.0.0.0/0

ALB

8080 (Tomcat)

0.0.0.0/0

ECS Tasks

5001, 8080

ALB Security Group

MongoDB

27017

ECS Security Group

Load Balancer Configuration

Listener
Port
Protocol
Target

HTTPS

443

HTTPS

Tomcat

PyFIDO

5001

HTTPS

PyFIDO

Tomcat

8080

HTTPS

Tomcat

Secrets Management

Secrets are stored in AWS Secrets Manager:

Secret
Contents

MongoDB Secret

username, password, host, port

Application Secret

API keys, JWT secrets

ECS tasks access secrets via IAM task role permissions.

Logging

CloudWatch Log Groups

Log Group
Service

/ecs/arculus-auth/ENV/pyfido

PyFIDO Server

/ecs/arculus-auth/ENV/tomcat

Tomcat Portal

Log Retention

Environment
Retention

dev

7 days

staging

30 days

prod

90 days

Viewing Logs

Service Management

Start/Stop Services

Force Redeployment

Health Checks

Load Balancer Health Checks

Target
Path
Healthy Threshold
Interval

PyFIDO

/health

2

30s

Tomcat

/

2

30s

Verification

Stack Outputs

After deployment, retrieve key values:

Output
Description

LoadBalancerDNS

ALB DNS name for DNS configuration

PyFidoEndpoint

PyFIDO API endpoint URL

TomcatEndpoint

Tomcat portal URL

ClusterName

ECS cluster name

MongoDBSecretArn

Secrets Manager ARN

DNS Configuration

Create a CNAME or ALIAS record pointing to the LoadBalancerDNS output:

For Route 53, use an A record with alias to the load balancer.

Updates and Maintenance

Rolling Updates

The deployment supports zero-downtime updates:

  1. Update image tag in parameters

  2. Run deploy script

  3. ECS performs rolling replacement

Image Updates

Cost Considerations

Component
Pricing Factor

Fargate

vCPU hours + GB hours

ALB

LCU hours + data processed

NAT Gateway

Per hour + data processed

Secrets Manager

Per secret + API calls

CloudWatch Logs

Data ingested + storage

Last updated