Architecture overview

- GoRules BRMS — Containerized application
- AWS ECS Fargate — Serverless compute engine for containers
- Aurora Serverless v2 — Auto-scaling relational database
Terraform modules are coming soon.
Database — Setting up Aurora Serverless
1. Initiate database creation
- Log in to your AWS Management Console
- Navigate to the RDS (Relational Database Service) dashboard
- Click Create database
2. Choose engine options
- Select “Standard Create”
- Select “Aurora (PostgreSQL-Compatible)” as the engine type
- Under templates, choose “Production” or “Dev/Test” depending on the environment

3. Set up database credentials
- Set “DB cluster identifier” (e.g.,
gorules-aurora-pg-cluster) - Enter a master username (e.g.,
gorules_admin) - Manually create a strong password
- Store this password securely; you’ll need it later as an environment variable

4. Configure database instance
- For “Capacity settings”, choose “Serverless”
- Set the minimum and maximum Aurora Capacity Units (ACUs) based on your expected workload

5. Configure network and security
- Choose the appropriate VPC for your ECS Fargate deployment
- Select or create a new DB Subnet Group
- For “Public access”, choose “No” unless your architecture requires it
- Create or select a VPC security group that allows inbound traffic on the Aurora port (default 5432 for PostgreSQL) from your ECS tasks
6. Additional configuration
- Set the initial database name (e.g.,
gorules_db) - Configure backup retention period as needed
- Enable encryption at rest (recommended)
- Enable deletion protection (recommended)
7. Finalize and create
- Review all settings
- Click Create database at the bottom of the page
8. Wait for completion
- The creation process may take several minutes
- Monitor progress in the RDS dashboard
9. Retrieve connection information
Once the database is available, note down the endpoint. This endpoint will be used in your application’s connection string.Store the master password as an environment variable or in AWS Secrets Manager. Never commit sensitive information to version control.
Container runner — Setting up ECS Fargate
1. Create ECS cluster

- Navigate to the ECS dashboard in the AWS Management Console
- Click Create cluster
- Choose “AWS Fargate” under infrastructure
- Set Cluster name (e.g.,
gorules-cluster) - Optionally enable CloudWatch Container Insights and add tags
- Click Create

2. Create task definition

- In the ECS dashboard, go to “Task Definitions” and click Create new Task Definition
- Set Task Definition Name (e.g.,
gorules-brms-task) - Select “Fargate” as the launch type compatibility
- Under architecture, choose Linux X86_64
- Set Task memory and CPU (for dev environment 0.5 CPU and 1GB RAM is enough)
- Click Add container and configure:
- Container name (e.g.,
gorules-container) - Image URI (from your ECR repository or other registry)
- Port mappings (Port 80)
- Environment variables (including database connection string)
- Container name (e.g.,
- Add any additional containers if required (e.g., for logging or monitoring)
- Click Add to add the container to the task definition
- Review and click Create to create the task definition

3. Create ECS service

- Go to your ECS Cluster
- Click Create under the Services tab
- Configure the service:
- Capacity provider: FARGATE
- Task Definition: Select the task definition you created
- Service name (e.g.,
gorules-service) - Number of tasks: Set based on your requirements
- Configure networking if required
- Configure load balancing (Application Load Balancer)
- Set Auto Scaling if needed (optional):
- Configure service auto scaling based on CPU utilization or other metrics
- Review and click Create Service




Monitor your ECS service in the AWS Console to ensure tasks are running correctly. Set up CloudWatch logs and configure alarms for notifications.
Notes
- To make your service accessible, edit the security group and allow inbound traffic from all IPv4 (or configure appropriately for your needs)
- To obtain
DB_SSL_CA, visit the AWS RDS SSL documentation, find the certificate for your region, and use the GoRules Base64 Certificate tool to convert it