Go to file
Jakub Sokołowski b0cb0ae220
variables.tf: upgrade to Amazon Linux 2 EB image
https://github.com/dap-ps/infra-dapps/issues/22

Signed-off-by: Jakub Sokołowski <jakub@status.im>
2022-10-14 12:40:31 +02:00
ansible inventory: update IP of db.ev host 2022-05-24 17:04:50 +02:00
files drop SSH public key for Artur 2022-10-14 12:37:15 +02:00
modules aws-ec2-instance: upgrade AMI to Ubuntu 22.04 2022-10-14 12:39:22 +02:00
.gitignore upgrade Terraform to 0.14, as well as providers and modules 2021-03-30 11:11:45 +02:00
Makefile upgrade to Terraform 0.13 2020-09-26 18:23:01 +02:00
README.md readme: fix links to stages 2021-01-22 11:48:32 +01:00
ansible.cfg ansible.cfg: ignore warnings about group names 2021-04-13 19:27:54 +02:00
backup.tf use terraform 0.12 formatting 2020-01-22 09:09:16 +01:00
dev.tf change dev EB env instance to t2.micro to match prod 2021-04-13 19:08:59 +02:00
dns.tf delegate dap.ps domain management to Route53 2020-01-27 20:49:05 +01:00
mail.tf mail: upgrade NodeJS from 12.x to 14.x 2022-09-19 12:14:55 +02:00
main.tf drop SSH public key for Artur 2022-10-14 12:37:15 +02:00
outputs.tf comment out smtp outputs for now 2019-08-06 09:43:57 -04:00
prod.tf upgrade to Terraform 0.13 2020-09-26 18:23:01 +02:00
secrets.tf upgrade aws to 3.36.0 and pass to 2.0.0 2021-04-13 19:33:16 +02:00
smtp.tf add more actions to smtp sending policy 2019-08-06 09:02:10 -04:00
variables.tf variables.tf: upgrade to Amazon Linux 2 EB image 2022-10-14 12:40:31 +02:00
versions.tf versions.tf: upgrade Terraform version to 1.3.0 2022-10-14 12:39:44 +02:00

README.md

Description

This repo configures infrastructure for the https://dap.ps/ service.

The service is split into two stages:

Stage With CDN Without CDN
prod https://prod.dap.ps/ https://raw.prod.dap.ps/
dev https://dev.dap.ps/ https://raw.dev.dap.ps/

The prod environment is CNAMEed to dap.ps domain.

Technical Details

Site

The infrastructure is hosted on AWS and consists of 5 main elements:

All the AWS parts are provisioned and managed with Terraform and the MongoDB cluster configured with Ansible.

The dap.ps domain is registered via Gandi DNS provider and is managed with AWS Route53 Hosted Zone by changing the Name Servers with help from Gandi support. See dns.tf for more details.

EMail

There are no mailboxes for dap.ps domain. We forward emails using AWS Lambda and AWS SES. You can change the forwarding rules by editing the defaultConfig object in files/sesforwarder.js and adding Verified Emails in mail.tf.

Usage

Creation of both dev and prod stages is as simple as:

terraform init
terraform apply

And then configure the MongoDB hosts using ansible:

ansible-playbook ansible/dev.yml
ansible-playbook ansible/prod.yml

Known Issues

  • The ElasticBeanstalk environments can fail when being recreated
    • This is mostly due to AWS being slow at destorying resources and their race conditions
  • There is no easy way of making ElasticBeanstalk spread geographically
    • The only way seems to have multiple EB environments linked via ELB
  • CDN can be slow to pick up updates to ElasticBeanstalk application
    • Invalidating the CloudFront cache fixes the issue

TODO

  • #4 - [prod] Geographically spread hosts
  • #11 - [prod] MongoDB Web UI
  • #13 - [prod] Stress test infrastructure

Links

These helped me during work on this setup: