Prerequisites
- An AWS account with permissions to create VPCs, ECS clusters, RDS, ElastiCache, and ALB resources
- Basic knowledge of AWS networking (VPC, subnets, security groups) and ECS concepts
- AWS CLI installed and configured (optional, for CLI examples)
- An Infisical Docker image tag from Docker Hub
System Requirements
The following are minimum requirements for running Infisical on AWS ECS:Deployment Steps
Set up network infrastructure (VPC, subnets, security groups)
- Create a VPC spanning at least two Availability Zones
- In each AZ, create one public subnet (for the ALB) and one private subnet (for ECS tasks, RDS, and Redis)
- Configure route tables: public subnets route to an Internet Gateway, private subnets route to a NAT Gateway
- Deploy a NAT Gateway in a public subnet to allow outbound internet access from private subnets
- This is required for pulling container images and sending emails
- At least 2 public subnets and 2 private subnets across different AZs
- A NAT Gateway with an Elastic IP
- Security groups with the rules described above
Provision the database (PostgreSQL) and cache (Redis)
- Create a PostgreSQL 14+ database instance in the private subnets
- Enable Multi-AZ deployment for high availability
- Disable public accessibility
- Enable automated backups with at least 7-day retention
- Use the RDS security group created earlier
- Create a Redis replication group in the private subnets
- Enable Multi-AZ with automatic failover
- Enable encryption in-transit and at-rest
- Use the Redis security group created earlier
- Database URI:
postgresql://infisical:<password>@<rds-endpoint>:5432/infisical - Redis URI:
redis://<elasticache-endpoint>:6379
Securely store Infisical secrets and configuration
- Parameter Store (SSM)
- Secrets Manager
Set up IAM roles for ECS
ecs-task-execution-trust-policy.json:infisical-task-policy.json:Resource to specific key ARNs used by SSM Parameter Store in your account instead of using "*". You can find your KMS key ARN in the AWS KMS console or by running aws kms list-keys.aws ecs execute-command:Create the ECS cluster and task definition
infisical-task-definition.json:Create the Application Load Balancer
Deploy the ECS service
http://<alb-dns-name> to access the Infisical web interface and create your admin account.
Additional Configuration
Custom Domain with Route 53 and HTTPS
Custom Domain with Route 53 and HTTPS
https://infisical.example.com.SMTP/Email Configuration (AWS SES)
SMTP/Email Configuration (AWS SES)
- Go to AWS SES Console > SMTP Settings > Create SMTP Credentials
- Note the SMTP username and password
VPC Endpoints for ECR (Air-Gapped Environments)
VPC Endpoints for ECR (Air-Gapped Environments)
Database Migrations
Database Migrations
Container Debugging (ECS Exec)
Container Debugging (ECS Exec)
- ECS service must have
--enable-execute-commandflag - Task role must have SSM permissions (included in IAM setup above)
- AWS CLI Session Manager plugin installed locally
Backup Strategy
Backup Strategy
- RDS automated backups are enabled by default (7-day retention recommended)
- Take manual snapshots before upgrades:
ENCRYPTION_KEY in multiple secure locations:- AWS Secrets Manager (already done)
- Offline secure storage (e.g., hardware security module, safe deposit box)
- Secondary AWS region
Upgrade Instructions
Upgrade Instructions
Monitoring and Alerting
Monitoring and Alerting
- Logs are automatically sent to
/ecs/infisicallog group - Set retention policy:
Auto Scaling
Auto Scaling
Infrastructure as Code
Terraform Example
Terraform Example
CloudFormation Example
CloudFormation Example
Troubleshooting
ECS tasks fail to start
ECS tasks fail to start
- Secrets not found: Verify SSM parameters exist and task role has permissions
- Image pull failed: Check ECR permissions or Docker Hub rate limits
- Insufficient resources: Increase task CPU/memory or check Fargate capacity
- Network issues: Verify NAT Gateway is working and security groups allow egress
Database connection errors
Database connection errors
- RDS security group must allow inbound 5432 from ECS tasks security group
- ECS tasks security group must allow outbound to RDS
ALB health checks failing
ALB health checks failing
- Health check path is wrong (should be
/api/status) - Security group doesn’t allow ALB to reach ECS tasks on port 8080
- Application is crashing on startup (check logs)
- Health check timeout is too short (increase to 10 seconds)
Cannot access Infisical in browser
Cannot access Infisical in browser
- Must allow inbound 80/443 from 0.0.0.0/0
- Must match the URL you’re accessing (including protocol)
Emails not sending
Emails not sending
- Ensure SMTP username/password are correct
- Check if you’re still in SES sandbox (can only send to verified emails)
Performance issues
Performance issues
- Scale ECS tasks horizontally (increase desired count)
- Scale RDS vertically (larger instance class)
- Enable RDS Performance Insights for query analysis
- Consider connection pooling (PgBouncer)
ECS Exec not working
ECS Exec not working
- Ensure Session Manager plugin is installed locally
- Verify VPC has route to SSM endpoints (via NAT or VPC endpoint)
- Redeploy service after enabling execute-command