Go to file
Jakub Sokołowski a598fe3eaa
deploy a 1GB swap file to prod hosts
For details see:
https://github.com/dap-ps/infra-dapps/issues/19

Signed-off-by: Jakub Sokołowski <jakub@status.im>
2020-03-31 10:21:16 +02:00
ansible deploy a 1GB swap file to prod hosts 2020-03-31 10:21:16 +02:00
files forward admin@dap.ps to jakub@status.im 2020-02-06 17:36:35 +01:00
modules delegate dap.ps domain management to Route53 2020-01-27 20:49:05 +01:00
.gitignore ignore *.tfstate.*.backup 2019-07-25 17:04:52 -04:00
Makefile delegate dap.ps domain management to Route53 2020-01-27 20:49:05 +01:00
README.md mail: move all config from ses.tf to mail.tf 2020-02-04 15:54:39 +01:00
ansible.cfg use python2 by default 2019-08-01 14:12:25 -04:00
backup.tf use terraform 0.12 formatting 2020-01-22 09:09:16 +01:00
dev.tf use Status IPFS cluster 2020-01-27 20:49:21 +01:00
dns.tf delegate dap.ps domain management to Route53 2020-01-27 20:49:05 +01:00
mail.tf fix MX record for dap.ps 2020-02-06 17:44:54 +01:00
main.tf drop unused dns provider 2020-01-27 21:06:08 +01:00
outputs.tf comment out smtp outputs for now 2019-08-06 09:43:57 -04:00
prod.tf use Status IPFS cluster 2020-01-27 20:49:21 +01:00
smtp.tf add more actions to smtp sending policy 2019-08-06 09:02:10 -04:00
variables.tf delegate dap.ps domain management to Route53 2020-01-27 20:49:05 +01:00
versions.tf delegate dap.ps domain management to Route53 2020-01-27 20:49:05 +01: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.sp/ https://raw.prod.dap.sp/
dev https://dev.dap.ps/ https://raw.dev.dap.sp/

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

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: