Application services
AWS Cloud
Region · us-east-1
VPC · 10.0.0.0/16
Internet Gateway · public route · ECS security group
Public subnets · 2 AZFargate API tasks · public IP
Private subnets · 2 AZOptional RDS subnet group · Supabase is the app default
Regional services · outside the VPC
ECS clusterECRS3Secrets ManagerSQSSNSTextract API · externalCloudWatchIAM / OIDCEventBridgeLambda DNS · optionalCognito client · optionalBudgets
Hover or focus a service for a short purpose, IaC source and connection.
Push, deploy and DNS update
Budget choice: Cloudflare provides free DNS record management, so the task IP is published directly without an Application Load Balancer (ALB).
1GitHub ActionsPush to main · validate · deploy workflow
2AWS OIDCAssume scoped deploy role without stored AWS keys
3ECR → ECSPush image, register task definition, update Fargate service
4RUNNING eventEventBridge invokes the optional DNS Lambda
5DNS LambdaReads ECS task ENI and gets its public IP using AWS APIs
Cloudflare DNSUpdates the existing A record for bflow-studio.com
DNS sync runs from the ECS task-state event after deployment; it is not a direct GitHub step.
Receipt OCR · S3 + Textract
Asynchronous flow used when the app processes receipt images and extracts expense fields.
1API uploads receiptECS stores the original file in the private S3 bucket.
storage-and-compute.tf · S3StorageService
2Queue OCR requestThe app sends the receipt ID to the encrypted SQS requests queue.
iam-and-messaging.tf
3ECS starts analysisA worker reads the S3 object key and starts asynchronous expense analysis.
iam-and-messaging.tf · ECS task role
4Amazon TextractAnalyzeExpense reads the object from S3; this is an AWS API integration, not a Terraform resource.
not provisioned in Terraform
5Completion notificationTextract publishes to SNS, which delivers the notification to the SQS results queue.
iam-and-messaging.tf
6ECS saves extractionThe results worker fetches fields from Textract and updates receipt status for review.
iam-and-messaging.tf · application
Dead-letter queues handle messages that exceed retry limits. Textract uses the SNS publish role declared in Terraform.