Skip to content

Latest commit

 

History

History
60 lines (50 loc) · 1.62 KB

README.md

File metadata and controls

60 lines (50 loc) · 1.62 KB

Flagsmith AWS Starter kit

Deploying Flagsmith to AWS ECS (with whitenoise)

This is an example, how Flagsmith can be hosted,

This is not production ready solution

AWS infrastructure consists of:

  • IAM
  • Route53 subdomain
  • Networking:
    • VPC
    • Public and private subnets
    • Routing tables
    • Internet Gateway
  • Security Groups
  • Load Balancers, Listeners, and Target Groups
  • IAM Roles and Policies
  • ECS:
    • Task Definition with flagsmith:latest image
    • Cluster
    • Service
  • RDS
  • Secrets with Parameter Store
  • Logs

How to use this project

  1. Register AWS Route53 Hosted Zone
    for example yourdomain.com Route53 hosted zone

  2. Generate certificate with AWS Certificate Manager
    with *.yourdomain.com pattern Certificate

  3. Define your variables like hosted zone domain and more desired settings in terraform.tfvars file

    route53_hosted_zone = "yourdomain.com"

    Currently containers are run on Fargate SPOT instances: ecs_service.tf:

    capacity_provider_strategy {
    capacity_provider = "FARGATE_SPOT"
    weight            = 100
    }
    capacity_provider_strategy {
      capacity_provider = "FARGATE"
      weight            = 0
    }
  4. Generate plan for infrastructure terraform plan -out flagsmith.tfplan

  5. Apply infrastructure by running terraform apply flagsmith.tfplan

After a few minutes flagsmith will be available at your domain

Flagsmith online

you can delete a whole setup by running terraform destroy --auto-approve